diff options
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 4 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_tokens.c | 17 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_tokens.h | 2 |
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[] = { | |||
328 | { WPS_TOKEN_TRACK_TIME_ELAPSED, "pc", WPS_REFRESH_DYNAMIC, NULL }, | 328 | { WPS_TOKEN_TRACK_TIME_ELAPSED, "pc", WPS_REFRESH_DYNAMIC, NULL }, |
329 | { WPS_TOKEN_TRACK_TIME_REMAINING, "pr", WPS_REFRESH_DYNAMIC, NULL }, | 329 | { WPS_TOKEN_TRACK_TIME_REMAINING, "pr", WPS_REFRESH_DYNAMIC, NULL }, |
330 | { WPS_TOKEN_TRACK_LENGTH, "pt", WPS_REFRESH_STATIC, NULL }, | 330 | { WPS_TOKEN_TRACK_LENGTH, "pt", WPS_REFRESH_STATIC, NULL }, |
331 | { WPS_TOKEN_TRACK_STARTING, "pS", WPS_REFRESH_DYNAMIC, parse_timeout }, | ||
332 | { WPS_TOKEN_TRACK_ENDING, "pE", WPS_REFRESH_DYNAMIC, parse_timeout }, | ||
331 | 333 | ||
332 | { WPS_TOKEN_PLAYLIST_POSITION, "pp", WPS_REFRESH_STATIC, NULL }, | 334 | { WPS_TOKEN_PLAYLIST_POSITION, "pp", WPS_REFRESH_STATIC, NULL }, |
333 | { WPS_TOKEN_PLAYLIST_ENTRIES, "pe", WPS_REFRESH_STATIC, NULL }, | 335 | { WPS_TOKEN_PLAYLIST_ENTRIES, "pe", WPS_REFRESH_STATIC, NULL }, |
@@ -1106,6 +1108,8 @@ static int parse_timeout(const char *wps_bufptr, | |||
1106 | case WPS_TOKEN_SUBLINE_TIMEOUT: | 1108 | case WPS_TOKEN_SUBLINE_TIMEOUT: |
1107 | return -1; | 1109 | return -1; |
1108 | case WPS_TOKEN_BUTTON_VOLUME: | 1110 | case WPS_TOKEN_BUTTON_VOLUME: |
1111 | case WPS_TOKEN_TRACK_STARTING: | ||
1112 | case WPS_TOKEN_TRACK_ENDING: | ||
1109 | val = 10; | 1113 | val = 10; |
1110 | break; | 1114 | break; |
1111 | } | 1115 | } |
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, | |||
896 | token->value.i * TIMEOUT_UNIT)) | 896 | token->value.i * TIMEOUT_UNIT)) |
897 | return "v"; | 897 | return "v"; |
898 | return NULL; | 898 | return NULL; |
899 | |||
900 | case WPS_TOKEN_TRACK_STARTING: | ||
901 | if (id3) | ||
902 | { | ||
903 | int elapsed = id3->elapsed + + state->ff_rewind_count; | ||
904 | if (elapsed < token->value.i * HZ) | ||
905 | return "starting"; | ||
906 | } | ||
907 | return NULL; | ||
908 | case WPS_TOKEN_TRACK_ENDING: | ||
909 | if (id3) | ||
910 | { | ||
911 | int elapsed = id3->elapsed + + state->ff_rewind_count; | ||
912 | if (id3->length - elapsed < token->value.i * HZ) | ||
913 | return "ending"; | ||
914 | } | ||
915 | return NULL; | ||
899 | case WPS_TOKEN_LASTTOUCH: | 916 | case WPS_TOKEN_LASTTOUCH: |
900 | #ifdef HAVE_TOUCHSCREEN | 917 | #ifdef HAVE_TOUCHSCREEN |
901 | if (TIME_BEFORE(current_tick, token->value.i * TIMEOUT_UNIT + | 918 | 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 { | |||
178 | WPS_TOKEN_TRACK_TIME_ELAPSED, | 178 | WPS_TOKEN_TRACK_TIME_ELAPSED, |
179 | WPS_TOKEN_TRACK_TIME_REMAINING, | 179 | WPS_TOKEN_TRACK_TIME_REMAINING, |
180 | WPS_TOKEN_TRACK_LENGTH, | 180 | WPS_TOKEN_TRACK_LENGTH, |
181 | WPS_TOKEN_TRACK_STARTING, | ||
182 | WPS_TOKEN_TRACK_ENDING, | ||
181 | 183 | ||
182 | /* Playlist */ | 184 | /* Playlist */ |
183 | TOKEN_MARKER_PLAYLIST, | 185 | TOKEN_MARKER_PLAYLIST, |