summaryrefslogtreecommitdiff
path: root/backends/pulse/pulse-source-output.c
diff options
context:
space:
mode:
authorMichal Ratajsky <[email protected]>2014-06-23 00:54:20 +0200
committerMichal Ratajsky <[email protected]>2014-06-23 00:54:20 +0200
commitc00c008f789781748706e3f77410cde844602e4a (patch)
treedf3a895eed814cc9988e7ce2b24ec0427b1c8457 /backends/pulse/pulse-source-output.c
parent18ff80676c9ecce7f875a0bcb8190bd5a1dc1b00 (diff)
downloadlibmatemixer-c00c008f789781748706e3f77410cde844602e4a.tar.bz2
libmatemixer-c00c008f789781748706e3f77410cde844602e4a.tar.xz
Support source output parent, minor fixes
Diffstat (limited to 'backends/pulse/pulse-source-output.c')
-rw-r--r--backends/pulse/pulse-source-output.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/backends/pulse/pulse-source-output.c b/backends/pulse/pulse-source-output.c
index 50269ce..dcd5eb3 100644
--- a/backends/pulse/pulse-source-output.c
+++ b/backends/pulse/pulse-source-output.c
@@ -69,7 +69,9 @@ pulse_source_output_init (PulseSourceOutput *output)
}
PulseStream *
-pulse_source_output_new (PulseConnection *connection, const pa_source_output_info *info)
+pulse_source_output_new (PulseConnection *connection,
+ const pa_source_output_info *info,
+ PulseStream *parent)
{
PulseSourceOutput *output;
@@ -83,13 +85,15 @@ pulse_source_output_new (PulseConnection *connection, const pa_source_output_inf
NULL);
/* Other data may change at any time, so let's make a use of our update function */
- pulse_source_output_update (PULSE_STREAM (output), info);
+ pulse_source_output_update (PULSE_STREAM (output), info, parent);
return PULSE_STREAM (output);
}
gboolean
-pulse_source_output_update (PulseStream *stream, const pa_source_output_info *info)
+pulse_source_output_update (PulseStream *stream,
+ const pa_source_output_info *info,
+ PulseStream *parent)
{
MateMixerStreamFlags flags = MATE_MIXER_STREAM_INPUT |
MATE_MIXER_STREAM_CLIENT;
@@ -114,19 +118,19 @@ pulse_source_output_update (PulseStream *stream, const pa_source_output_info *in
prop = pa_proplist_gets (info->proplist, PA_PROP_APPLICATION_NAME);
if (prop != NULL)
- pulse_client_stream_update_app_name (MATE_MIXER_CLIENT_STREAM (stream), prop);
+ pulse_client_stream_update_app_name (PULSE_CLIENT_STREAM (stream), prop);
prop = pa_proplist_gets (info->proplist, PA_PROP_APPLICATION_ID);
if (prop != NULL)
- pulse_client_stream_update_app_id (MATE_MIXER_CLIENT_STREAM (stream), prop);
+ pulse_client_stream_update_app_id (PULSE_CLIENT_STREAM (stream), prop);
prop = pa_proplist_gets (info->proplist, PA_PROP_APPLICATION_VERSION);
if (prop != NULL)
- pulse_client_stream_update_app_version (MATE_MIXER_CLIENT_STREAM (stream), prop);
+ pulse_client_stream_update_app_version (PULSE_CLIENT_STREAM (stream), prop);
prop = pa_proplist_gets (info->proplist, PA_PROP_APPLICATION_ICON_NAME);
if (prop != NULL)
- pulse_client_stream_update_app_icon (MATE_MIXER_CLIENT_STREAM (stream), prop);
+ pulse_client_stream_update_app_icon (PULSE_CLIENT_STREAM (stream), prop);
prop = pa_proplist_gets (info->proplist, PA_PROP_MEDIA_ROLE);
@@ -173,6 +177,12 @@ pulse_source_output_update (PulseStream *stream, const pa_source_output_info *in
pulse_stream_update_volume (stream, NULL, &info->channel_map);
#endif
+ if (G_LIKELY (parent != NULL))
+ pulse_client_stream_update_parent (PULSE_CLIENT_STREAM (stream),
+ MATE_MIXER_STREAM (parent));
+ else
+ pulse_client_stream_update_parent (PULSE_CLIENT_STREAM (stream), NULL);
+
// XXX needs to fix monitor if parent changes
g_object_thaw_notify (G_OBJECT (stream));