summaryrefslogtreecommitdiff
path: root/src/ui_act.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui_act.c')
-rw-r--r--src/ui_act.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/ui_act.c b/src/ui_act.c
index 0f73018..270c1f5 100644
--- a/src/ui_act.c
+++ b/src/ui_act.c
@@ -647,20 +647,30 @@ BarUiActCallback(BarUiActBookmark) {
}
}
+static void BarUiActUpdateScale (BarApp_t *app) {
+ /* FIXME: assuming unsigned integer store is atomic operation */
+ app->player.scale = BarPlayerCalcScale (app->player.gain + app->settings.volume);
+}
+
/* decrease volume
*/
BarUiActCallback(BarUiActVolDown) {
--app->settings.volume;
- /* FIXME: assuming unsigned integer store is atomic operation */
- app->player.scale = BarPlayerCalcScale (app->player.gain + app->settings.volume);
+ BarUiActUpdateScale (app);
}
/* increase volume
*/
BarUiActCallback(BarUiActVolUp) {
++app->settings.volume;
- /* FIXME: assuming unsigned integer store is atomic operation */
- app->player.scale = BarPlayerCalcScale (app->player.gain + app->settings.volume);
+ BarUiActUpdateScale (app);
+}
+
+/* reset volume
+ */
+BarUiActCallback(BarUiActVolReset) {
+ app->settings.volume = 0;
+ BarUiActUpdateScale (app);
}
/* manage station (remove seeds or feedback)