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;
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;
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;
--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