From 71411ee83a224034c5779c8046539fdd136d213f Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Fri, 16 Oct 2009 19:14:28 +0000 Subject: 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 --- apps/gui/skin_engine/skin_tokens.c | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) (limited to 'apps/gui/skin_engine') 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; -- cgit v1.2.3