summaryrefslogtreecommitdiff
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
parent000cff5bae1576091ee9c23e33066bd3341d38d2 (diff)
downloadrockbox-71411ee83a224034c5779c8046539fdd136d213f.tar.gz
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
-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,
467 467
468 case WPS_TOKEN_PLAYBACK_STATUS: 468 case WPS_TOKEN_PLAYBACK_STATUS:
469 { 469 {
470 int status = audio_status(); 470 int status = current_playmode();
471 int mode = 1; 471 /* music */
472 if (status == AUDIO_STATUS_PLAY) 472 int mode = 1; /* stop */
473 mode = 2; 473 if (status == STATUS_PLAY)
474 if (is_wps_fading() || 474 mode = 2; /* play */
475 (status & AUDIO_STATUS_PAUSE && !status_get_ffmode())) 475 if (is_wps_fading() ||
476 mode = 3; 476 (status == STATUS_PAUSE && !status_get_ffmode()))
477 if (status_get_ffmode() == STATUS_FASTFORWARD) 477 mode = 3; /* pause */
478 mode = 4; 478 else
479 if (status_get_ffmode() == STATUS_FASTBACKWARD) 479 { /* ff / rwd */
480 mode = 5; 480 if (status_get_ffmode() == STATUS_FASTFORWARD)
481 mode = 4;
482 if (status_get_ffmode() == STATUS_FASTBACKWARD)
483 mode = 5;
484 }
485 /* recording */
486 if (status == STATUS_RECORD)
487 mode = 6;
488 else if (status == STATUS_RECORD_PAUSE)
489 mode = 7;
490 /* radio */
491 if (status == STATUS_RADIO)
492 mode = 8;
493 else if (status == STATUS_RADIO_PAUSE)
494 mode = 9;
481 495
482 if (intval) { 496 if (intval) {
483 *intval = mode; 497 *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)
564 eeprom_settings_store(); 564 eeprom_settings_store();
565 } 565 }
566#endif 566#endif
567 status_init();
568 playlist_init(); 567 playlist_init();
569 tree_mem_init(); 568 tree_mem_init();
570 filetype_init(); 569 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 @@
27#include "radio.h" 27#include "radio.h"
28#endif 28#endif
29 29
30static enum playmode ff_mode; 30static enum playmode ff_mode = 0;
31
32void status_init(void)
33{
34 ff_mode = 0;
35}
36 31
37void status_set_ffmode(enum playmode mode) 32void status_set_ffmode(enum playmode mode)
38{ 33{
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
41 STATUS_RADIO_PAUSE 41 STATUS_RADIO_PAUSE
42}; 42};
43 43
44void status_init(void);
45void status_set_ffmode(enum playmode mode); 44void status_set_ffmode(enum playmode mode);
46enum playmode status_get_ffmode(void); 45enum playmode status_get_ffmode(void);
47int current_playmode(void); 46int current_playmode(void);