diff options
Diffstat (limited to 'apps/gui/skin_engine/skin_tokens.c')
-rw-r--r-- | apps/gui/skin_engine/skin_tokens.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c index 3de6630a51..0e98c2d42f 100644 --- a/apps/gui/skin_engine/skin_tokens.c +++ b/apps/gui/skin_engine/skin_tokens.c | |||
@@ -515,18 +515,18 @@ const char *get_radio_token(struct wps_token *token, int preset_offset, | |||
515 | } | 515 | } |
516 | #endif | 516 | #endif |
517 | 517 | ||
518 | static struct mp3entry* get_mp3entry_from_offset(struct gui_wps *gwps, | 518 | static struct mp3entry* get_mp3entry_from_offset(int offset, char **filename) |
519 | int offset, char **filename) | ||
520 | { | 519 | { |
521 | struct mp3entry* pid3 = NULL; | 520 | struct mp3entry* pid3 = NULL; |
522 | struct cuesheet *cue = gwps->state->id3 ? gwps->state->id3->cuesheet:NULL; | 521 | struct wps_state *state = skin_get_global_state(); |
522 | struct cuesheet *cue = state->id3 ? state->id3->cuesheet : NULL; | ||
523 | const char *fname = NULL; | 523 | const char *fname = NULL; |
524 | if (cue && cue->curr_track_idx + offset < cue->track_count) | 524 | if (cue && cue->curr_track_idx + offset < cue->track_count) |
525 | pid3 = gwps->state->id3; | 525 | pid3 = state->id3; |
526 | else if (offset == 0) | 526 | else if (offset == 0) |
527 | pid3 = gwps->state->id3; | 527 | pid3 = state->id3; |
528 | else if (offset == 1) | 528 | else if (offset == 1) |
529 | pid3 = gwps->state->nid3; | 529 | pid3 = state->nid3; |
530 | else | 530 | else |
531 | { | 531 | { |
532 | static char filename_buf[MAX_PATH + 1]; | 532 | static char filename_buf[MAX_PATH + 1]; |
@@ -568,7 +568,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
568 | return NULL; | 568 | return NULL; |
569 | 569 | ||
570 | struct wps_data *data = gwps->data; | 570 | struct wps_data *data = gwps->data; |
571 | struct wps_state *state = gwps->state; | 571 | struct wps_state *state = skin_get_global_state(); |
572 | struct mp3entry *id3; /* Think very carefully about using this. | 572 | struct mp3entry *id3; /* Think very carefully about using this. |
573 | maybe get_id3_token() is the better place? */ | 573 | maybe get_id3_token() is the better place? */ |
574 | const char *out_text = NULL; | 574 | const char *out_text = NULL; |
@@ -577,7 +577,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
577 | if (!data || !state) | 577 | if (!data || !state) |
578 | return NULL; | 578 | return NULL; |
579 | 579 | ||
580 | id3 = get_mp3entry_from_offset(gwps, token->next? 1: offset, &filename); | 580 | id3 = get_mp3entry_from_offset(token->next? 1: offset, &filename); |
581 | if (id3) | 581 | if (id3) |
582 | filename = id3->path; | 582 | filename = id3->path; |
583 | 583 | ||