diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2002-07-23 22:24:26 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2002-07-23 22:24:26 +0000 |
commit | 226a5649afad9d5e5e7f89e4851f403aea78c597 (patch) | |
tree | 5aa3860d13428dbe1b1ef5a8684b2180cee0c5d9 /apps | |
parent | 669edf680d75bfbd03ce3e762f40a115059d7db4 (diff) |
Now uses ON+LEFT and ON+RIGHT for volume control
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1424 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/wps.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/apps/wps.c b/apps/wps.c index d919261461..270f3ae1de 100644 --- a/apps/wps.c +++ b/apps/wps.c @@ -127,6 +127,9 @@ int wps_show(void) unsigned int lastlength=0, lastsize=0, lastrate=0; int lastartist=0, lastalbum=0, lasttitle=0; bool lastvbr = false; +#ifdef HAVE_PLAYER_KEYPAD + bool dont_quit = true; +#endif lcd_clear_display(); @@ -192,7 +195,13 @@ int wps_show(void) for ( i=0;i<5;i++ ) { switch ( button_get(false) ) { case BUTTON_ON: +#ifdef HAVE_PLAYER_KEYPAD + /* We don't want to quit just yet. Let's wait until + the key is released. */ + break; +#else return 0; +#endif #ifdef HAVE_RECORDER_KEYPAD case BUTTON_PLAY: @@ -248,6 +257,33 @@ int wps_show(void) mpeg_next(); break; +#ifdef HAVE_PLAYER_KEYPAD + case BUTTON_LEFT | BUTTON_ON: + dont_quit = true; + global_settings.volume--; + if(global_settings.volume < mpeg_sound_min(SOUND_VOLUME)) + global_settings.volume = mpeg_sound_min(SOUND_VOLUME); + mpeg_sound_set(SOUND_VOLUME, global_settings.volume); + break; + + case BUTTON_RIGHT | BUTTON_ON: + dont_quit = true; + global_settings.volume++; + if(global_settings.volume > mpeg_sound_max(SOUND_VOLUME)) + global_settings.volume = mpeg_sound_max(SOUND_VOLUME); + mpeg_sound_set(SOUND_VOLUME, global_settings.volume); + break; + + case BUTTON_ON | BUTTON_REL: + /* Quit if ON has been pressed without changing + the volume */ + if(!dont_quit) + return 0; + + dont_quit = false; + break; +#endif + #ifdef HAVE_RECORDER_KEYPAD case BUTTON_F1: #else |