summaryrefslogtreecommitdiff
path: root/apps/wps.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/wps.c')
-rw-r--r--apps/wps.c36
1 files changed, 31 insertions, 5 deletions
diff --git a/apps/wps.c b/apps/wps.c
index 7a9a5de60b..31fcd2cb6d 100644
--- a/apps/wps.c
+++ b/apps/wps.c
@@ -52,6 +52,7 @@
52#include "sound.h" 52#include "sound.h"
53#include "onplay.h" 53#include "onplay.h"
54#include "abrepeat.h" 54#include "abrepeat.h"
55#include "playback.h"
55 56
56#define FF_REWIND_MAX_PERCENT 3 /* cap ff/rewind step size at max % of file */ 57#define FF_REWIND_MAX_PERCENT 3 /* cap ff/rewind step size at max % of file */
57 /* 3% of 30min file == 54s step size */ 58 /* 3% of 30min file == 54s step size */
@@ -64,9 +65,6 @@ static struct mp3entry* id3 = NULL;
64static struct mp3entry* nid3 = NULL; 65static struct mp3entry* nid3 = NULL;
65static char current_track_path[MAX_PATH+1]; 66static char current_track_path[MAX_PATH+1];
66 67
67void audio_next_dir(void);
68void audio_prev_dir(void);
69
70/* set volume 68/* set volume
71 return true if screen restore is needed 69 return true if screen restore is needed
72 return false otherwise 70 return false otherwise
@@ -337,6 +335,8 @@ long wps_show(void)
337 long restoretimer = 0; /* timer to delay screen redraw temporarily */ 335 long restoretimer = 0; /* timer to delay screen redraw temporarily */
338 bool exit = false; 336 bool exit = false;
339 bool update_track = false; 337 bool update_track = false;
338 unsigned long right_lastclick = 0;
339 unsigned long left_lastclick = 0;
340 340
341 id3 = nid3 = NULL; 341 id3 = nid3 = NULL;
342 current_track_path[0] = '\0'; 342 current_track_path[0] = '\0';
@@ -555,12 +555,30 @@ long wps_show(void)
555 break; 555 break;
556 556
557 /* fast forward / rewind */ 557 /* fast forward / rewind */
558 case WPS_FFWD:
559 case WPS_REW:
560#ifdef WPS_RC_FFWD 558#ifdef WPS_RC_FFWD
561 case WPS_RC_FFWD: 559 case WPS_RC_FFWD:
560#endif
561 case WPS_FFWD:
562#ifdef WPS_NEXT_DIR
563 if (current_tick - right_lastclick < HZ)
564 {
565 audio_next_dir();
566 right_lastclick = 0;
567 break;
568 }
569#endif
570#ifdef WPS_RC_REW
562 case WPS_RC_REW: 571 case WPS_RC_REW:
563#endif 572#endif
573 case WPS_REW:
574#ifdef WPS_PREV_DIR
575 if (current_tick - left_lastclick < HZ)
576 {
577 audio_prev_dir();
578 left_lastclick = 0;
579 break;
580 }
581#endif
564 ffwd_rew(button); 582 ffwd_rew(button);
565 break; 583 break;
566 584
@@ -577,6 +595,7 @@ long wps_show(void)
577 break; 595 break;
578#endif 596#endif
579#endif 597#endif
598 left_lastclick = current_tick;
580 599
581#ifdef AB_REPEAT_ENABLE 600#ifdef AB_REPEAT_ENABLE
582 /* if we're in A/B repeat mode and the current position 601 /* if we're in A/B repeat mode and the current position
@@ -604,13 +623,19 @@ long wps_show(void)
604 } 623 }
605 break; 624 break;
606 625
626#ifdef WPS_NEXT_DIR
607#ifdef WPS_RC_NEXT_DIR 627#ifdef WPS_RC_NEXT_DIR
608 case WPS_RC_NEXT_DIR: 628 case WPS_RC_NEXT_DIR:
629#endif
630 case WPS_NEXT_DIR:
609 audio_next_dir(); 631 audio_next_dir();
610 break; 632 break;
611#endif 633#endif
634#ifdef WPS_PREV_DIR
612#ifdef WPS_RC_PREV_DIR 635#ifdef WPS_RC_PREV_DIR
613 case WPS_RC_PREV_DIR: 636 case WPS_RC_PREV_DIR:
637#endif
638 case WPS_PREV_DIR:
614 audio_prev_dir(); 639 audio_prev_dir();
615 break; 640 break;
616#endif 641#endif
@@ -628,6 +653,7 @@ long wps_show(void)
628 break; 653 break;
629#endif 654#endif
630#endif 655#endif
656 right_lastclick = current_tick;
631 657
632#ifdef AB_REPEAT_ENABLE 658#ifdef AB_REPEAT_ENABLE
633 /* if we're in A/B repeat mode and the current position is 659 /* if we're in A/B repeat mode and the current position is