summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine/skin_tokens.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/skin_engine/skin_tokens.c')
-rw-r--r--apps/gui/skin_engine/skin_tokens.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c
index 42c56f7203..082619432f 100644
--- a/apps/gui/skin_engine/skin_tokens.c
+++ b/apps/gui/skin_engine/skin_tokens.c
@@ -66,6 +66,7 @@
66#include "fixedpoint.h" 66#include "fixedpoint.h"
67#endif 67#endif
68#include "list.h" 68#include "list.h"
69#include "option_select.h"
69#include "wps.h" 70#include "wps.h"
70 71
71#define NOINLINE __attribute__ ((noinline)) 72#define NOINLINE __attribute__ ((noinline))
@@ -73,7 +74,7 @@
73static const char* get_codectype(const struct mp3entry* id3) 74static const char* get_codectype(const struct mp3entry* id3)
74{ 75{
75 if (id3 && id3->codectype < AFMT_NUM_CODECS) { 76 if (id3 && id3->codectype < AFMT_NUM_CODECS) {
76 return audio_formats[id3->codectype].label; 77 return get_codec_string(id3->codectype);
77 } else { 78 } else {
78 return NULL; 79 return NULL;
79 } 80 }
@@ -658,6 +659,23 @@ static const char* NOINLINE get_lif_token_value(struct gui_wps *gwps,
658 return NULL; 659 return NULL;
659} 660}
660 661
662#ifdef HAVE_QUICKSCREEN
663static const char* get_qs_token_value(enum quickscreen_item item, bool data_token,
664 char *buf, int buf_size)
665{
666 const struct settings_list *qs_setting = global_settings.qs_items[item];
667
668 if (qs_setting == NULL)
669 return "ERR";
670
671 if (data_token)
672 return option_get_valuestring(qs_setting, buf, buf_size,
673 option_value_as_int(qs_setting));
674
675 return P2STR(ID2P(qs_setting->lang_id));
676}
677#endif
678
661/* Return the tags value as text. buf should be used as temp storage if needed. 679/* Return the tags value as text. buf should be used as temp storage if needed.
662 680
663 intval is used with conditionals/enums: when this function is called, 681 intval is used with conditionals/enums: when this function is called,
@@ -1374,6 +1392,25 @@ const char *get_token_value(struct gui_wps *gwps,
1374 return NULL; 1392 return NULL;
1375#endif 1393#endif
1376 1394
1395#ifdef HAVE_QUICKSCREEN
1396 case SKIN_TOKEN_TOP_QUICKSETTING_NAME:
1397 return get_qs_token_value(QUICKSCREEN_TOP, false, buf, buf_size);
1398 case SKIN_TOKEN_TOP_QUICKSETTING_VALUE:
1399 return get_qs_token_value(QUICKSCREEN_TOP, true, buf, buf_size);
1400 case SKIN_TOKEN_RIGHT_QUICKSETTING_NAME:
1401 return get_qs_token_value(QUICKSCREEN_RIGHT, false, buf, buf_size);
1402 case SKIN_TOKEN_RIGHT_QUICKSETTING_VALUE:
1403 return get_qs_token_value(QUICKSCREEN_RIGHT, true, buf, buf_size);
1404 case SKIN_TOKEN_BOTTOM_QUICKSETTING_NAME:
1405 return get_qs_token_value(QUICKSCREEN_BOTTOM, false, buf, buf_size);
1406 case SKIN_TOKEN_BOTTOM_QUICKSETTING_VALUE:
1407 return get_qs_token_value(QUICKSCREEN_BOTTOM, true, buf, buf_size);
1408 case SKIN_TOKEN_LEFT_QUICKSETTING_NAME:
1409 return get_qs_token_value(QUICKSCREEN_LEFT, false, buf, buf_size);
1410 case SKIN_TOKEN_LEFT_QUICKSETTING_VALUE:
1411 return get_qs_token_value(QUICKSCREEN_LEFT, true, buf, buf_size);
1412#endif
1413
1377 case SKIN_TOKEN_SETTING: 1414 case SKIN_TOKEN_SETTING:
1378 { 1415 {
1379 const struct settings_list *s = token->value.xdata; 1416 const struct settings_list *s = token->value.xdata;