diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2022-10-02 21:05:32 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2022-10-18 12:56:28 +0100 |
commit | 14fbefdf390d397a13b31e2b58b4615d794ff709 (patch) | |
tree | 6718352d2d32505f6782c26348edec739aeaa0f9 /apps/gui/skin_engine/skin_tokens.c | |
parent | 13da1ba785b1f06bacae06da422ac2cf2ea5eb76 (diff) | |
download | rockbox-14fbefdf390d397a13b31e2b58b4615d794ff709.tar.gz rockbox-14fbefdf390d397a13b31e2b58b4615d794ff709.zip |
Move skin global state to the WPS
This state is actually specific to the WPS and it makes more
sense to put it there.
Change-Id: I5dfee237fdcbae944806501ff3127a930820d68a
Diffstat (limited to 'apps/gui/skin_engine/skin_tokens.c')
-rw-r--r-- | apps/gui/skin_engine/skin_tokens.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c index 0101a5e01e..a1d0a4b840 100644 --- a/apps/gui/skin_engine/skin_tokens.c +++ b/apps/gui/skin_engine/skin_tokens.c | |||
@@ -66,11 +66,10 @@ | |||
66 | #include "fixedpoint.h" | 66 | #include "fixedpoint.h" |
67 | #endif | 67 | #endif |
68 | #include "list.h" | 68 | #include "list.h" |
69 | #include "wps.h" | ||
69 | 70 | ||
70 | #define NOINLINE __attribute__ ((noinline)) | 71 | #define NOINLINE __attribute__ ((noinline)) |
71 | 72 | ||
72 | extern struct wps_state wps_state; | ||
73 | |||
74 | static const char* get_codectype(const struct mp3entry* id3) | 73 | static const char* get_codectype(const struct mp3entry* id3) |
75 | { | 74 | { |
76 | if (id3 && id3->codectype < AFMT_NUM_CODECS) { | 75 | if (id3 && id3->codectype < AFMT_NUM_CODECS) { |
@@ -228,7 +227,7 @@ static const char* get_filename_token(struct wps_token *token, char* filename, | |||
228 | const char *get_id3_token(struct wps_token *token, struct mp3entry *id3, | 227 | const char *get_id3_token(struct wps_token *token, struct mp3entry *id3, |
229 | char *filename, char *buf, int buf_size, int limit, int *intval) | 228 | char *filename, char *buf, int buf_size, int limit, int *intval) |
230 | { | 229 | { |
231 | struct wps_state *state = &wps_state; | 230 | struct wps_state *state = get_wps_state(); |
232 | if (id3) | 231 | if (id3) |
233 | { | 232 | { |
234 | unsigned long length = id3->length; | 233 | unsigned long length = id3->length; |
@@ -540,7 +539,7 @@ const char *get_radio_token(struct wps_token *token, int preset_offset, | |||
540 | static struct mp3entry* get_mp3entry_from_offset(int offset, char **filename) | 539 | static struct mp3entry* get_mp3entry_from_offset(int offset, char **filename) |
541 | { | 540 | { |
542 | struct mp3entry* pid3 = NULL; | 541 | struct mp3entry* pid3 = NULL; |
543 | struct wps_state *state = skin_get_global_state(); | 542 | struct wps_state *state = get_wps_state(); |
544 | struct cuesheet *cue = state->id3 ? state->id3->cuesheet : NULL; | 543 | struct cuesheet *cue = state->id3 ? state->id3->cuesheet : NULL; |
545 | const char *fname = NULL; | 544 | const char *fname = NULL; |
546 | if (cue && cue->curr_track_idx + offset < cue->track_count) | 545 | if (cue && cue->curr_track_idx + offset < cue->track_count) |
@@ -678,7 +677,7 @@ const char *get_token_value(struct gui_wps *gwps, | |||
678 | return NULL; | 677 | return NULL; |
679 | 678 | ||
680 | struct wps_data *data = gwps->data; | 679 | struct wps_data *data = gwps->data; |
681 | struct wps_state *state = skin_get_global_state(); | 680 | struct wps_state *state = get_wps_state(); |
682 | struct mp3entry *id3; /* Think very carefully about using this. | 681 | struct mp3entry *id3; /* Think very carefully about using this. |
683 | maybe get_id3_token() is the better place? */ | 682 | maybe get_id3_token() is the better place? */ |
684 | const char *out_text = NULL; | 683 | const char *out_text = NULL; |