diff options
-rw-r--r-- | apps/status.c | 7 | ||||
-rw-r--r-- | apps/status.h | 1 | ||||
-rw-r--r-- | apps/wps-display.c | 67 | ||||
-rw-r--r-- | docs/CREDITS | 1 | ||||
-rw-r--r-- | docs/CUSTOM_WPS_FORMAT | 12 |
5 files changed, 88 insertions, 0 deletions
diff --git a/apps/status.c b/apps/status.c index 3cb6722bca..c7f46db6fb 100644 --- a/apps/status.c +++ b/apps/status.c | |||
@@ -82,6 +82,13 @@ void status_set_ffmode(enum playmode mode) | |||
82 | status_draw(false); | 82 | status_draw(false); |
83 | } | 83 | } |
84 | 84 | ||
85 | enum playmode status_get_ffmode(void) | ||
86 | { | ||
87 | /* only use this function for STATUS_FASTFORWARD or STATUS_FASTBACKWARD */ | ||
88 | /* use audio_status() for other modes */ | ||
89 | return ff_mode; | ||
90 | } | ||
91 | |||
85 | int current_playmode(void) | 92 | int current_playmode(void) |
86 | { | 93 | { |
87 | int audio_stat = audio_status(); | 94 | int audio_stat = audio_status(); |
diff --git a/apps/status.h b/apps/status.h index a3c471bafd..0d8c80d7a8 100644 --- a/apps/status.h +++ b/apps/status.h | |||
@@ -32,6 +32,7 @@ enum playmode | |||
32 | 32 | ||
33 | void status_init(void); | 33 | void status_init(void); |
34 | void status_set_ffmode(enum playmode mode); | 34 | void status_set_ffmode(enum playmode mode); |
35 | enum playmode status_get_ffmode(void); | ||
35 | #ifdef HAVE_LCD_BITMAP | 36 | #ifdef HAVE_LCD_BITMAP |
36 | bool statusbar(bool state); | 37 | bool statusbar(bool state); |
37 | #if CONFIG_KEYPAD == RECORDER_PAD | 38 | #if CONFIG_KEYPAD == RECORDER_PAD |
diff --git a/apps/wps-display.c b/apps/wps-display.c index 11a2506611..318da5a717 100644 --- a/apps/wps-display.c +++ b/apps/wps-display.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include "powermgmt.h" | 43 | #include "powermgmt.h" |
44 | #include "sprintf.h" | 44 | #include "sprintf.h" |
45 | #include "backlight.h" | 45 | #include "backlight.h" |
46 | #include "button.h" | ||
46 | 47 | ||
47 | #ifdef HAVE_LCD_BITMAP | 48 | #ifdef HAVE_LCD_BITMAP |
48 | #include "icons.h" | 49 | #include "icons.h" |
@@ -578,6 +579,72 @@ static char* get_tag(struct mp3entry* cid3, | |||
578 | 579 | ||
579 | } | 580 | } |
580 | break; | 581 | break; |
582 | |||
583 | case 'm': /* playback repeat mode */ | ||
584 | switch (tag[1]) | ||
585 | { | ||
586 | case 'f': /* off */ | ||
587 | if (global_settings.repeat_mode == REPEAT_OFF) | ||
588 | return "f"; | ||
589 | else | ||
590 | return NULL; | ||
591 | case 'a': /* all */ | ||
592 | if (global_settings.repeat_mode == REPEAT_ALL) | ||
593 | return "a"; | ||
594 | else | ||
595 | return NULL; | ||
596 | case 'o': /* one */ | ||
597 | if (global_settings.repeat_mode == REPEAT_ONE) | ||
598 | return "o"; | ||
599 | else | ||
600 | return NULL; | ||
601 | case 's': /* shuffle */ | ||
602 | if (global_settings.repeat_mode == REPEAT_SHUFFLE) | ||
603 | return "s"; | ||
604 | else | ||
605 | return NULL; | ||
606 | /* playback status */ | ||
607 | case 'p': /* play */ | ||
608 | *flags |= WPS_REFRESH_DYNAMIC; | ||
609 | int status = audio_status(); | ||
610 | if (status == AUDIO_STATUS_PLAY && \ | ||
611 | !(status & AUDIO_STATUS_PAUSE)) | ||
612 | return "p"; | ||
613 | else | ||
614 | return NULL; | ||
615 | case 'u': /* pause*/ | ||
616 | *flags |= WPS_REFRESH_DYNAMIC; | ||
617 | if (audio_status() & AUDIO_STATUS_PAUSE && \ | ||
618 | (! status_get_ffmode())) | ||
619 | return "u"; | ||
620 | else | ||
621 | return NULL; | ||
622 | case 'w': /* fast forward */ | ||
623 | *flags |= WPS_REFRESH_DYNAMIC; | ||
624 | if (status_get_ffmode() == STATUS_FASTFORWARD) | ||
625 | return "w"; | ||
626 | else | ||
627 | return NULL; | ||
628 | case 'b': /* Fast backwards */ | ||
629 | *flags |= WPS_REFRESH_DYNAMIC; | ||
630 | if (status_get_ffmode() == STATUS_FASTBACKWARD) | ||
631 | return "b"; | ||
632 | else | ||
633 | return NULL; | ||
634 | case 'h': /* hold */ | ||
635 | *flags |= WPS_REFRESH_DYNAMIC; | ||
636 | if (button_hold()) | ||
637 | return "h"; | ||
638 | else | ||
639 | return NULL; | ||
640 | case 'r': /* remote hold */ | ||
641 | *flags |= WPS_REFRESH_DYNAMIC; | ||
642 | if (remote_button_hold()) | ||
643 | return "r"; | ||
644 | else | ||
645 | return NULL; | ||
646 | } | ||
647 | break; | ||
581 | 648 | ||
582 | case 'b': /* battery info */ | 649 | case 'b': /* battery info */ |
583 | *flags |= WPS_REFRESH_DYNAMIC; | 650 | *flags |= WPS_REFRESH_DYNAMIC; |
diff --git a/docs/CREDITS b/docs/CREDITS index 2e7e064faf..6b1d893d08 100644 --- a/docs/CREDITS +++ b/docs/CREDITS | |||
@@ -131,3 +131,4 @@ Frederic Devernay | |||
131 | José M. Fandiño | 131 | José M. Fandiño |
132 | Gadi Cohen | 132 | Gadi Cohen |
133 | Naftali Goldstein | 133 | Naftali Goldstein |
134 | David Dent | ||
diff --git a/docs/CUSTOM_WPS_FORMAT b/docs/CUSTOM_WPS_FORMAT index 171a7d5906..87dd5c35f6 100644 --- a/docs/CUSTOM_WPS_FORMAT +++ b/docs/CUSTOM_WPS_FORMAT | |||
@@ -67,6 +67,18 @@ Playlist/Song Info Tags: | |||
67 | %pt : Total Track Time | 67 | %pt : Total Track Time |
68 | %pv : Current volume | 68 | %pv : Current volume |
69 | 69 | ||
70 | Repeat mode tags: | ||
71 | %mf : repeat off, returns f | ||
72 | %ma : repeat all, returns a | ||
73 | %mo : repeat one, returns o | ||
74 | %ms : repeat shuffle, returns s | ||
75 | |||
76 | Playback mode tags: | ||
77 | %mp : play, returns p | ||
78 | %mu : pause, returns u | ||
79 | %mw : fastforward, returns w | ||
80 | %mb : fastbackward, returns b | ||
81 | |||
70 | Conditional Tags (If/Else block): | 82 | Conditional Tags (If/Else block): |
71 | %?xx<|> : Conditional: if the tag specified by "xx" has a value, the | 83 | %?xx<|> : Conditional: if the tag specified by "xx" has a value, the |
72 | text between the "<" and the "|" is displayed, else the text | 84 | text between the "<" and the "|" is displayed, else the text |