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
This commit is contained in:
parent
b2e94eff7f
commit
d9874b266e
5 changed files with 88 additions and 0 deletions
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -131,3 +131,4 @@ Frederic Devernay
|
|||
José M. Fandiño
|
||||
Gadi Cohen
|
||||
Naftali Goldstein
|
||||
David Dent
|
||||
|
|
|
@ -67,6 +67,18 @@ Playlist/Song Info Tags:
|
|||
%pt : Total Track Time
|
||||
%pv : Current volume
|
||||
|
||||
Repeat mode tags:
|
||||
%mf : repeat off, returns f
|
||||
%ma : repeat all, returns a
|
||||
%mo : repeat one, returns o
|
||||
%ms : repeat shuffle, returns s
|
||||
|
||||
Playback mode tags:
|
||||
%mp : play, returns p
|
||||
%mu : pause, returns u
|
||||
%mw : fastforward, returns w
|
||||
%mb : fastbackward, returns b
|
||||
|
||||
Conditional Tags (If/Else block):
|
||||
%?xx<|> : Conditional: if the tag specified by "xx" has a value, the
|
||||
text between the "<" and the "|" is displayed, else the text
|
||||
|
|
Loading…
Reference in a new issue