diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2010-02-18 07:04:16 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2010-02-18 07:04:16 +0000 |
commit | 45a181d8fc4af3840ce89a9788f739f20cdb2ad7 (patch) | |
tree | bfd58959f3af775ef2ba9352f4663e4ad1cd846f /apps/gui/skin_engine/skin_tokens.c | |
parent | 55b21c104fd70918133e97444f174b02f6caad4b (diff) |
allow integer sound settings (bass, volume, etc) to be used with conditional %St. "%?St|name|<min|min+1|...|max-1|max>"
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24745 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/skin_engine/skin_tokens.c')
-rw-r--r-- | apps/gui/skin_engine/skin_tokens.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c index 105a6789ee..1189925ea0 100644 --- a/apps/gui/skin_engine/skin_tokens.c +++ b/apps/gui/skin_engine/skin_tokens.c @@ -909,7 +909,20 @@ const char *get_token_value(struct gui_wps *gwps, { case F_T_INT: case F_T_UINT: - if (s->flags&F_RGB) + if (s->flags&F_T_SOUND) + { + /* %?St|name|<min|min+1|...|max-1|max> */ + int sound_setting = s->sound_setting->setting; + /* settings with decimals can't be used in conditionals */ + if (sound_numdecimals(sound_setting) == 0) + { + *intval = (*(int*)s->setting-sound_min(sound_setting)) + /sound_steps(sound_setting) + 1; + } + else + *intval = -1; + } + else if (s->flags&F_RGB) /* %?St|name|<#000000|#000001|...|#FFFFFF> */ /* shouldn't overflow since colors are stored * on 16 bits ... |