added volume control

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1117 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2002-06-20 09:10:14 +00:00
parent 601924a777
commit 1a3b6478b8

View file

@ -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;