summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-10-16 19:14:28 +0000
committerThomas Martitz <kugel@rockbox.org>2009-10-16 19:14:28 +0000
commit71411ee83a224034c5779c8046539fdd136d213f (patch)
treecd0ca6e9f0c39df44b5facc06461391fd2483a60 /apps
parent000cff5bae1576091ee9c23e33066bd3341d38d2 (diff)
downloadrockbox-71411ee83a224034c5779c8046539fdd136d213f.tar.gz
rockbox-71411ee83a224034c5779c8046539fdd136d213f.tar.bz2
rockbox-71411ee83a224034c5779c8046539fdd136d213f.zip
Change %mp tag to use current_playmode(). It has upto 9 values now, including recording and radio states.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23206 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/skin_engine/skin_tokens.c36
-rw-r--r--apps/main.c1
-rw-r--r--apps/status.c7
-rw-r--r--apps/status.h1
4 files changed, 26 insertions, 19 deletions
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c
index ad4613ed99..2df087bb70 100644
--- a/apps/gui/skin_engine/skin_tokens.c
+++ b/apps/gui/skin_engine/skin_tokens.c
@@ -467,17 +467,31 @@ const char *get_token_value(struct gui_wps *gwps,
case WPS_TOKEN_PLAYBACK_STATUS:
{
- int status = audio_status();
- int mode = 1;
- if (status == AUDIO_STATUS_PLAY)
- mode = 2;
- if (is_wps_fading() ||
- (status & AUDIO_STATUS_PAUSE && !status_get_ffmode()))
- mode = 3;
- if (status_get_ffmode() == STATUS_FASTFORWARD)
- mode = 4;
- if (status_get_ffmode() == STATUS_FASTBACKWARD)
- mode = 5;
+ int status = current_playmode();
+ /* music */
+ int mode = 1; /* stop */
+ if (status == STATUS_PLAY)
+ mode = 2; /* play */
+ if (is_wps_fading() ||
+ (status == STATUS_PAUSE && !status_get_ffmode()))
+ mode = 3; /* pause */
+ else
+ { /* ff / rwd */
+ if (status_get_ffmode() == STATUS_FASTFORWARD)
+ mode = 4;
+ if (status_get_ffmode() == STATUS_FASTBACKWARD)
+ mode = 5;
+ }
+ /* recording */
+ if (status == STATUS_RECORD)
+ mode = 6;
+ else if (status == STATUS_RECORD_PAUSE)
+ mode = 7;
+ /* radio */
+ if (status == STATUS_RADIO)
+ mode = 8;
+ else if (status == STATUS_RADIO_PAUSE)
+ mode = 9;
if (intval) {
*intval = mode;
diff --git a/apps/main.c b/apps/main.c
index 58ff1381b7..f48dd2d0a0 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -564,7 +564,6 @@ static void init(void)
eeprom_settings_store();
}
#endif
- status_init();
playlist_init();
tree_mem_init();
filetype_init();
diff --git a/apps/status.c b/apps/status.c
index 92f29c1b83..485ca0aa34 100644
--- a/apps/status.c
+++ b/apps/status.c
@@ -27,12 +27,7 @@
#include "radio.h"
#endif
-static enum playmode ff_mode;
-
-void status_init(void)
-{
- ff_mode = 0;
-}
+static enum playmode ff_mode = 0;
void status_set_ffmode(enum playmode mode)
{
diff --git a/apps/status.h b/apps/status.h
index 8a7a69bc64..36b723ecb8 100644
--- a/apps/status.h
+++ b/apps/status.h
@@ -41,7 +41,6 @@ enum playmode
STATUS_RADIO_PAUSE
};
-void status_init(void);
void status_set_ffmode(enum playmode mode);
enum playmode status_get_ffmode(void);
int current_playmode(void);