Emit a signal for stream-changed

https://bugzilla.gnome.org/show_bug.cgi?id=744140
This commit is contained in:
Alexander Hofbauer 2015-02-07 19:22:56 +01:00 committed by Bastien Nocera
parent 0a79019088
commit 7e5504db3d
2 changed files with 31 additions and 0 deletions

View File

@ -104,6 +104,7 @@ enum {
STATE_CHANGED,
STREAM_ADDED,
STREAM_REMOVED,
STREAM_CHANGED,
CARD_ADDED,
CARD_REMOVED,
DEFAULT_SINK_CHANGED,
@ -1526,6 +1527,11 @@ update_sink (GvcMixerControl *control,
/* Always sink on a new stream to able to assign the right stream id
* to the appropriate outputs (multiple potential outputs per stream). */
sync_devices (control, stream);
} else {
g_signal_emit (G_OBJECT (control),
signals[STREAM_CHANGED],
0,
gvc_mixer_stream_get_id (stream));
}
/*
@ -1646,6 +1652,11 @@ update_source (GvcMixerControl *control,
g_object_ref (stream));
add_stream (control, stream);
sync_devices (control, stream);
} else {
g_signal_emit (G_OBJECT (control),
signals[STREAM_CHANGED],
0,
gvc_mixer_stream_get_id (stream));
}
if (control->priv->profile_swapping_device_id != GVC_MIXER_UI_DEVICE_INVALID) {
@ -1751,6 +1762,11 @@ update_sink_input (GvcMixerControl *control,
GUINT_TO_POINTER (info->index),
g_object_ref (stream));
add_stream (control, stream);
} else {
g_signal_emit (G_OBJECT (control),
signals[STREAM_CHANGED],
0,
gvc_mixer_stream_get_id (stream));
}
}
@ -1797,6 +1813,11 @@ update_source_output (GvcMixerControl *control,
GUINT_TO_POINTER (info->index),
g_object_ref (stream));
add_stream (control, stream);
} else {
g_signal_emit (G_OBJECT (control),
signals[STREAM_CHANGED],
0,
gvc_mixer_stream_get_id (stream));
}
}
@ -3208,6 +3229,14 @@ gvc_mixer_control_class_init (GvcMixerControlClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__UINT,
G_TYPE_NONE, 1, G_TYPE_UINT);
signals [STREAM_CHANGED] =
g_signal_new ("stream-changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GvcMixerControlClass, stream_changed),
NULL, NULL,
g_cclosure_marshal_VOID__UINT,
G_TYPE_NONE, 1, G_TYPE_UINT);
signals [CARD_ADDED] =
g_signal_new ("card-added",
G_TYPE_FROM_CLASS (klass),

View File

@ -59,6 +59,8 @@ typedef struct
GvcMixerControlState new_state);
void (*stream_added) (GvcMixerControl *control,
guint id);
void (*stream_changed) (GvcMixerControl *control,
guint id);
void (*stream_removed) (GvcMixerControl *control,
guint id);
void (*card_added) (GvcMixerControl *control,