From ad214980e84c32ac93b43301f54406c6952c0819 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Fri, 4 Feb 2011 12:17:06 +0000 Subject: active-sink api beginning to emerge --- src/pulseaudio-mgr.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/pulseaudio-mgr.c') diff --git a/src/pulseaudio-mgr.c b/src/pulseaudio-mgr.c index 5f128eb..5089e23 100644 --- a/src/pulseaudio-mgr.c +++ b/src/pulseaudio-mgr.c @@ -30,7 +30,7 @@ with this program. If not, see . #include #include -#include "pulse-manager.h" +#include "pulseaudio-mgr.h" #define RECONNECT_DELAY 5 @@ -376,8 +376,8 @@ pm_sink_input_info_callback (pa_context *c, } ActiveSink* a_sink = ACTIVE_SINK (userdata); - if (active_sink_get_index (a_sink) == info->sink->index && - active_sink_is_muted () == TRUE) { + if (active_sink_get_index (a_sink) == info->sink && + active_sink_is_muted (a_sink) == TRUE) { // TODO fire off blocking signal } } @@ -393,7 +393,13 @@ pm_update_active_sink (pa_context *c, return; } else{ - + if (IS_ACTIVE_SINK (userdata) == FALSE){ + g_warning ("update_active_sink - our user data is not what we think it should be"); + return; + } + pa_volume_t vol = pa_cvolume_max (&info->volume); + gdouble volume_percent = ((gdouble) vol * 100) / PA_VOLUME_NORM; + active_sink_update_volume (ACTIVE_SINK(userdata), volume_percent); } } -- cgit v1.2.3