diff options
author | Teruaki Kawashima <teru@rockbox.org> | 2010-05-20 13:41:22 +0000 |
---|---|---|
committer | Teruaki Kawashima <teru@rockbox.org> | 2010-05-20 13:41:22 +0000 |
commit | 7042d9516b6bb94706d96298297aba3000a5616f (patch) | |
tree | e43b74a6f585aa1558c250a0a32937621b3e5e4b | |
parent | 0e263d5b779f19033730fff7ec6f16b0715a976d (diff) | |
download | rockbox-7042d9516b6bb94706d96298297aba3000a5616f.tar.gz rockbox-7042d9516b6bb94706d96298297aba3000a5616f.zip |
skin_tokne.c: move WPS_TOKEN_TRACK_STARTING and WPS_TOKEN_TRACK_ENDING to get_id3_token().
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26193 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/gui/skin_engine/skin_tokens.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c index a85fa171ef..594614aab1 100644 --- a/apps/gui/skin_engine/skin_tokens.c +++ b/apps/gui/skin_engine/skin_tokens.c | |||
@@ -254,6 +254,20 @@ const char *get_id3_token(struct wps_token *token, struct mp3entry *id3, | |||
254 | snprintf(buf, buf_size, "%lu", 100 * elapsed / length); | 254 | snprintf(buf, buf_size, "%lu", 100 * elapsed / length); |
255 | return buf; | 255 | return buf; |
256 | 256 | ||
257 | case WPS_TOKEN_TRACK_STARTING: | ||
258 | { | ||
259 | unsigned long time = token->value.i * 1000; | ||
260 | if (elapsed < time) | ||
261 | return "starting"; | ||
262 | } | ||
263 | return NULL; | ||
264 | case WPS_TOKEN_TRACK_ENDING: | ||
265 | { | ||
266 | unsigned long time = token->value.i * 1000; | ||
267 | if (length - elapsed < time) | ||
268 | return "ending"; | ||
269 | } | ||
270 | return NULL; | ||
257 | 271 | ||
258 | case WPS_TOKEN_FILE_CODEC: | 272 | case WPS_TOKEN_FILE_CODEC: |
259 | if (intval) | 273 | if (intval) |
@@ -1018,23 +1032,6 @@ const char *get_token_value(struct gui_wps *gwps, | |||
1018 | return "v"; | 1032 | return "v"; |
1019 | return NULL; | 1033 | return NULL; |
1020 | 1034 | ||
1021 | case WPS_TOKEN_TRACK_STARTING: | ||
1022 | if (id3) | ||
1023 | { | ||
1024 | int elapsed = id3->elapsed + state->ff_rewind_count; | ||
1025 | if (elapsed < token->value.i * 1000) | ||
1026 | return "starting"; | ||
1027 | } | ||
1028 | return NULL; | ||
1029 | case WPS_TOKEN_TRACK_ENDING: | ||
1030 | if (id3) | ||
1031 | { | ||
1032 | unsigned long elapsed = id3->elapsed + state->ff_rewind_count; | ||
1033 | unsigned time = token->value.i * 1000; | ||
1034 | if (id3->length - elapsed < time) | ||
1035 | return "ending"; | ||
1036 | } | ||
1037 | return NULL; | ||
1038 | case WPS_TOKEN_LASTTOUCH: | 1035 | case WPS_TOKEN_LASTTOUCH: |
1039 | #ifdef HAVE_TOUCHSCREEN | 1036 | #ifdef HAVE_TOUCHSCREEN |
1040 | if (TIME_BEFORE(current_tick, token->value.i * TIMEOUT_UNIT + | 1037 | if (TIME_BEFORE(current_tick, token->value.i * TIMEOUT_UNIT + |