summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-03-18 07:08:49 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-03-18 07:08:49 +0000
commitd2e2c2ad96222a55a5005edbbdea3fe755c388a5 (patch)
tree6b8b52bf1b82502afe1f62f08d1f6359c735ac91 /apps
parentc3c928b29feb592ec9a4d9c93580611d129c991d (diff)
downloadrockbox-d2e2c2ad96222a55a5005edbbdea3fe755c388a5.tar.gz
rockbox-d2e2c2ad96222a55a5005edbbdea3fe755c388a5.tar.bz2
rockbox-d2e2c2ad96222a55a5005edbbdea3fe755c388a5.zip
2 new tags:
%pS - track is starting. %pE - track is ending. both can optionally have a number straight after to change how long that tag should stay true for (e.g %pS10 will stay true for the first 10s of the track) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25239 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/skin_engine/skin_parser.c4
-rw-r--r--apps/gui/skin_engine/skin_tokens.c17
-rw-r--r--apps/gui/skin_engine/skin_tokens.h2
3 files changed, 23 insertions, 0 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index 7f73d36577..70ffe0b516 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -328,6 +328,8 @@ static const struct wps_tag all_tags[] = {
{ WPS_TOKEN_TRACK_TIME_ELAPSED, "pc", WPS_REFRESH_DYNAMIC, NULL },
{ WPS_TOKEN_TRACK_TIME_REMAINING, "pr", WPS_REFRESH_DYNAMIC, NULL },
{ WPS_TOKEN_TRACK_LENGTH, "pt", WPS_REFRESH_STATIC, NULL },
+ { WPS_TOKEN_TRACK_STARTING, "pS", WPS_REFRESH_DYNAMIC, parse_timeout },
+ { WPS_TOKEN_TRACK_ENDING, "pE", WPS_REFRESH_DYNAMIC, parse_timeout },
{ WPS_TOKEN_PLAYLIST_POSITION, "pp", WPS_REFRESH_STATIC, NULL },
{ WPS_TOKEN_PLAYLIST_ENTRIES, "pe", WPS_REFRESH_STATIC, NULL },
@@ -1106,6 +1108,8 @@ static int parse_timeout(const char *wps_bufptr,
case WPS_TOKEN_SUBLINE_TIMEOUT:
return -1;
case WPS_TOKEN_BUTTON_VOLUME:
+ case WPS_TOKEN_TRACK_STARTING:
+ case WPS_TOKEN_TRACK_ENDING:
val = 10;
break;
}
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c
index 486a2efc76..df2c42e727 100644
--- a/apps/gui/skin_engine/skin_tokens.c
+++ b/apps/gui/skin_engine/skin_tokens.c
@@ -896,6 +896,23 @@ const char *get_token_value(struct gui_wps *gwps,
token->value.i * TIMEOUT_UNIT))
return "v";
return NULL;
+
+ case WPS_TOKEN_TRACK_STARTING:
+ if (id3)
+ {
+ int elapsed = id3->elapsed + + state->ff_rewind_count;
+ if (elapsed < token->value.i * HZ)
+ return "starting";
+ }
+ return NULL;
+ case WPS_TOKEN_TRACK_ENDING:
+ if (id3)
+ {
+ int elapsed = id3->elapsed + + state->ff_rewind_count;
+ if (id3->length - elapsed < token->value.i * HZ)
+ return "ending";
+ }
+ return NULL;
case WPS_TOKEN_LASTTOUCH:
#ifdef HAVE_TOUCHSCREEN
if (TIME_BEFORE(current_tick, token->value.i * TIMEOUT_UNIT +
diff --git a/apps/gui/skin_engine/skin_tokens.h b/apps/gui/skin_engine/skin_tokens.h
index d20a6ee2e6..c953ccbffc 100644
--- a/apps/gui/skin_engine/skin_tokens.h
+++ b/apps/gui/skin_engine/skin_tokens.h
@@ -178,6 +178,8 @@ enum wps_token_type {
WPS_TOKEN_TRACK_TIME_ELAPSED,
WPS_TOKEN_TRACK_TIME_REMAINING,
WPS_TOKEN_TRACK_LENGTH,
+ WPS_TOKEN_TRACK_STARTING,
+ WPS_TOKEN_TRACK_ENDING,
/* Playlist */
TOKEN_MARKER_PLAYLIST,