From: Philip Chimento Date: Sat, 16 Jul 2011 19:18:45 +0000 (+0200) Subject: Implement volume change notifications X-Git-Tag: v0.9~47^2~2 X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=1b895ec59efa2ff68e7ca57a4d7ada77f46162ce;p=projects%2Fchimara%2Fchimara.git Implement volume change notifications --- diff --git a/libchimara/schannel.c b/libchimara/schannel.c index 71c2727..f4c7bd6 100644 --- a/libchimara/schannel.c +++ b/libchimara/schannel.c @@ -691,9 +691,8 @@ channel_set_volume_immediately(schanid_t chan, double volume, glui32 notify) { g_object_set(chan->filter, "volume", volume, NULL); - if(notify != 0) { - /* Send a notification */ - } + if(notify != 0) + event_throw(chan->glk, evtype_VolumeNotify, NULL, 0, notify); } /** @@ -747,9 +746,9 @@ volume_change_timeout(schanid_t chan) /* We're done - make sure the volume is at the requested level */ g_object_set(chan->filter, "volume", chan->target_volume, NULL); - if(chan->volume_notify) { - /* Send a notification */ - } + if(chan->volume_notify) + event_throw(chan->glk, evtype_VolumeNotify, NULL, 0, chan->volume_notify); + return FALSE; } @@ -762,9 +761,6 @@ volume_change_timeout(schanid_t chan) g_object_get(chan->filter, "volume", ¤t_volume, NULL); double volume_step = (chan->target_volume - current_volume) / steps_left; - g_printerr("Time left: %.2f ms\nVolume difference: %.2f\nVolume step: %.4f\n", - time_left_msec, chan->target_volume - current_volume, volume_step); - g_object_set(chan->filter, "volume", current_volume + volume_step, NULL); return TRUE;