diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2013-07-07 15:54:23 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2013-07-07 15:54:23 +0200 |
commit | 02b89aa2d2e0df87cb51bae8ffcbfb6439e474dc (patch) | |
tree | 7baec4fcdb02ee926af4947513ae9dad2697d503 /src/ui_act.c | |
parent | f6df7d7e510f2d8879ec54dce32fee2b691dc32d (diff) | |
download | pianobar-02b89aa2d2e0df87cb51bae8ffcbfb6439e474dc.tar.gz pianobar-02b89aa2d2e0df87cb51bae8ffcbfb6439e474dc.tar.bz2 pianobar-02b89aa2d2e0df87cb51bae8ffcbfb6439e474dc.zip |
Add keyboard shortcut to reset volume
Closes #377.
Diffstat (limited to 'src/ui_act.c')
-rw-r--r-- | src/ui_act.c | 18 |
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) |