summaryrefslogtreecommitdiff
path: root/src/ui_act.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2010-12-26 18:56:40 +0100
committerLars-Dominik Braun <lars@6xq.net>2010-12-27 13:43:06 +0100
commitb452bc6cd392fcb7631a5d5c4d794aafd5e380e9 (patch)
tree252ca5a8b261f7ffc33b058c13cba49eb6385398 /src/ui_act.c
parent46b837ce695ca844db9f408512b43b592eab5126 (diff)
downloadpianobar-b452bc6cd392fcb7631a5d5c4d794aafd5e380e9.tar.gz
pianobar-b452bc6cd392fcb7631a5d5c4d794aafd5e380e9.tar.bz2
pianobar-b452bc6cd392fcb7631a5d5c4d794aafd5e380e9.zip
Software volume control
Diffstat (limited to 'src/ui_act.c')
-rw-r--r--src/ui_act.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/ui_act.c b/src/ui_act.c
index 679f098..0ed55ec 100644
--- a/src/ui_act.c
+++ b/src/ui_act.c
@@ -103,6 +103,8 @@ BarUiActCallback(BarUiActHelp) {
"select quickmix stations",
NULL,
"bookmark song/artist",
+ "decrease volume",
+ "increase volume",
};
size_t i;
@@ -564,3 +566,19 @@ BarUiActCallback(BarUiActBookmark) {
}
}
+/* 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);
+}
+
+/* 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);
+}
+