diff options
Diffstat (limited to 'apps/gui/skin_engine/skin_tokens.c')
-rw-r--r-- | apps/gui/skin_engine/skin_tokens.c | 279 |
1 files changed, 137 insertions, 142 deletions
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c index b0a55ca13c..c5e1ebc831 100644 --- a/apps/gui/skin_engine/skin_tokens.c +++ b/apps/gui/skin_engine/skin_tokens.c | |||
@@ -167,19 +167,19 @@ const char *get_id3_token(struct wps_token *token, struct mp3entry *id3, | |||
167 | unsigned long elapsed = id3->elapsed + state->ff_rewind_count; | 167 | unsigned long elapsed = id3->elapsed + state->ff_rewind_count; |
168 | switch (token->type) | 168 | switch (token->type) |
169 | { | 169 | { |
170 | case WPS_TOKEN_METADATA_ARTIST: | 170 | case SKIN_TOKEN_METADATA_ARTIST: |
171 | return id3->artist; | 171 | return id3->artist; |
172 | case WPS_TOKEN_METADATA_COMPOSER: | 172 | case SKIN_TOKEN_METADATA_COMPOSER: |
173 | return id3->composer; | 173 | return id3->composer; |
174 | case WPS_TOKEN_METADATA_ALBUM: | 174 | case SKIN_TOKEN_METADATA_ALBUM: |
175 | return id3->album; | 175 | return id3->album; |
176 | case WPS_TOKEN_METADATA_ALBUM_ARTIST: | 176 | case SKIN_TOKEN_METADATA_ALBUM_ARTIST: |
177 | return id3->albumartist; | 177 | return id3->albumartist; |
178 | case WPS_TOKEN_METADATA_GROUPING: | 178 | case SKIN_TOKEN_METADATA_GROUPING: |
179 | return id3->grouping; | 179 | return id3->grouping; |
180 | case WPS_TOKEN_METADATA_GENRE: | 180 | case SKIN_TOKEN_METADATA_GENRE: |
181 | return id3->genre_string; | 181 | return id3->genre_string; |
182 | case WPS_TOKEN_METADATA_DISC_NUMBER: | 182 | case SKIN_TOKEN_METADATA_DISC_NUMBER: |
183 | if (id3->disc_string) | 183 | if (id3->disc_string) |
184 | return id3->disc_string; | 184 | return id3->disc_string; |
185 | if (id3->discnum) { | 185 | if (id3->discnum) { |
@@ -187,7 +187,7 @@ const char *get_id3_token(struct wps_token *token, struct mp3entry *id3, | |||
187 | return buf; | 187 | return buf; |
188 | } | 188 | } |
189 | return NULL; | 189 | return NULL; |
190 | case WPS_TOKEN_METADATA_TRACK_NUMBER: | 190 | case SKIN_TOKEN_METADATA_TRACK_NUMBER: |
191 | if (id3->track_string) | 191 | if (id3->track_string) |
192 | return id3->track_string; | 192 | return id3->track_string; |
193 | if (id3->tracknum) { | 193 | if (id3->tracknum) { |
@@ -195,9 +195,9 @@ const char *get_id3_token(struct wps_token *token, struct mp3entry *id3, | |||
195 | return buf; | 195 | return buf; |
196 | } | 196 | } |
197 | return NULL; | 197 | return NULL; |
198 | case WPS_TOKEN_METADATA_TRACK_TITLE: | 198 | case SKIN_TOKEN_METADATA_TRACK_TITLE: |
199 | return id3->title; | 199 | return id3->title; |
200 | case WPS_TOKEN_METADATA_VERSION: | 200 | case SKIN_TOKEN_METADATA_VERSION: |
201 | switch (id3->id3version) | 201 | switch (id3->id3version) |
202 | { | 202 | { |
203 | case ID3_VER_1_0: | 203 | case ID3_VER_1_0: |
@@ -214,7 +214,7 @@ const char *get_id3_token(struct wps_token *token, struct mp3entry *id3, | |||
214 | break; | 214 | break; |
215 | } | 215 | } |
216 | return NULL; | 216 | return NULL; |
217 | case WPS_TOKEN_METADATA_YEAR: | 217 | case SKIN_TOKEN_METADATA_YEAR: |
218 | if( id3->year_string ) | 218 | if( id3->year_string ) |
219 | return id3->year_string; | 219 | return id3->year_string; |
220 | if (id3->year) { | 220 | if (id3->year) { |
@@ -222,29 +222,29 @@ const char *get_id3_token(struct wps_token *token, struct mp3entry *id3, | |||
222 | return buf; | 222 | return buf; |
223 | } | 223 | } |
224 | return NULL; | 224 | return NULL; |
225 | case WPS_TOKEN_METADATA_COMMENT: | 225 | case SKIN_TOKEN_METADATA_COMMENT: |
226 | return id3->comment; | 226 | return id3->comment; |
227 | case WPS_TOKEN_FILE_PATH: | 227 | case SKIN_TOKEN_FILE_PATH: |
228 | return id3->path; | 228 | return id3->path; |
229 | case WPS_TOKEN_FILE_BITRATE: | 229 | case SKIN_TOKEN_FILE_BITRATE: |
230 | if(id3->bitrate) | 230 | if(id3->bitrate) |
231 | snprintf(buf, buf_size, "%d", id3->bitrate); | 231 | snprintf(buf, buf_size, "%d", id3->bitrate); |
232 | else | 232 | else |
233 | return "?"; | 233 | return "?"; |
234 | return buf; | 234 | return buf; |
235 | case WPS_TOKEN_TRACK_TIME_ELAPSED: | 235 | case SKIN_TOKEN_TRACK_TIME_ELAPSED: |
236 | format_time(buf, buf_size, elapsed); | 236 | format_time(buf, buf_size, elapsed); |
237 | return buf; | 237 | return buf; |
238 | 238 | ||
239 | case WPS_TOKEN_TRACK_TIME_REMAINING: | 239 | case SKIN_TOKEN_TRACK_TIME_REMAINING: |
240 | format_time(buf, buf_size, length - elapsed); | 240 | format_time(buf, buf_size, length - elapsed); |
241 | return buf; | 241 | return buf; |
242 | 242 | ||
243 | case WPS_TOKEN_TRACK_LENGTH: | 243 | case SKIN_TOKEN_TRACK_LENGTH: |
244 | format_time(buf, buf_size, length); | 244 | format_time(buf, buf_size, length); |
245 | return buf; | 245 | return buf; |
246 | 246 | ||
247 | case WPS_TOKEN_TRACK_ELAPSED_PERCENT: | 247 | case SKIN_TOKEN_TRACK_ELAPSED_PERCENT: |
248 | if (length <= 0) | 248 | if (length <= 0) |
249 | return NULL; | 249 | return NULL; |
250 | 250 | ||
@@ -255,14 +255,14 @@ const char *get_id3_token(struct wps_token *token, struct mp3entry *id3, | |||
255 | snprintf(buf, buf_size, "%lu", 100 * elapsed / length); | 255 | snprintf(buf, buf_size, "%lu", 100 * elapsed / length); |
256 | return buf; | 256 | return buf; |
257 | 257 | ||
258 | case WPS_TOKEN_TRACK_STARTING: | 258 | case SKIN_TOKEN_TRACK_STARTING: |
259 | { | 259 | { |
260 | unsigned long time = token->value.i * 1000; | 260 | unsigned long time = token->value.i * 1000; |
261 | if (elapsed < time) | 261 | if (elapsed < time) |
262 | return "starting"; | 262 | return "starting"; |
263 | } | 263 | } |
264 | return NULL; | 264 | return NULL; |
265 | case WPS_TOKEN_TRACK_ENDING: | 265 | case SKIN_TOKEN_TRACK_ENDING: |
266 | { | 266 | { |
267 | unsigned long time = token->value.i * 1000; | 267 | unsigned long time = token->value.i * 1000; |
268 | if (length - elapsed < time) | 268 | if (length - elapsed < time) |
@@ -270,7 +270,7 @@ const char *get_id3_token(struct wps_token *token, struct mp3entry *id3, | |||
270 | } | 270 | } |
271 | return NULL; | 271 | return NULL; |
272 | 272 | ||
273 | case WPS_TOKEN_FILE_CODEC: | 273 | case SKIN_TOKEN_FILE_CODEC: |
274 | if (intval) | 274 | if (intval) |
275 | { | 275 | { |
276 | if(id3->codectype == AFMT_UNKNOWN) | 276 | if(id3->codectype == AFMT_UNKNOWN) |
@@ -280,10 +280,10 @@ const char *get_id3_token(struct wps_token *token, struct mp3entry *id3, | |||
280 | } | 280 | } |
281 | return get_codectype(id3); | 281 | return get_codectype(id3); |
282 | 282 | ||
283 | case WPS_TOKEN_FILE_FREQUENCY: | 283 | case SKIN_TOKEN_FILE_FREQUENCY: |
284 | snprintf(buf, buf_size, "%ld", id3->frequency); | 284 | snprintf(buf, buf_size, "%ld", id3->frequency); |
285 | return buf; | 285 | return buf; |
286 | case WPS_TOKEN_FILE_FREQUENCY_KHZ: | 286 | case SKIN_TOKEN_FILE_FREQUENCY_KHZ: |
287 | /* ignore remainders < 100, so 22050 Hz becomes just 22k */ | 287 | /* ignore remainders < 100, so 22050 Hz becomes just 22k */ |
288 | if ((id3->frequency % 1000) < 100) | 288 | if ((id3->frequency % 1000) < 100) |
289 | snprintf(buf, buf_size, "%ld", id3->frequency / 1000); | 289 | snprintf(buf, buf_size, "%ld", id3->frequency / 1000); |
@@ -292,7 +292,7 @@ const char *get_id3_token(struct wps_token *token, struct mp3entry *id3, | |||
292 | id3->frequency / 1000, | 292 | id3->frequency / 1000, |
293 | (id3->frequency % 1000) / 100); | 293 | (id3->frequency % 1000) / 100); |
294 | return buf; | 294 | return buf; |
295 | case WPS_TOKEN_FILE_NAME: | 295 | case SKIN_TOKEN_FILE_NAME: |
296 | if (get_dir(buf, buf_size, id3->path, 0)) { | 296 | if (get_dir(buf, buf_size, id3->path, 0)) { |
297 | /* Remove extension */ | 297 | /* Remove extension */ |
298 | char* sep = strrchr(buf, '.'); | 298 | char* sep = strrchr(buf, '.'); |
@@ -302,28 +302,28 @@ const char *get_id3_token(struct wps_token *token, struct mp3entry *id3, | |||
302 | return buf; | 302 | return buf; |
303 | } | 303 | } |
304 | return NULL; | 304 | return NULL; |
305 | case WPS_TOKEN_FILE_NAME_WITH_EXTENSION: | 305 | case SKIN_TOKEN_FILE_NAME_WITH_EXTENSION: |
306 | return get_dir(buf, buf_size, id3->path, 0); | 306 | return get_dir(buf, buf_size, id3->path, 0); |
307 | case WPS_TOKEN_FILE_SIZE: | 307 | case SKIN_TOKEN_FILE_SIZE: |
308 | snprintf(buf, buf_size, "%ld", id3->filesize / 1024); | 308 | snprintf(buf, buf_size, "%ld", id3->filesize / 1024); |
309 | return buf; | 309 | return buf; |
310 | case WPS_TOKEN_FILE_VBR: | 310 | case SKIN_TOKEN_FILE_VBR: |
311 | return (id3->vbr) ? "(avg)" : NULL; | 311 | return (id3->vbr) ? "(avg)" : NULL; |
312 | case WPS_TOKEN_FILE_DIRECTORY: | 312 | case SKIN_TOKEN_FILE_DIRECTORY: |
313 | return get_dir(buf, buf_size, id3->path, token->value.i); | 313 | return get_dir(buf, buf_size, id3->path, token->value.i); |
314 | 314 | ||
315 | #ifdef HAVE_TAGCACHE | 315 | #ifdef HAVE_TAGCACHE |
316 | case WPS_TOKEN_DATABASE_PLAYCOUNT: | 316 | case SKIN_TOKEN_DATABASE_PLAYCOUNT: |
317 | if (intval) | 317 | if (intval) |
318 | *intval = id3->playcount + 1; | 318 | *intval = id3->playcount + 1; |
319 | snprintf(buf, buf_size, "%ld", id3->playcount); | 319 | snprintf(buf, buf_size, "%ld", id3->playcount); |
320 | return buf; | 320 | return buf; |
321 | case WPS_TOKEN_DATABASE_RATING: | 321 | case SKIN_TOKEN_DATABASE_RATING: |
322 | if (intval) | 322 | if (intval) |
323 | *intval = id3->rating + 1; | 323 | *intval = id3->rating + 1; |
324 | snprintf(buf, buf_size, "%d", id3->rating); | 324 | snprintf(buf, buf_size, "%d", id3->rating); |
325 | return buf; | 325 | return buf; |
326 | case WPS_TOKEN_DATABASE_AUTOSCORE: | 326 | case SKIN_TOKEN_DATABASE_AUTOSCORE: |
327 | if (intval) | 327 | if (intval) |
328 | *intval = id3->score + 1; | 328 | *intval = id3->score + 1; |
329 | snprintf(buf, buf_size, "%d", id3->score); | 329 | snprintf(buf, buf_size, "%d", id3->score); |
@@ -340,13 +340,13 @@ const char *get_id3_token(struct wps_token *token, struct mp3entry *id3, | |||
340 | { | 340 | { |
341 | /* Most tokens expect NULL on error so leave that for the default case, | 341 | /* Most tokens expect NULL on error so leave that for the default case, |
342 | * The ones that expect "0" need to be handled */ | 342 | * The ones that expect "0" need to be handled */ |
343 | case WPS_TOKEN_FILE_FREQUENCY: | 343 | case SKIN_TOKEN_FILE_FREQUENCY: |
344 | case WPS_TOKEN_FILE_FREQUENCY_KHZ: | 344 | case SKIN_TOKEN_FILE_FREQUENCY_KHZ: |
345 | case WPS_TOKEN_FILE_SIZE: | 345 | case SKIN_TOKEN_FILE_SIZE: |
346 | #ifdef HAVE_TAGCACHE | 346 | #ifdef HAVE_TAGCACHE |
347 | case WPS_TOKEN_DATABASE_PLAYCOUNT: | 347 | case SKIN_TOKEN_DATABASE_PLAYCOUNT: |
348 | case WPS_TOKEN_DATABASE_RATING: | 348 | case SKIN_TOKEN_DATABASE_RATING: |
349 | case WPS_TOKEN_DATABASE_AUTOSCORE: | 349 | case SKIN_TOKEN_DATABASE_AUTOSCORE: |
350 | #endif | 350 | #endif |
351 | if (intval) | 351 | if (intval) |
352 | *intval = 0; | 352 | *intval = 0; |
@@ -397,30 +397,30 @@ const char *get_radio_token(struct wps_token *token, int preset_offset, | |||
397 | switch (token->type) | 397 | switch (token->type) |
398 | { | 398 | { |
399 | /* Radio/tuner tokens */ | 399 | /* Radio/tuner tokens */ |
400 | case WPS_TOKEN_TUNER_TUNED: | 400 | case SKIN_TOKEN_TUNER_TUNED: |
401 | if (tuner_get(RADIO_TUNED)) | 401 | if (tuner_get(RADIO_TUNED)) |
402 | return "t"; | 402 | return "t"; |
403 | return NULL; | 403 | return NULL; |
404 | case WPS_TOKEN_TUNER_SCANMODE: | 404 | case SKIN_TOKEN_TUNER_SCANMODE: |
405 | if (radio_scan_mode()) | 405 | if (radio_scan_mode()) |
406 | return "s"; | 406 | return "s"; |
407 | return NULL; | 407 | return NULL; |
408 | case WPS_TOKEN_TUNER_STEREO: | 408 | case SKIN_TOKEN_TUNER_STEREO: |
409 | if (radio_is_stereo()) | 409 | if (radio_is_stereo()) |
410 | return "s"; | 410 | return "s"; |
411 | return NULL; | 411 | return NULL; |
412 | case WPS_TOKEN_TUNER_MINFREQ: /* changes based on "region" */ | 412 | case SKIN_TOKEN_TUNER_MINFREQ: /* changes based on "region" */ |
413 | return format_freq_MHz(region_data->freq_min, | 413 | return format_freq_MHz(region_data->freq_min, |
414 | region_data->freq_step, buf, buf_size); | 414 | region_data->freq_step, buf, buf_size); |
415 | case WPS_TOKEN_TUNER_MAXFREQ: /* changes based on "region" */ | 415 | case SKIN_TOKEN_TUNER_MAXFREQ: /* changes based on "region" */ |
416 | return format_freq_MHz(region_data->freq_max, | 416 | return format_freq_MHz(region_data->freq_max, |
417 | region_data->freq_step, buf, buf_size); | 417 | region_data->freq_step, buf, buf_size); |
418 | case WPS_TOKEN_TUNER_CURFREQ: | 418 | case SKIN_TOKEN_TUNER_CURFREQ: |
419 | return format_freq_MHz(radio_current_frequency(), | 419 | return format_freq_MHz(radio_current_frequency(), |
420 | region_data->freq_step, buf, buf_size); | 420 | region_data->freq_step, buf, buf_size); |
421 | case WPS_TOKEN_PRESET_NAME: | 421 | case SKIN_TOKEN_PRESET_NAME: |
422 | case WPS_TOKEN_PRESET_FREQ: | 422 | case SKIN_TOKEN_PRESET_FREQ: |
423 | case WPS_TOKEN_PRESET_ID: | 423 | case SKIN_TOKEN_PRESET_ID: |
424 | { | 424 | { |
425 | int preset_count = radio_preset_count(); | 425 | int preset_count = radio_preset_count(); |
426 | int cur_preset = radio_current_preset(); | 426 | int cur_preset = radio_current_preset(); |
@@ -431,30 +431,32 @@ const char *get_radio_token(struct wps_token *token, int preset_offset, | |||
431 | preset %= preset_count; | 431 | preset %= preset_count; |
432 | if (preset < 0) | 432 | if (preset < 0) |
433 | preset += preset_count; | 433 | preset += preset_count; |
434 | if (token->type == WPS_TOKEN_PRESET_NAME) | 434 | if (token->type == SKIN_TOKEN_PRESET_NAME) |
435 | snprintf(buf, buf_size, "%s", radio_get_preset(preset)->name); | 435 | snprintf(buf, buf_size, "%s", radio_get_preset(preset)->name); |
436 | else if (token->type == WPS_TOKEN_PRESET_FREQ) | 436 | else if (token->type == SKIN_TOKEN_PRESET_FREQ) |
437 | format_freq_MHz(radio_get_preset(preset)->frequency, | 437 | format_freq_MHz(radio_get_preset(preset)->frequency, |
438 | region_data->freq_step, buf, buf_size); | 438 | region_data->freq_step, buf, buf_size); |
439 | else | 439 | else |
440 | snprintf(buf, buf_size, "%d", preset + 1); | 440 | snprintf(buf, buf_size, "%d", preset + 1); |
441 | return buf; | 441 | return buf; |
442 | } | 442 | } |
443 | case WPS_TOKEN_PRESET_COUNT: | 443 | case SKIN_TOKEN_PRESET_COUNT: |
444 | snprintf(buf, buf_size, "%d", radio_preset_count()); | 444 | snprintf(buf, buf_size, "%d", radio_preset_count()); |
445 | if (intval) | 445 | if (intval) |
446 | *intval = radio_preset_count(); | 446 | *intval = radio_preset_count(); |
447 | return buf; | 447 | return buf; |
448 | case WPS_TOKEN_HAVE_RDS: | 448 | case SKIN_TOKEN_HAVE_RDS: |
449 | #ifdef HAVE_RDS_CAP | 449 | #ifdef HAVE_RDS_CAP |
450 | return "rds"; | 450 | return "rds"; |
451 | case WPS_TOKEN_RDS_NAME: | 451 | case SKIN_TOKEN_RDS_NAME: |
452 | return tuner_get_rds_info(RADIO_RDS_NAME); | 452 | return tuner_get_rds_info(RADIO_RDS_NAME); |
453 | case WPS_TOKEN_RDS_TEXT: | 453 | case SKIN_TOKEN_RDS_TEXT: |
454 | return tuner_get_rds_info(RADIO_RDS_TEXT); | 454 | return tuner_get_rds_info(RADIO_RDS_TEXT); |
455 | #else | 455 | #else |
456 | return NULL; /* end of the WPS_TOKEN_HAVE_RDS case */ | 456 | return NULL; /* end of the SKIN_TOKEN_HAVE_RDS case */ |
457 | #endif /* HAVE_RDS_CAP */ | 457 | #endif /* HAVE_RDS_CAP */ |
458 | default: | ||
459 | return NULL; | ||
458 | } | 460 | } |
459 | return NULL; | 461 | return NULL; |
460 | } | 462 | } |
@@ -497,8 +499,8 @@ const char *get_token_value(struct gui_wps *gwps, | |||
497 | 499 | ||
498 | /* if the token is an RTC one, update the time | 500 | /* if the token is an RTC one, update the time |
499 | and do the necessary checks */ | 501 | and do the necessary checks */ |
500 | if (token->type >= WPS_TOKENS_RTC_BEGIN | 502 | if (token->type >= SKIN_TOKENS_RTC_BEGIN |
501 | && token->type <= WPS_TOKENS_RTC_END) | 503 | && token->type <= SKIN_TOKENS_RTC_END) |
502 | { | 504 | { |
503 | tm = get_time(); | 505 | tm = get_time(); |
504 | 506 | ||
@@ -531,44 +533,44 @@ const char *get_token_value(struct gui_wps *gwps, | |||
531 | 533 | ||
532 | switch (token->type) | 534 | switch (token->type) |
533 | { | 535 | { |
534 | case WPS_TOKEN_CHARACTER: | 536 | case SKIN_TOKEN_CHARACTER: |
535 | if (token->value.c == '\n') | 537 | if (token->value.c == '\n') |
536 | return NULL; | 538 | return NULL; |
537 | return &(token->value.c); | 539 | return &(token->value.c); |
538 | 540 | ||
539 | case WPS_TOKEN_STRING: | 541 | case SKIN_TOKEN_STRING: |
540 | return (char*)token->value.data; | 542 | return (char*)token->value.data; |
541 | 543 | ||
542 | case WPS_TOKEN_TRANSLATEDSTRING: | 544 | case SKIN_TOKEN_TRANSLATEDSTRING: |
543 | return (char*)P2STR(ID2P(token->value.i)); | 545 | return (char*)P2STR(ID2P(token->value.i)); |
544 | 546 | ||
545 | case WPS_TOKEN_PLAYLIST_ENTRIES: | 547 | case SKIN_TOKEN_PLAYLIST_ENTRIES: |
546 | snprintf(buf, buf_size, "%d", playlist_amount()); | 548 | snprintf(buf, buf_size, "%d", playlist_amount()); |
547 | return buf; | 549 | return buf; |
548 | 550 | ||
549 | case WPS_TOKEN_LIST_TITLE_TEXT: | 551 | case SKIN_TOKEN_LIST_TITLE_TEXT: |
550 | return (char*)token->value.data; | 552 | return (char*)token->value.data; |
551 | case WPS_TOKEN_LIST_TITLE_ICON: | 553 | case SKIN_TOKEN_LIST_TITLE_ICON: |
552 | if (intval) | 554 | if (intval) |
553 | *intval = token->value.i; | 555 | *intval = token->value.i; |
554 | snprintf(buf, buf_size, "%d", token->value.i); | 556 | snprintf(buf, buf_size, "%d", token->value.i); |
555 | return buf; | 557 | return buf; |
556 | 558 | ||
557 | case WPS_TOKEN_PLAYLIST_NAME: | 559 | case SKIN_TOKEN_PLAYLIST_NAME: |
558 | return playlist_name(NULL, buf, buf_size); | 560 | return playlist_name(NULL, buf, buf_size); |
559 | 561 | ||
560 | case WPS_TOKEN_PLAYLIST_POSITION: | 562 | case SKIN_TOKEN_PLAYLIST_POSITION: |
561 | snprintf(buf, buf_size, "%d", playlist_get_display_index()); | 563 | snprintf(buf, buf_size, "%d", playlist_get_display_index()); |
562 | return buf; | 564 | return buf; |
563 | 565 | ||
564 | case WPS_TOKEN_PLAYLIST_SHUFFLE: | 566 | case SKIN_TOKEN_PLAYLIST_SHUFFLE: |
565 | if ( global_settings.playlist_shuffle ) | 567 | if ( global_settings.playlist_shuffle ) |
566 | return "s"; | 568 | return "s"; |
567 | else | 569 | else |
568 | return NULL; | 570 | return NULL; |
569 | break; | 571 | break; |
570 | 572 | ||
571 | case WPS_TOKEN_VOLUME: | 573 | case SKIN_TOKEN_VOLUME: |
572 | snprintf(buf, buf_size, "%d", global_settings.volume); | 574 | snprintf(buf, buf_size, "%d", global_settings.volume); |
573 | if (intval) | 575 | if (intval) |
574 | { | 576 | { |
@@ -593,7 +595,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
593 | } | 595 | } |
594 | return buf; | 596 | return buf; |
595 | #ifdef HAVE_ALBUMART | 597 | #ifdef HAVE_ALBUMART |
596 | case WPS_TOKEN_ALBUMART_FOUND: | 598 | case SKIN_TOKEN_ALBUMART_FOUND: |
597 | if (data->albumart) | 599 | if (data->albumart) |
598 | { | 600 | { |
599 | int handle = -1; | 601 | int handle = -1; |
@@ -609,16 +611,9 @@ const char *get_token_value(struct gui_wps *gwps, | |||
609 | return "C"; | 611 | return "C"; |
610 | } | 612 | } |
611 | return NULL; | 613 | return NULL; |
612 | |||
613 | case WPS_TOKEN_ALBUMART_DISPLAY: | ||
614 | if (!data->albumart) | ||
615 | return NULL; | ||
616 | if (!data->albumart->draw) | ||
617 | data->albumart->draw = true; | ||
618 | return NULL; | ||
619 | #endif | 614 | #endif |
620 | 615 | ||
621 | case WPS_TOKEN_BATTERY_PERCENT: | 616 | case SKIN_TOKEN_BATTERY_PERCENT: |
622 | { | 617 | { |
623 | int l = battery_level(); | 618 | int l = battery_level(); |
624 | 619 | ||
@@ -641,14 +636,14 @@ const char *get_token_value(struct gui_wps *gwps, | |||
641 | } | 636 | } |
642 | } | 637 | } |
643 | 638 | ||
644 | case WPS_TOKEN_BATTERY_VOLTS: | 639 | case SKIN_TOKEN_BATTERY_VOLTS: |
645 | { | 640 | { |
646 | unsigned int v = battery_voltage(); | 641 | unsigned int v = battery_voltage(); |
647 | snprintf(buf, buf_size, "%d.%02d", v / 1000, (v % 1000) / 10); | 642 | snprintf(buf, buf_size, "%d.%02d", v / 1000, (v % 1000) / 10); |
648 | return buf; | 643 | return buf; |
649 | } | 644 | } |
650 | 645 | ||
651 | case WPS_TOKEN_BATTERY_TIME: | 646 | case SKIN_TOKEN_BATTERY_TIME: |
652 | { | 647 | { |
653 | int t = battery_time(); | 648 | int t = battery_time(); |
654 | if (t >= 0) | 649 | if (t >= 0) |
@@ -659,7 +654,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
659 | } | 654 | } |
660 | 655 | ||
661 | #if CONFIG_CHARGING | 656 | #if CONFIG_CHARGING |
662 | case WPS_TOKEN_BATTERY_CHARGER_CONNECTED: | 657 | case SKIN_TOKEN_BATTERY_CHARGER_CONNECTED: |
663 | { | 658 | { |
664 | if(charger_input_state==CHARGER) | 659 | if(charger_input_state==CHARGER) |
665 | return "p"; | 660 | return "p"; |
@@ -668,7 +663,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
668 | } | 663 | } |
669 | #endif | 664 | #endif |
670 | #if CONFIG_CHARGING >= CHARGING_MONITOR | 665 | #if CONFIG_CHARGING >= CHARGING_MONITOR |
671 | case WPS_TOKEN_BATTERY_CHARGING: | 666 | case SKIN_TOKEN_BATTERY_CHARGING: |
672 | { | 667 | { |
673 | if (charge_state == CHARGING || charge_state == TOPOFF) { | 668 | if (charge_state == CHARGING || charge_state == TOPOFF) { |
674 | return "c"; | 669 | return "c"; |
@@ -678,12 +673,12 @@ const char *get_token_value(struct gui_wps *gwps, | |||
678 | } | 673 | } |
679 | #endif | 674 | #endif |
680 | #ifdef HAVE_USB_POWER | 675 | #ifdef HAVE_USB_POWER |
681 | case WPS_TOKEN_USB_POWERED: | 676 | case SKIN_TOKEN_USB_POWERED: |
682 | if (usb_powered()) | 677 | if (usb_powered()) |
683 | return "u"; | 678 | return "u"; |
684 | return NULL; | 679 | return NULL; |
685 | #endif | 680 | #endif |
686 | case WPS_TOKEN_BATTERY_SLEEPTIME: | 681 | case SKIN_TOKEN_BATTERY_SLEEPTIME: |
687 | { | 682 | { |
688 | if (get_sleep_timer() == 0) | 683 | if (get_sleep_timer() == 0) |
689 | return NULL; | 684 | return NULL; |
@@ -694,7 +689,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
694 | } | 689 | } |
695 | } | 690 | } |
696 | 691 | ||
697 | case WPS_TOKEN_PLAYBACK_STATUS: | 692 | case SKIN_TOKEN_PLAYBACK_STATUS: |
698 | { | 693 | { |
699 | int status = current_playmode(); | 694 | int status = current_playmode(); |
700 | /* music */ | 695 | /* music */ |
@@ -734,13 +729,13 @@ const char *get_token_value(struct gui_wps *gwps, | |||
734 | return buf; | 729 | return buf; |
735 | } | 730 | } |
736 | 731 | ||
737 | case WPS_TOKEN_REPEAT_MODE: | 732 | case SKIN_TOKEN_REPEAT_MODE: |
738 | if (intval) | 733 | if (intval) |
739 | *intval = global_settings.repeat_mode + 1; | 734 | *intval = global_settings.repeat_mode + 1; |
740 | snprintf(buf, buf_size, "%d", global_settings.repeat_mode); | 735 | snprintf(buf, buf_size, "%d", global_settings.repeat_mode); |
741 | return buf; | 736 | return buf; |
742 | 737 | ||
743 | case WPS_TOKEN_RTC_PRESENT: | 738 | case SKIN_TOKEN_RTC_PRESENT: |
744 | #if CONFIG_RTC | 739 | #if CONFIG_RTC |
745 | return "c"; | 740 | return "c"; |
746 | #else | 741 | #else |
@@ -748,41 +743,41 @@ const char *get_token_value(struct gui_wps *gwps, | |||
748 | #endif | 743 | #endif |
749 | 744 | ||
750 | #if CONFIG_RTC | 745 | #if CONFIG_RTC |
751 | case WPS_TOKEN_RTC_12HOUR_CFG: | 746 | case SKIN_TOKEN_RTC_12HOUR_CFG: |
752 | if (intval) | 747 | if (intval) |
753 | *intval = global_settings.timeformat + 1; | 748 | *intval = global_settings.timeformat + 1; |
754 | snprintf(buf, buf_size, "%d", global_settings.timeformat); | 749 | snprintf(buf, buf_size, "%d", global_settings.timeformat); |
755 | return buf; | 750 | return buf; |
756 | 751 | ||
757 | case WPS_TOKEN_RTC_DAY_OF_MONTH: | 752 | case SKIN_TOKEN_RTC_DAY_OF_MONTH: |
758 | /* d: day of month (01..31) */ | 753 | /* d: day of month (01..31) */ |
759 | snprintf(buf, buf_size, "%02d", tm->tm_mday); | 754 | snprintf(buf, buf_size, "%02d", tm->tm_mday); |
760 | if (intval) | 755 | if (intval) |
761 | *intval = tm->tm_mday - 1; | 756 | *intval = tm->tm_mday - 1; |
762 | return buf; | 757 | return buf; |
763 | 758 | ||
764 | case WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED: | 759 | case SKIN_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED: |
765 | /* e: day of month, blank padded ( 1..31) */ | 760 | /* e: day of month, blank padded ( 1..31) */ |
766 | snprintf(buf, buf_size, "%2d", tm->tm_mday); | 761 | snprintf(buf, buf_size, "%2d", tm->tm_mday); |
767 | if (intval) | 762 | if (intval) |
768 | *intval = tm->tm_mday - 1; | 763 | *intval = tm->tm_mday - 1; |
769 | return buf; | 764 | return buf; |
770 | 765 | ||
771 | case WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED: | 766 | case SKIN_TOKEN_RTC_HOUR_24_ZERO_PADDED: |
772 | /* H: hour (00..23) */ | 767 | /* H: hour (00..23) */ |
773 | snprintf(buf, buf_size, "%02d", tm->tm_hour); | 768 | snprintf(buf, buf_size, "%02d", tm->tm_hour); |
774 | if (intval) | 769 | if (intval) |
775 | *intval = tm->tm_hour; | 770 | *intval = tm->tm_hour; |
776 | return buf; | 771 | return buf; |
777 | 772 | ||
778 | case WPS_TOKEN_RTC_HOUR_24: | 773 | case SKIN_TOKEN_RTC_HOUR_24: |
779 | /* k: hour ( 0..23) */ | 774 | /* k: hour ( 0..23) */ |
780 | snprintf(buf, buf_size, "%2d", tm->tm_hour); | 775 | snprintf(buf, buf_size, "%2d", tm->tm_hour); |
781 | if (intval) | 776 | if (intval) |
782 | *intval = tm->tm_hour; | 777 | *intval = tm->tm_hour; |
783 | return buf; | 778 | return buf; |
784 | 779 | ||
785 | case WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED: | 780 | case SKIN_TOKEN_RTC_HOUR_12_ZERO_PADDED: |
786 | /* I: hour (01..12) */ | 781 | /* I: hour (01..12) */ |
787 | snprintf(buf, buf_size, "%02d", | 782 | snprintf(buf, buf_size, "%02d", |
788 | (tm->tm_hour % 12 == 0) ? 12 : tm->tm_hour % 12); | 783 | (tm->tm_hour % 12 == 0) ? 12 : tm->tm_hour % 12); |
@@ -790,7 +785,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
790 | *intval = (tm->tm_hour % 12 == 0) ? 12 : tm->tm_hour % 12; | 785 | *intval = (tm->tm_hour % 12 == 0) ? 12 : tm->tm_hour % 12; |
791 | return buf; | 786 | return buf; |
792 | 787 | ||
793 | case WPS_TOKEN_RTC_HOUR_12: | 788 | case SKIN_TOKEN_RTC_HOUR_12: |
794 | /* l: hour ( 1..12) */ | 789 | /* l: hour ( 1..12) */ |
795 | snprintf(buf, buf_size, "%2d", | 790 | snprintf(buf, buf_size, "%2d", |
796 | (tm->tm_hour % 12 == 0) ? 12 : tm->tm_hour % 12); | 791 | (tm->tm_hour % 12 == 0) ? 12 : tm->tm_hour % 12); |
@@ -798,107 +793,107 @@ const char *get_token_value(struct gui_wps *gwps, | |||
798 | *intval = (tm->tm_hour % 12 == 0) ? 12 : tm->tm_hour % 12; | 793 | *intval = (tm->tm_hour % 12 == 0) ? 12 : tm->tm_hour % 12; |
799 | return buf; | 794 | return buf; |
800 | 795 | ||
801 | case WPS_TOKEN_RTC_MONTH: | 796 | case SKIN_TOKEN_RTC_MONTH: |
802 | /* m: month (01..12) */ | 797 | /* m: month (01..12) */ |
803 | if (intval) | 798 | if (intval) |
804 | *intval = tm->tm_mon + 1; | 799 | *intval = tm->tm_mon + 1; |
805 | snprintf(buf, buf_size, "%02d", tm->tm_mon + 1); | 800 | snprintf(buf, buf_size, "%02d", tm->tm_mon + 1); |
806 | return buf; | 801 | return buf; |
807 | 802 | ||
808 | case WPS_TOKEN_RTC_MINUTE: | 803 | case SKIN_TOKEN_RTC_MINUTE: |
809 | /* M: minute (00..59) */ | 804 | /* M: minute (00..59) */ |
810 | snprintf(buf, buf_size, "%02d", tm->tm_min); | 805 | snprintf(buf, buf_size, "%02d", tm->tm_min); |
811 | if (intval) | 806 | if (intval) |
812 | *intval = tm->tm_min; | 807 | *intval = tm->tm_min; |
813 | return buf; | 808 | return buf; |
814 | 809 | ||
815 | case WPS_TOKEN_RTC_SECOND: | 810 | case SKIN_TOKEN_RTC_SECOND: |
816 | /* S: second (00..59) */ | 811 | /* S: second (00..59) */ |
817 | snprintf(buf, buf_size, "%02d", tm->tm_sec); | 812 | snprintf(buf, buf_size, "%02d", tm->tm_sec); |
818 | if (intval) | 813 | if (intval) |
819 | *intval = tm->tm_sec; | 814 | *intval = tm->tm_sec; |
820 | return buf; | 815 | return buf; |
821 | 816 | ||
822 | case WPS_TOKEN_RTC_YEAR_2_DIGITS: | 817 | case SKIN_TOKEN_RTC_YEAR_2_DIGITS: |
823 | /* y: last two digits of year (00..99) */ | 818 | /* y: last two digits of year (00..99) */ |
824 | snprintf(buf, buf_size, "%02d", tm->tm_year % 100); | 819 | snprintf(buf, buf_size, "%02d", tm->tm_year % 100); |
825 | if (intval) | 820 | if (intval) |
826 | *intval = tm->tm_year % 100; | 821 | *intval = tm->tm_year % 100; |
827 | return buf; | 822 | return buf; |
828 | 823 | ||
829 | case WPS_TOKEN_RTC_YEAR_4_DIGITS: | 824 | case SKIN_TOKEN_RTC_YEAR_4_DIGITS: |
830 | /* Y: year (1970...) */ | 825 | /* Y: year (1970...) */ |
831 | snprintf(buf, buf_size, "%04d", tm->tm_year + 1900); | 826 | snprintf(buf, buf_size, "%04d", tm->tm_year + 1900); |
832 | if (intval) | 827 | if (intval) |
833 | *intval = tm->tm_year + 1900; | 828 | *intval = tm->tm_year + 1900; |
834 | return buf; | 829 | return buf; |
835 | 830 | ||
836 | case WPS_TOKEN_RTC_AM_PM_UPPER: | 831 | case SKIN_TOKEN_RTC_AM_PM_UPPER: |
837 | /* p: upper case AM or PM indicator */ | 832 | /* p: upper case AM or PM indicator */ |
838 | if (intval) | 833 | if (intval) |
839 | *intval = tm->tm_hour/12 == 0 ? 0 : 1; | 834 | *intval = tm->tm_hour/12 == 0 ? 0 : 1; |
840 | return tm->tm_hour/12 == 0 ? "AM" : "PM"; | 835 | return tm->tm_hour/12 == 0 ? "AM" : "PM"; |
841 | 836 | ||
842 | case WPS_TOKEN_RTC_AM_PM_LOWER: | 837 | case SKIN_TOKEN_RTC_AM_PM_LOWER: |
843 | /* P: lower case am or pm indicator */ | 838 | /* P: lower case am or pm indicator */ |
844 | if (intval) | 839 | if (intval) |
845 | *intval = tm->tm_hour/12 == 0 ? 0 : 1; | 840 | *intval = tm->tm_hour/12 == 0 ? 0 : 1; |
846 | return tm->tm_hour/12 == 0 ? "am" : "pm"; | 841 | return tm->tm_hour/12 == 0 ? "am" : "pm"; |
847 | 842 | ||
848 | case WPS_TOKEN_RTC_WEEKDAY_NAME: | 843 | case SKIN_TOKEN_RTC_WEEKDAY_NAME: |
849 | /* a: abbreviated weekday name (Sun..Sat) */ | 844 | /* a: abbreviated weekday name (Sun..Sat) */ |
850 | return str(LANG_WEEKDAY_SUNDAY + tm->tm_wday); | 845 | return str(LANG_WEEKDAY_SUNDAY + tm->tm_wday); |
851 | 846 | ||
852 | case WPS_TOKEN_RTC_MONTH_NAME: | 847 | case SKIN_TOKEN_RTC_MONTH_NAME: |
853 | /* b: abbreviated month name (Jan..Dec) */ | 848 | /* b: abbreviated month name (Jan..Dec) */ |
854 | return str(LANG_MONTH_JANUARY + tm->tm_mon); | 849 | return str(LANG_MONTH_JANUARY + tm->tm_mon); |
855 | 850 | ||
856 | case WPS_TOKEN_RTC_DAY_OF_WEEK_START_MON: | 851 | case SKIN_TOKEN_RTC_DAY_OF_WEEK_START_MON: |
857 | /* u: day of week (1..7); 1 is Monday */ | 852 | /* u: day of week (1..7); 1 is Monday */ |
858 | if (intval) | 853 | if (intval) |
859 | *intval = (tm->tm_wday == 0) ? 7 : tm->tm_wday; | 854 | *intval = (tm->tm_wday == 0) ? 7 : tm->tm_wday; |
860 | snprintf(buf, buf_size, "%1d", tm->tm_wday + 1); | 855 | snprintf(buf, buf_size, "%1d", tm->tm_wday + 1); |
861 | return buf; | 856 | return buf; |
862 | 857 | ||
863 | case WPS_TOKEN_RTC_DAY_OF_WEEK_START_SUN: | 858 | case SKIN_TOKEN_RTC_DAY_OF_WEEK_START_SUN: |
864 | /* w: day of week (0..6); 0 is Sunday */ | 859 | /* w: day of week (0..6); 0 is Sunday */ |
865 | if (intval) | 860 | if (intval) |
866 | *intval = tm->tm_wday + 1; | 861 | *intval = tm->tm_wday + 1; |
867 | snprintf(buf, buf_size, "%1d", tm->tm_wday); | 862 | snprintf(buf, buf_size, "%1d", tm->tm_wday); |
868 | return buf; | 863 | return buf; |
869 | #else | 864 | #else |
870 | case WPS_TOKEN_RTC_DAY_OF_MONTH: | 865 | case SKIN_TOKEN_RTC_DAY_OF_MONTH: |
871 | case WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED: | 866 | case SKIN_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED: |
872 | case WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED: | 867 | case SKIN_TOKEN_RTC_HOUR_24_ZERO_PADDED: |
873 | case WPS_TOKEN_RTC_HOUR_24: | 868 | case SKIN_TOKEN_RTC_HOUR_24: |
874 | case WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED: | 869 | case SKIN_TOKEN_RTC_HOUR_12_ZERO_PADDED: |
875 | case WPS_TOKEN_RTC_HOUR_12: | 870 | case SKIN_TOKEN_RTC_HOUR_12: |
876 | case WPS_TOKEN_RTC_MONTH: | 871 | case SKIN_TOKEN_RTC_MONTH: |
877 | case WPS_TOKEN_RTC_MINUTE: | 872 | case SKIN_TOKEN_RTC_MINUTE: |
878 | case WPS_TOKEN_RTC_SECOND: | 873 | case SKIN_TOKEN_RTC_SECOND: |
879 | case WPS_TOKEN_RTC_AM_PM_UPPER: | 874 | case SKIN_TOKEN_RTC_AM_PM_UPPER: |
880 | case WPS_TOKEN_RTC_AM_PM_LOWER: | 875 | case SKIN_TOKEN_RTC_AM_PM_LOWER: |
881 | case WPS_TOKEN_RTC_YEAR_2_DIGITS: | 876 | case SKIN_TOKEN_RTC_YEAR_2_DIGITS: |
882 | return "--"; | 877 | return "--"; |
883 | case WPS_TOKEN_RTC_YEAR_4_DIGITS: | 878 | case SKIN_TOKEN_RTC_YEAR_4_DIGITS: |
884 | return "----"; | 879 | return "----"; |
885 | case WPS_TOKEN_RTC_WEEKDAY_NAME: | 880 | case SKIN_TOKEN_RTC_WEEKDAY_NAME: |
886 | case WPS_TOKEN_RTC_MONTH_NAME: | 881 | case SKIN_TOKEN_RTC_MONTH_NAME: |
887 | return "---"; | 882 | return "---"; |
888 | case WPS_TOKEN_RTC_DAY_OF_WEEK_START_MON: | 883 | case SKIN_TOKEN_RTC_DAY_OF_WEEK_START_MON: |
889 | case WPS_TOKEN_RTC_DAY_OF_WEEK_START_SUN: | 884 | case SKIN_TOKEN_RTC_DAY_OF_WEEK_START_SUN: |
890 | return "-"; | 885 | return "-"; |
891 | #endif | 886 | #endif |
892 | 887 | ||
893 | #ifdef HAVE_LCD_CHARCELLS | 888 | #ifdef HAVE_LCD_CHARCELLS |
894 | case WPS_TOKEN_PROGRESSBAR: | 889 | case SKIN_TOKEN_PROGRESSBAR: |
895 | { | 890 | { |
896 | char *end = utf8encode(data->wps_progress_pat[0], buf); | 891 | char *end = utf8encode(data->wps_progress_pat[0], buf); |
897 | *end = '\0'; | 892 | *end = '\0'; |
898 | return buf; | 893 | return buf; |
899 | } | 894 | } |
900 | 895 | ||
901 | case WPS_TOKEN_PLAYER_PROGRESSBAR: | 896 | case SKIN_TOKEN_PLAYER_PROGRESSBAR: |
902 | if(is_new_player()) | 897 | if(is_new_player()) |
903 | { | 898 | { |
904 | /* we need 11 characters (full line) for | 899 | /* we need 11 characters (full line) for |
@@ -916,7 +911,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
916 | 911 | ||
917 | 912 | ||
918 | #if (CONFIG_CODEC == SWCODEC) | 913 | #if (CONFIG_CODEC == SWCODEC) |
919 | case WPS_TOKEN_CROSSFADE: | 914 | case SKIN_TOKEN_CROSSFADE: |
920 | #ifdef HAVE_CROSSFADE | 915 | #ifdef HAVE_CROSSFADE |
921 | if (intval) | 916 | if (intval) |
922 | *intval = global_settings.crossfade + 1; | 917 | *intval = global_settings.crossfade + 1; |
@@ -926,7 +921,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
926 | #endif | 921 | #endif |
927 | return buf; | 922 | return buf; |
928 | 923 | ||
929 | case WPS_TOKEN_REPLAYGAIN: | 924 | case SKIN_TOKEN_REPLAYGAIN: |
930 | { | 925 | { |
931 | int val; | 926 | int val; |
932 | 927 | ||
@@ -974,7 +969,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
974 | #endif /* (CONFIG_CODEC == SWCODEC) */ | 969 | #endif /* (CONFIG_CODEC == SWCODEC) */ |
975 | 970 | ||
976 | #if (CONFIG_CODEC != MAS3507D) | 971 | #if (CONFIG_CODEC != MAS3507D) |
977 | case WPS_TOKEN_SOUND_PITCH: | 972 | case SKIN_TOKEN_SOUND_PITCH: |
978 | { | 973 | { |
979 | int32_t pitch = sound_get_pitch(); | 974 | int32_t pitch = sound_get_pitch(); |
980 | snprintf(buf, buf_size, "%ld.%ld", | 975 | snprintf(buf, buf_size, "%ld.%ld", |
@@ -989,7 +984,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
989 | #endif | 984 | #endif |
990 | 985 | ||
991 | #if CONFIG_CODEC == SWCODEC | 986 | #if CONFIG_CODEC == SWCODEC |
992 | case WPS_TOKEN_SOUND_SPEED: | 987 | case SKIN_TOKEN_SOUND_SPEED: |
993 | { | 988 | { |
994 | int32_t pitch = sound_get_pitch(); | 989 | int32_t pitch = sound_get_pitch(); |
995 | int32_t speed; | 990 | int32_t speed; |
@@ -1007,7 +1002,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
1007 | } | 1002 | } |
1008 | #endif | 1003 | #endif |
1009 | 1004 | ||
1010 | case WPS_TOKEN_MAIN_HOLD: | 1005 | case SKIN_TOKEN_MAIN_HOLD: |
1011 | #ifdef HAS_BUTTON_HOLD | 1006 | #ifdef HAS_BUTTON_HOLD |
1012 | if (button_hold()) | 1007 | if (button_hold()) |
1013 | #else | 1008 | #else |
@@ -1018,7 +1013,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
1018 | return NULL; | 1013 | return NULL; |
1019 | 1014 | ||
1020 | #ifdef HAS_REMOTE_BUTTON_HOLD | 1015 | #ifdef HAS_REMOTE_BUTTON_HOLD |
1021 | case WPS_TOKEN_REMOTE_HOLD: | 1016 | case SKIN_TOKEN_REMOTE_HOLD: |
1022 | if (remote_button_hold()) | 1017 | if (remote_button_hold()) |
1023 | return "r"; | 1018 | return "r"; |
1024 | else | 1019 | else |
@@ -1026,20 +1021,20 @@ const char *get_token_value(struct gui_wps *gwps, | |||
1026 | #endif | 1021 | #endif |
1027 | 1022 | ||
1028 | #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD) | 1023 | #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD) |
1029 | case WPS_TOKEN_VLED_HDD: | 1024 | case SKIN_TOKEN_VLED_HDD: |
1030 | if(led_read(HZ/2)) | 1025 | if(led_read(HZ/2)) |
1031 | return "h"; | 1026 | return "h"; |
1032 | else | 1027 | else |
1033 | return NULL; | 1028 | return NULL; |
1034 | #endif | 1029 | #endif |
1035 | case WPS_TOKEN_BUTTON_VOLUME: | 1030 | case SKIN_TOKEN_BUTTON_VOLUME: |
1036 | if (global_status.last_volume_change && | 1031 | if (global_status.last_volume_change && |
1037 | TIME_BEFORE(current_tick, global_status.last_volume_change + | 1032 | TIME_BEFORE(current_tick, global_status.last_volume_change + |
1038 | token->value.i * TIMEOUT_UNIT)) | 1033 | token->value.i * TIMEOUT_UNIT)) |
1039 | return "v"; | 1034 | return "v"; |
1040 | return NULL; | 1035 | return NULL; |
1041 | 1036 | ||
1042 | case WPS_TOKEN_LASTTOUCH: | 1037 | case SKIN_TOKEN_LASTTOUCH: |
1043 | { | 1038 | { |
1044 | #ifdef HAVE_TOUCHSCREEN | 1039 | #ifdef HAVE_TOUCHSCREEN |
1045 | unsigned int last_touch = touchscreen_last_touch(); | 1040 | unsigned int last_touch = touchscreen_last_touch(); |
@@ -1051,7 +1046,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
1051 | } | 1046 | } |
1052 | return NULL; | 1047 | return NULL; |
1053 | 1048 | ||
1054 | case WPS_TOKEN_SETTING: | 1049 | case SKIN_TOKEN_SETTING: |
1055 | { | 1050 | { |
1056 | const struct settings_list *s = settings+token->value.i; | 1051 | const struct settings_list *s = settings+token->value.i; |
1057 | if (intval) | 1052 | if (intval) |
@@ -1120,14 +1115,14 @@ const char *get_token_value(struct gui_wps *gwps, | |||
1120 | cfg_to_string(token->value.i,buf,buf_size); | 1115 | cfg_to_string(token->value.i,buf,buf_size); |
1121 | return buf; | 1116 | return buf; |
1122 | } | 1117 | } |
1123 | case WPS_TOKEN_HAVE_TUNER: | 1118 | case SKIN_TOKEN_HAVE_TUNER: |
1124 | #if CONFIG_TUNER | 1119 | #if CONFIG_TUNER |
1125 | if (radio_hardware_present()) | 1120 | if (radio_hardware_present()) |
1126 | return "r"; | 1121 | return "r"; |
1127 | #endif | 1122 | #endif |
1128 | return NULL; | 1123 | return NULL; |
1129 | /* Recording tokens */ | 1124 | /* Recording tokens */ |
1130 | case WPS_TOKEN_HAVE_RECORDING: | 1125 | case SKIN_TOKEN_HAVE_RECORDING: |
1131 | #ifdef HAVE_RECORDING | 1126 | #ifdef HAVE_RECORDING |
1132 | return "r"; | 1127 | return "r"; |
1133 | #else | 1128 | #else |
@@ -1135,11 +1130,11 @@ const char *get_token_value(struct gui_wps *gwps, | |||
1135 | #endif | 1130 | #endif |
1136 | 1131 | ||
1137 | #ifdef HAVE_RECORDING | 1132 | #ifdef HAVE_RECORDING |
1138 | case WPS_TOKEN_IS_RECORDING: | 1133 | case SKIN_TOKEN_IS_RECORDING: |
1139 | if (audio_status() == AUDIO_STATUS_RECORD) | 1134 | if (audio_status() == AUDIO_STATUS_RECORD) |
1140 | return "r"; | 1135 | return "r"; |
1141 | return NULL; | 1136 | return NULL; |
1142 | case WPS_TOKEN_REC_FREQ: /* order from REC_FREQ_CFG_VAL_LIST */ | 1137 | case SKIN_TOKEN_REC_FREQ: /* order from REC_FREQ_CFG_VAL_LIST */ |
1143 | { | 1138 | { |
1144 | #if CONFIG_CODEC == SWCODEC | 1139 | #if CONFIG_CODEC == SWCODEC |
1145 | unsigned long samprk; | 1140 | unsigned long samprk; |
@@ -1227,7 +1222,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
1227 | return buf; | 1222 | return buf; |
1228 | } | 1223 | } |
1229 | #if CONFIG_CODEC == SWCODEC | 1224 | #if CONFIG_CODEC == SWCODEC |
1230 | case WPS_TOKEN_REC_ENCODER: | 1225 | case SKIN_TOKEN_REC_ENCODER: |
1231 | { | 1226 | { |
1232 | int rec_format = global_settings.rec_format+1; /* WAV, AIFF, WV, MPEG */ | 1227 | int rec_format = global_settings.rec_format+1; /* WAV, AIFF, WV, MPEG */ |
1233 | if (intval) | 1228 | if (intval) |
@@ -1248,7 +1243,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
1248 | break; | 1243 | break; |
1249 | } | 1244 | } |
1250 | #endif | 1245 | #endif |
1251 | case WPS_TOKEN_REC_BITRATE: | 1246 | case SKIN_TOKEN_REC_BITRATE: |
1252 | #if CONFIG_CODEC == SWCODEC | 1247 | #if CONFIG_CODEC == SWCODEC |
1253 | if (global_settings.rec_format == REC_FORMAT_MPA_L3) | 1248 | if (global_settings.rec_format == REC_FORMAT_MPA_L3) |
1254 | { | 1249 | { |
@@ -1317,12 +1312,12 @@ const char *get_token_value(struct gui_wps *gwps, | |||
1317 | snprintf(buf, buf_size, "%d", global_settings.rec_quality); | 1312 | snprintf(buf, buf_size, "%d", global_settings.rec_quality); |
1318 | return buf; | 1313 | return buf; |
1319 | #endif | 1314 | #endif |
1320 | case WPS_TOKEN_REC_MONO: | 1315 | case SKIN_TOKEN_REC_MONO: |
1321 | if (!global_settings.rec_channels) | 1316 | if (!global_settings.rec_channels) |
1322 | return "m"; | 1317 | return "m"; |
1323 | return NULL; | 1318 | return NULL; |
1324 | 1319 | ||
1325 | case WPS_TOKEN_REC_SECONDS: | 1320 | case SKIN_TOKEN_REC_SECONDS: |
1326 | { | 1321 | { |
1327 | int time = (audio_recorded_time() / HZ) % 60; | 1322 | int time = (audio_recorded_time() / HZ) % 60; |
1328 | if (intval) | 1323 | if (intval) |
@@ -1330,7 +1325,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
1330 | snprintf(buf, buf_size, "%02d", time); | 1325 | snprintf(buf, buf_size, "%02d", time); |
1331 | return buf; | 1326 | return buf; |
1332 | } | 1327 | } |
1333 | case WPS_TOKEN_REC_MINUTES: | 1328 | case SKIN_TOKEN_REC_MINUTES: |
1334 | { | 1329 | { |
1335 | int time = (audio_recorded_time() / HZ) / 60; | 1330 | int time = (audio_recorded_time() / HZ) / 60; |
1336 | if (intval) | 1331 | if (intval) |
@@ -1338,7 +1333,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
1338 | snprintf(buf, buf_size, "%02d", time); | 1333 | snprintf(buf, buf_size, "%02d", time); |
1339 | return buf; | 1334 | return buf; |
1340 | } | 1335 | } |
1341 | case WPS_TOKEN_REC_HOURS: | 1336 | case SKIN_TOKEN_REC_HOURS: |
1342 | { | 1337 | { |
1343 | int time = (audio_recorded_time() / HZ) / 3600; | 1338 | int time = (audio_recorded_time() / HZ) / 3600; |
1344 | if (intval) | 1339 | if (intval) |
@@ -1349,7 +1344,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
1349 | 1344 | ||
1350 | #endif /* HAVE_RECORDING */ | 1345 | #endif /* HAVE_RECORDING */ |
1351 | 1346 | ||
1352 | case WPS_TOKEN_CURRENT_SCREEN: | 1347 | case SKIN_TOKEN_CURRENT_SCREEN: |
1353 | { | 1348 | { |
1354 | int curr_screen = current_screen(); | 1349 | int curr_screen = current_screen(); |
1355 | 1350 | ||
@@ -1390,7 +1385,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
1390 | return buf; | 1385 | return buf; |
1391 | } | 1386 | } |
1392 | 1387 | ||
1393 | case WPS_TOKEN_LANG_IS_RTL: | 1388 | case SKIN_TOKEN_LANG_IS_RTL: |
1394 | return lang_is_rtl() ? "r" : NULL; | 1389 | return lang_is_rtl() ? "r" : NULL; |
1395 | 1390 | ||
1396 | default: | 1391 | default: |