summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2005-08-21 19:17:50 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2005-08-21 19:17:50 +0000
commitd9874b266ee420e214bdc8c9c96d946c0a922203 (patch)
tree13fb4c05dfd6873af4e3832b549707972ab352d6 /apps
parentb2e94eff7fee70c57574610eb03093ddc9ef7985 (diff)
downloadrockbox-d9874b266ee420e214bdc8c9c96d946c0a922203.tar.gz
rockbox-d9874b266ee420e214bdc8c9c96d946c0a922203.tar.bz2
rockbox-d9874b266ee420e214bdc8c9c96d946c0a922203.zip
Committed the "[ 1247788 ] Adds wps tags for repeat modes" patch.
Please revert back should it cause problems. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7371 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/status.c7
-rw-r--r--apps/status.h1
-rw-r--r--apps/wps-display.c67
3 files changed, 75 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)
status_draw(false);
}
+enum playmode status_get_ffmode(void)
+{
+ /* only use this function for STATUS_FASTFORWARD or STATUS_FASTBACKWARD */
+ /* use audio_status() for other modes */
+ return ff_mode;
+}
+
int current_playmode(void)
{
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
void status_init(void);
void status_set_ffmode(enum playmode mode);
+enum playmode status_get_ffmode(void);
#ifdef HAVE_LCD_BITMAP
bool statusbar(bool state);
#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 @@
#include "powermgmt.h"
#include "sprintf.h"
#include "backlight.h"
+#include "button.h"
#ifdef HAVE_LCD_BITMAP
#include "icons.h"
@@ -578,6 +579,72 @@ static char* get_tag(struct mp3entry* cid3,
}
break;
+
+ case 'm': /* playback repeat mode */
+ switch (tag[1])
+ {
+ case 'f': /* off */
+ if (global_settings.repeat_mode == REPEAT_OFF)
+ return "f";
+ else
+ return NULL;
+ case 'a': /* all */
+ if (global_settings.repeat_mode == REPEAT_ALL)
+ return "a";
+ else
+ return NULL;
+ case 'o': /* one */
+ if (global_settings.repeat_mode == REPEAT_ONE)
+ return "o";
+ else
+ return NULL;
+ case 's': /* shuffle */
+ if (global_settings.repeat_mode == REPEAT_SHUFFLE)
+ return "s";
+ else
+ return NULL;
+ /* playback status */
+ case 'p': /* play */
+ *flags |= WPS_REFRESH_DYNAMIC;
+ int status = audio_status();
+ if (status == AUDIO_STATUS_PLAY && \
+ !(status & AUDIO_STATUS_PAUSE))
+ return "p";
+ else
+ return NULL;
+ case 'u': /* pause*/
+ *flags |= WPS_REFRESH_DYNAMIC;
+ if (audio_status() & AUDIO_STATUS_PAUSE && \
+ (! status_get_ffmode()))
+ return "u";
+ else
+ return NULL;
+ case 'w': /* fast forward */
+ *flags |= WPS_REFRESH_DYNAMIC;
+ if (status_get_ffmode() == STATUS_FASTFORWARD)
+ return "w";
+ else
+ return NULL;
+ case 'b': /* Fast backwards */
+ *flags |= WPS_REFRESH_DYNAMIC;
+ if (status_get_ffmode() == STATUS_FASTBACKWARD)
+ return "b";
+ else
+ return NULL;
+ case 'h': /* hold */
+ *flags |= WPS_REFRESH_DYNAMIC;
+ if (button_hold())
+ return "h";
+ else
+ return NULL;
+ case 'r': /* remote hold */
+ *flags |= WPS_REFRESH_DYNAMIC;
+ if (remote_button_hold())
+ return "r";
+ else
+ return NULL;
+ }
+ break;
case 'b': /* battery info */
*flags |= WPS_REFRESH_DYNAMIC;