chiark
/
gitweb
/
~mdw
/
disorder
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rewrite playrtp ALSA support. The result seems to be much more
[disorder]
/
disobedience
/
control.c
diff --git
a/disobedience/control.c
b/disobedience/control.c
index ecdc1a6bb9f6ba8da2dfd0c8e4637511b662a3f0..e1f44f28fcea9102aee9d42b1940575d5b154df5 100644
(file)
--- a/
disobedience/control.c
+++ b/
disobedience/control.c
@@
-67,8
+67,8
@@
static gchar *format_balance(GtkScale *scale, gdouble value);
/* Control bar ------------------------------------------------------------- */
/* Control bar ------------------------------------------------------------- */
-/** @brief Guard against feedback
loop in volume control
*/
-
static int suppress_set_volume
;
+/** @brief Guard against feedback */
+
int suppress_actions = 1
;
/** @brief Definition of an icon
*
/** @brief Definition of an icon
*
@@
-303,10
+303,10
@@
void volume_update(void) {
D(("volume_update"));
l = volume_l / 100.0;
r = volume_r / 100.0;
D(("volume_update"));
l = volume_l / 100.0;
r = volume_r / 100.0;
- ++suppress_
set_volume
;
+ ++suppress_
actions
;
gtk_adjustment_set_value(volume_adj, volume(l, r) * goesupto);
gtk_adjustment_set_value(balance_adj, balance(l, r));
gtk_adjustment_set_value(volume_adj, volume(l, r) * goesupto);
gtk_adjustment_set_value(balance_adj, balance(l, r));
- --suppress_
set_volume
;
+ --suppress_
actions
;
}
/** @brief Update the state of one of the control icons
}
/** @brief Update the state of one of the control icons
@@
-399,14
+399,16
@@
static void clicked_icon(GtkButton attribute((unused)) *button,
gpointer userdata) {
const struct icon *icon = userdata;
gpointer userdata) {
const struct icon *icon = userdata;
- icon->action(client, 0, 0);
+ if(!suppress_actions)
+ icon->action(client, 0, 0);
}
static void clicked_menu(GtkMenuItem attribute((unused)) *menuitem,
gpointer userdata) {
const struct icon *icon = userdata;
}
static void clicked_menu(GtkMenuItem attribute((unused)) *menuitem,
gpointer userdata) {
const struct icon *icon = userdata;
- icon->action(client, 0, 0);
+ if(!suppress_actions)
+ icon->action(client, 0, 0);
}
static void toggled_menu(GtkCheckMenuItem *menuitem,
}
static void toggled_menu(GtkCheckMenuItem *menuitem,
@@
-414,6
+416,8
@@
static void toggled_menu(GtkCheckMenuItem *menuitem,
const struct icon *icon = userdata;
size_t n;
const struct icon *icon = userdata;
size_t n;
+ if(suppress_actions)
+ return;
/* This is a bit fiddlier than the others, we need to find the action for the
* new state. If the new state is active then we want the ICON_INACTIVE
* version and vica versa. */
/* This is a bit fiddlier than the others, we need to find the action for the
* new state. If the new state is active then we want the ICON_INACTIVE
* version and vica versa. */
@@
-431,7
+435,7
@@
static void volume_adjusted(GtkAdjustment attribute((unused)) *a,
double v = gtk_adjustment_get_value(volume_adj) / goesupto;
double b = gtk_adjustment_get_value(balance_adj);
double v = gtk_adjustment_get_value(volume_adj) / goesupto;
double b = gtk_adjustment_get_value(balance_adj);
- if(suppress_
set_volume
)
+ if(suppress_
actions
)
/* This is the result of an update from the server, not a change from the
* user. Don't feedback! */
return;
/* This is the result of an update from the server, not a change from the
* user. Don't feedback! */
return;