From 1b895ec59efa2ff68e7ca57a4d7ada77f46162ce Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Sat, 16 Jul 2011 21:18:45 +0200 Subject: [PATCH] Implement volume change notifications --- libchimara/schannel.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) 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; -- 2.30.2