From 1a3b6478b8339d7fd7a98f054a4564443991b55c Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Thu, 20 Jun 2002 09:10:14 +0000 Subject: [PATCH] added volume control git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1117 a1c6a512-1295-4272-9138-f99709370657 --- apps/play.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/apps/play.c b/apps/play.c index 5949372e04..330f4a10b6 100644 --- a/apps/play.c +++ b/apps/play.c @@ -31,6 +31,7 @@ #include "id3.h" #include "mpeg.h" +#include "settings.h" #ifdef MPEG_PLAY #include "mpegplay.h" @@ -91,9 +92,39 @@ void playtune(char *filename) while(1) { switch ( button_get(true) ) { #ifdef HAVE_RECORDER_KEYPAD + case BUTTON_UP: + global_settings.volume += 2; + if(global_settings.volume > 100) + global_settings.volume = 100; + mpeg_volume(global_settings.volume); + break; + + case BUTTON_DOWN: + global_settings.volume -= 2; + if(global_settings.volume < 0) + global_settings.volume = 0; + mpeg_volume(global_settings.volume); + break; + case BUTTON_OFF: case BUTTON_LEFT: + return; + break; #else + case BUTTON_RIGHT: + global_settings.volume += 2; + if(global_settings.volume > 100) + global_settings.volume = 100; + mpeg_volume(global_settings.volume); + break; + + case BUTTON_LEFT: + global_settings.volume -= 2; + if(global_settings.volume < 0) + global_settings.volume = 0; + mpeg_volume(global_settings.volume); + break; + case BUTTON_STOP: #endif return;