diff options
author | Zeeshan Ali <zeenix@gmail.com> | 2008-02-11 12:20:26 +0000 |
---|---|---|
committer | Zeeshan Ali <zeenix@gmail.com> | 2008-02-11 12:20:26 +0000 |
commit | a0df7ce26eb1bce223a64f4ae9ecd5e60762214c (patch) | |
tree | a0f7e32d65fd507dfdd43f1276019abc5733fae6 /src/av-cp/renderer-controls.c | |
parent | 63d97130a9de68cd8104597c3ce21c44f2f99223 (diff) | |
download | gupnp-tools-a0df7ce26eb1bce223a64f4ae9ecd5e60762214c.tar.gz |
Block the signal handlers on the scales when the value is set by the app.
Block the 'value-changed' signal handlers on the scales when the value
is changed by the application rather than user.
git-svn-id: https://svn.o-hand.com/repos/gupnp/trunk/gupnp-tools@761 d8cb91d7-bff9-0310-92b9-80b65e4482b2
Diffstat (limited to 'src/av-cp/renderer-controls.c')
-rw-r--r-- | src/av-cp/renderer-controls.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/av-cp/renderer-controls.c b/src/av-cp/renderer-controls.c index c93787e..6122d74 100644 --- a/src/av-cp/renderer-controls.c +++ b/src/av-cp/renderer-controls.c @@ -222,10 +222,22 @@ set_av_transport_uri_cb (GUPnPServiceProxy *av_transport, g_object_unref (av_transport); } +gboolean +on_volume_vscale_value_changed (GtkRange *range, + gpointer user_data); + void set_volume_hscale (guint volume) { + g_signal_handlers_block_by_func (volume_vscale, + on_volume_vscale_value_changed, + NULL); + gtk_range_set_value (GTK_RANGE (volume_vscale), volume); + + g_signal_handlers_unblock_by_func (volume_vscale, + on_volume_vscale_value_changed, + NULL); } void @@ -401,7 +413,17 @@ set_position_hscale_position (const char *position_str) position = seconds_from_time (position_str); if (position >= 0.0) { + g_signal_handlers_block_by_func + (position_hscale, + on_position_hscale_value_changed, + NULL); + gtk_range_set_value (GTK_RANGE (position_hscale), position); + + g_signal_handlers_unblock_by_func + (position_hscale, + on_position_hscale_value_changed, + NULL); } } @@ -540,7 +562,17 @@ prepare_controls_for_state (PlaybackState state) /* Disable the seekbar when the state is stopped */ gtk_widget_set_sensitive (position_hscale, stop_possible); if (!stop_possible) { + g_signal_handlers_block_by_func + (position_hscale, + on_position_hscale_value_changed, + NULL); + gtk_range_set_value (GTK_RANGE (position_hscale), 0.0); + + g_signal_handlers_unblock_by_func + (position_hscale, + on_position_hscale_value_changed, + NULL); } gtk_widget_set_sensitive (play_button, play_possible); |