From 14fbefdf390d397a13b31e2b58b4615d794ff709 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Sun, 2 Oct 2022 21:05:32 +0100 Subject: 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 --- apps/gui/skin_engine/skin_tokens.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'apps/gui/skin_engine/skin_tokens.c') 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 @@ #include "fixedpoint.h" #endif #include "list.h" +#include "wps.h" #define NOINLINE __attribute__ ((noinline)) -extern struct wps_state wps_state; - static const char* get_codectype(const struct mp3entry* id3) { if (id3 && id3->codectype < AFMT_NUM_CODECS) { @@ -228,7 +227,7 @@ static const char* get_filename_token(struct wps_token *token, char* filename, const char *get_id3_token(struct wps_token *token, struct mp3entry *id3, char *filename, char *buf, int buf_size, int limit, int *intval) { - struct wps_state *state = &wps_state; + struct wps_state *state = get_wps_state(); if (id3) { unsigned long length = id3->length; @@ -540,7 +539,7 @@ const char *get_radio_token(struct wps_token *token, int preset_offset, static struct mp3entry* get_mp3entry_from_offset(int offset, char **filename) { struct mp3entry* pid3 = NULL; - struct wps_state *state = skin_get_global_state(); + struct wps_state *state = get_wps_state(); struct cuesheet *cue = state->id3 ? state->id3->cuesheet : NULL; const char *fname = NULL; if (cue && cue->curr_track_idx + offset < cue->track_count) @@ -678,7 +677,7 @@ const char *get_token_value(struct gui_wps *gwps, return NULL; struct wps_data *data = gwps->data; - struct wps_state *state = skin_get_global_state(); + struct wps_state *state = get_wps_state(); struct mp3entry *id3; /* Think very carefully about using this. maybe get_id3_token() is the better place? */ const char *out_text = NULL; -- cgit v1.2.3