1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Jonathan Gordon 2010-02-18 07:04:16 +00:00
parent 55b21c104f
commit 45a181d8fc

View file

@ -909,7 +909,20 @@ const char *get_token_value(struct gui_wps *gwps,
{ {
case F_T_INT: case F_T_INT:
case F_T_UINT: 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> */ /* %?St|name|<#000000|#000001|...|#FFFFFF> */
/* shouldn't overflow since colors are stored /* shouldn't overflow since colors are stored
* on 16 bits ... * on 16 bits ...