summaryrefslogtreecommitdiff
path: root/backends/pulse/pulse-sink-input.c
diff options
context:
space:
mode:
authorMichal Ratajsky <[email protected]>2016-01-04 21:50:08 +0100
committerMichal Ratajsky <[email protected]>2016-01-05 11:18:38 +0100
commitc03e76c83ed49335390cdb9e3a8e63df4d73e0c5 (patch)
treede057f689b582f23f63d348530c0d27a0c9518cb /backends/pulse/pulse-sink-input.c
parent299e1a26e5eb5d6625feba2a9db017f43d9d853c (diff)
downloadlibmatemixer-c03e76c83ed49335390cdb9e3a8e63df4d73e0c5.tar.bz2
libmatemixer-c03e76c83ed49335390cdb9e3a8e63df4d73e0c5.tar.xz
pulse: Use own PulseAudio connection in stream controls
Diffstat (limited to 'backends/pulse/pulse-sink-input.c')
-rw-r--r--backends/pulse/pulse-sink-input.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/backends/pulse/pulse-sink-input.c b/backends/pulse/pulse-sink-input.c
index c20a820..16637c8 100644
--- a/backends/pulse/pulse-sink-input.c
+++ b/backends/pulse/pulse-sink-input.c
@@ -64,7 +64,9 @@ pulse_sink_input_init (PulseSinkInput *input)
}
PulseSinkInput *
-pulse_sink_input_new (PulseSink *sink, const pa_sink_input_info *info)
+pulse_sink_input_new (PulseConnection *connection,
+ const pa_sink_input_info *info,
+ PulseSink *parent)
{
PulseSinkInput *input;
gchar *name;
@@ -79,8 +81,9 @@ pulse_sink_input_new (PulseSink *sink, const pa_sink_input_info *info)
MateMixerStreamControlMediaRole media_role = MATE_MIXER_STREAM_CONTROL_MEDIA_ROLE_UNKNOWN;
- g_return_val_if_fail (PULSE_IS_SINK (sink), NULL);
+ g_return_val_if_fail (PULSE_IS_CONNECTION (connection), NULL);
g_return_val_if_fail (info != NULL, NULL);
+ g_return_val_if_fail (PULSE_IS_SINK (parent), NULL);
/* Many mixer applications query the Pulse client list and use the client
* name here, but we use the name only as an identifier, so let's avoid
@@ -141,8 +144,9 @@ pulse_sink_input_new (PulseSink *sink, const pa_sink_input_info *info)
"flags", flags,
"role", role,
"media-role", media_role,
+ "stream", parent,
+ "connection", connection,
"index", info->index,
- "stream", sink,
NULL);
g_free (name);
@@ -197,7 +201,7 @@ pulse_sink_input_set_mute (PulseStreamControl *psc, gboolean mute)
{
g_return_val_if_fail (PULSE_IS_SINK_INPUT (psc), FALSE);
- return pulse_connection_set_sink_input_mute (PULSE_STREAM_CONTROL_GET_CONNECTION (psc),
+ return pulse_connection_set_sink_input_mute (pulse_stream_control_get_connection (psc),
pulse_stream_control_get_index (psc),
mute);
}
@@ -208,7 +212,7 @@ pulse_sink_input_set_volume (PulseStreamControl *psc, pa_cvolume *cvolume)
g_return_val_if_fail (PULSE_IS_SINK_INPUT (psc), FALSE);
g_return_val_if_fail (cvolume != NULL, FALSE);
- return pulse_connection_set_sink_input_volume (PULSE_STREAM_CONTROL_GET_CONNECTION (psc),
+ return pulse_connection_set_sink_input_volume (pulse_stream_control_get_connection (psc),
pulse_stream_control_get_index (psc),
cvolume);
}
@@ -230,7 +234,7 @@ pulse_sink_input_create_monitor (PulseStreamControl *psc)
return NULL;
}
- return pulse_connection_create_monitor (PULSE_STREAM_CONTROL_GET_CONNECTION (psc),
+ return pulse_connection_create_monitor (pulse_stream_control_get_connection (psc),
index,
pulse_stream_control_get_index (psc));
}