From b81d9ed11fae7bee59b67b1aee9927e417666875 Mon Sep 17 00:00:00 2001 From: Michal Ratajsky Date: Thu, 3 Jul 2014 20:48:08 +0200 Subject: PulseAudio and API fixes --- backends/pulse/pulse-sink.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'backends/pulse/pulse-sink.c') diff --git a/backends/pulse/pulse-sink.c b/backends/pulse/pulse-sink.c index b7a440b..27d1466 100644 --- a/backends/pulse/pulse-sink.c +++ b/backends/pulse/pulse-sink.c @@ -23,6 +23,7 @@ #include #include "pulse-connection.h" +#include "pulse-device.h" #include "pulse-monitor.h" #include "pulse-stream.h" #include "pulse-sink.h" @@ -75,23 +76,25 @@ pulse_sink_init (PulseSink *sink) } PulseStream * -pulse_sink_new (PulseConnection *connection, const pa_sink_info *info) +pulse_sink_new (PulseConnection *connection, + const pa_sink_info *info, + PulseDevice *device) { - PulseSink *sink; + PulseStream *stream; g_return_val_if_fail (PULSE_IS_CONNECTION (connection), NULL); g_return_val_if_fail (info != NULL, NULL); /* Consider the sink index as unchanging parameter */ - sink = g_object_new (PULSE_TYPE_SINK, - "connection", connection, - "index", info->index, - NULL); + stream = g_object_new (PULSE_TYPE_SINK, + "connection", connection, + "index", info->index, + NULL); /* Other data may change at any time, so let's make a use of our update function */ - pulse_sink_update (PULSE_STREAM (sink), info); + pulse_sink_update (stream, info, device); - return PULSE_STREAM (sink); + return stream; } guint32 @@ -103,7 +106,7 @@ pulse_sink_get_monitor_index (PulseStream *stream) } gboolean -pulse_sink_update (PulseStream *stream, const pa_sink_info *info) +pulse_sink_update (PulseStream *stream, const pa_sink_info *info, PulseDevice *device) { MateMixerStreamFlags flags = MATE_MIXER_STREAM_OUTPUT | MATE_MIXER_STREAM_HAS_MUTE | @@ -177,11 +180,12 @@ pulse_sink_update (PulseStream *stream, const pa_sink_info *info) /* Flags must be updated before volume */ pulse_stream_update_flags (stream, flags); - pulse_stream_update_volume_extended (stream, - &info->volume, - &info->channel_map, - info->base_volume, - info->n_volume_steps); + pulse_stream_update_volume (stream, + &info->volume, + &info->channel_map, + info->base_volume); + + pulse_stream_update_device (stream, MATE_MIXER_DEVICE (device)); sink = PULSE_SINK (stream); -- cgit v1.2.1