summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2009-07-03 05:08:33 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2009-07-03 05:08:33 +0000
commit0e445fcef6a803e0b321964b3c739f6dc9f2a82d (patch)
tree2ab1303b93f85bf25ecb32a8c4396af52b599b5d
parentc41f13f7d8d3c3fe4ee1ed8a94f5492f7adc6945 (diff)
downloadrockbox-0e445fcef6a803e0b321964b3c739f6dc9f2a82d.tar.gz
rockbox-0e445fcef6a803e0b321964b3c739f6dc9f2a82d.zip
Fix the bug where the short-long fwd/back action would ffwd/rewind the next folder (consult the manual if that makes no sense)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21619 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/action.c21
-rw-r--r--apps/action.h6
-rw-r--r--apps/gui/gwps.c2
3 files changed, 29 insertions, 0 deletions
diff --git a/apps/action.c b/apps/action.c
index f493296a03..ee84706b09 100644
--- a/apps/action.c
+++ b/apps/action.c
@@ -40,6 +40,7 @@ static int last_button = BUTTON_NONE|BUTTON_REL; /* allow the ipod wheel to
40static intptr_t last_data = 0; 40static intptr_t last_data = 0;
41static int last_action = ACTION_NONE; 41static int last_action = ACTION_NONE;
42static bool repeated = false; 42static bool repeated = false;
43static bool wait_for_release = false;
43 44
44#ifdef HAVE_TOUCHSCREEN 45#ifdef HAVE_TOUCHSCREEN
45static bool short_press = false; 46static bool short_press = false;
@@ -127,6 +128,16 @@ static int get_action_worker(int context, int timeout,
127 /* Data from sys events can be pulled with button_get_data */ 128 /* Data from sys events can be pulled with button_get_data */
128 if (button == BUTTON_NONE || button & SYS_EVENT) 129 if (button == BUTTON_NONE || button & SYS_EVENT)
129 return button; 130 return button;
131 /* Don't send any buttons through untill we see the release event */
132 if (wait_for_release)
133 {
134 if (button&BUTTON_REL)
135 {
136 wait_for_release = false;
137 }
138 return ACTION_NONE;
139 }
140
130 141
131#if CONFIG_CODEC == SWCODEC 142#if CONFIG_CODEC == SWCODEC
132 /* Produce keyclick */ 143 /* Produce keyclick */
@@ -329,3 +340,13 @@ int action_get_touchscreen_press(short *x, short *y)
329 return BUTTON_TOUCHSCREEN; 340 return BUTTON_TOUCHSCREEN;
330} 341}
331#endif 342#endif
343
344/* Don't let get_action*() return any ACTION_* values untill the current buttons
345 * have ben release. SYS_* and BUTTON_NONE will go through.
346 * Any actions relying on _RELEASE won't get seen
347 */
348void action_wait_for_release(void)
349{
350 wait_for_release = true;
351}
352
diff --git a/apps/action.h b/apps/action.h
index 3e53b6d7a8..dd81d13818 100644
--- a/apps/action.h
+++ b/apps/action.h
@@ -295,4 +295,10 @@ intptr_t get_action_data(void);
295int action_get_touchscreen_press(short *x, short *y); 295int action_get_touchscreen_press(short *x, short *y);
296#endif 296#endif
297 297
298/* Don't let get_action*() return any ACTION_* values untill the current buttons
299 * have ben release. SYS_* and BUTTON_NONE will go through.
300 * Any actions relying on _RELEASE won't get seen
301 */
302void action_wait_for_release(void);
303
298#endif /* __ACTION_H__ */ 304#endif /* __ACTION_H__ */
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c
index 50382a58ad..0b41f88cdc 100644
--- a/apps/gui/gwps.c
+++ b/apps/gui/gwps.c
@@ -135,6 +135,8 @@ static void change_dir(int direction)
135 audio_prev_dir(); 135 audio_prev_dir();
136 else if (direction > 0) 136 else if (direction > 0)
137 audio_next_dir(); 137 audio_next_dir();
138 /* prevent the next dir to immediatly start being ffw'd */
139 action_wait_for_release();
138} 140}
139 141
140static void prev_track(unsigned long skip_thresh) 142static void prev_track(unsigned long skip_thresh)