X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/df44d69ba50cd4769c33ae6de3d9e6ff76e5a502..6d1302f09d1a6958f3cddfd3c6564ee2c0b4813a:/disobedience/control.c diff --git a/disobedience/control.c b/disobedience/control.c index ba5b202..6efadda 100644 --- a/disobedience/control.c +++ b/disobedience/control.c @@ -51,8 +51,6 @@ static void volume_adjusted(GtkAdjustment *a, gpointer user_data); static gchar *format_volume(GtkScale *scale, gdouble value); static gchar *format_balance(GtkScale *scale, gdouble value); -static void control_monitor(void *u); - /* Control bar ------------------------------------------------------------- */ static int suppress_set_volume; @@ -87,6 +85,15 @@ static struct icon { GtkAdjustment *volume_adj, *balance_adj; +/** @brief Called whenever last_state changes in any way */ +static void control_monitor(void attribute((unused)) *u) { + int n; + + D(("control_monitor")); + for(n = 0; n < NICONS; ++n) + icons[n].update(&icons[n]); +} + /* Create the control bar */ GtkWidget *control_widget(void) { GtkWidget *hbox = gtk_hbox_new(FALSE, 1), *vbox; @@ -158,12 +165,11 @@ GtkWidget *control_widget(void) { return hbox; } -/** @brief Update the control bar after some kind of state change */ -void control_update(void) { +/** @brief Update the volume control when it changes */ +void volume_update(void) { double l, r; - D(("control_update")); - /*control_monitor(0, disorder_eclient_state(client));*/ + D(("volume_update")); l = volume_l / 100.0; r = volume_r / 100.0; ++suppress_set_volume; @@ -172,13 +178,6 @@ void control_update(void) { --suppress_set_volume; } -static void control_monitor(void attribute((unused)) *u) { - int n; - - for(n = 0; n < NICONS; ++n) - icons[n].update(&icons[n]); -} - /** @brief Update the state of one of the control icons * @param icon Target icon * @param visible True if this version of the button should be visible