Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: [PATCH] Player WPS fixes
From: Magnus Holmgren (lear_at_algonet.se)
Date: 2002-08-16


Hi,

The attached patch fixes the broken menu+left/right for volume change on
players. Releasing left/right while holding menu down would cause a
button event resulting in mpeg_next/mpeg_prev... Also makes the related
code a bit clearer (based on zuggestions from Zagor) and adds
status_draw() when the volume changes (player only; but wasn't that
added earlier?).

Note: only tested on a player. Hope I didn't break recorder compiles...
:)

-- 
Magnus Holmgren

Index: apps/wps.c
===================================================================
RCS file: /cvsroot/rockbox/apps/wps.c,v
retrieving revision 1.70
diff -u -r1.70 wps.c
--- apps/wps.c 15 Aug 2002 16:55:46 -0000 1.70
+++ apps/wps.c 15 Aug 2002 21:56:45 -0000
@@ -569,52 +711,73 @@
                 break;

             case BUTTON_LEFT | BUTTON_REL:
- if (ff_rewind)
+ if (!keys_locked)
                 {
- /* rewind */
- mpeg_ff_rewind(ff_rewind_count);
- ff_rewind_count = 0;
- ff_rewind = false;
- status_set_playmode(STATUS_PLAY);
+ if (ff_rewind)
+ {
+ /* rewind */
+ mpeg_ff_rewind(ff_rewind_count);
+ ff_rewind_count = 0;
+ ff_rewind = false;
+ status_set_playmode(STATUS_PLAY);
 #ifdef HAVE_LCD_CHARCELLS
- draw_screen(id3);
+ draw_screen(id3);
 #endif
+ }
+#ifdef HAVE_PLAYER_KEYPAD
+ else if(!menu_button_is_down)
+#else
+ else
+#endif
+ {
+ mpeg_prev();
+ status_set_playmode(STATUS_PLAY);
+ }
                 }
+#ifdef HAVE_PLAYER_KEYPAD
+ else if(!menu_button_is_down)
+#else
                 else
+#endif
                 {
- if (keys_locked)
- {
- display_keylock_text(keys_locked);
- draw_screen(id3);
- break;
- }
- mpeg_prev();
- status_set_playmode(STATUS_PLAY);
+ display_keylock_text(keys_locked);
+ draw_screen(id3);
                 }
                 break;

             case BUTTON_RIGHT | BUTTON_REL:
- if (ff_rewind)
+ if (!keys_locked)
                 {
- /* fast forward */
- mpeg_ff_rewind(ff_rewind_count);
- ff_rewind_count = 0;
- ff_rewind = false;
- status_set_playmode(STATUS_PLAY);
+ if (ff_rewind)
+ {
+ /* fast forward */
+ mpeg_ff_rewind(ff_rewind_count);
+ ff_rewind_count = 0;
+ ff_rewind = false;
+ status_set_playmode(STATUS_PLAY);
 #ifdef HAVE_LCD_CHARCELLS
- draw_screen(id3);
+ draw_screen(id3);
+#endif
+ }
+#ifdef HAVE_PLAYER_KEYPAD
+ else if(!menu_button_is_down)
+#else
+ else
 #endif
+ {
+ mpeg_next();
+ status_set_playmode(STATUS_PLAY);
+ }
                 }
+#ifdef HAVE_PLAYER_KEYPAD
+ else if(!menu_button_is_down)
+#else
                 else
+#endif
                 {
- if (keys_locked)
- {
- display_keylock_text(keys_locked);
- draw_screen(id3);
- break;
- }
- mpeg_next();
- status_set_playmode(STATUS_PLAY);
+ display_keylock_text(keys_locked);
+ draw_screen(id3);
+ break;
                 }
                 break;

@@ -626,6 +789,7 @@
                 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);
+ status_draw();
                 settings_save();
                 break;

@@ -636,6 +800,7 @@
                 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);
+ status_draw();
                 settings_save();
                 break;



Page was last modified "Jan 10 2012" The Rockbox Crew
aaa