Commit FS#7164 (request is FS#6780) : Improve WPS volume enumeration. It is now the following : %?pv<Mute|...|...|0 dB|Above 0 dB>. It almost doesn't changes anything for most WPSs but adds some new possibilities. Keep in mind that some targets don't go above 0 dB so the last case might be unused.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13387 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Nicolas Pennequin 2007-05-14 14:33:43 +00:00
parent 9e94b380f0
commit 4a6ab0d031

View file

@ -837,10 +837,25 @@ static char *get_token_value(struct gui_wps *gwps,
snprintf(buf, buf_size, "%d", global_settings.volume);
if (intval)
{
*intval = limit * (global_settings.volume
- sound_min(SOUND_VOLUME))
/ (sound_max(SOUND_VOLUME)
- sound_min(SOUND_VOLUME)) + 1;
if (global_settings.volume == sound_min(SOUND_VOLUME))
{
*intval = 1;
}
else if (global_settings.volume == 0)
{
*intval = limit - 1;
}
else if (global_settings.volume > 0)
{
*intval = limit;
}
else
{
*intval = (limit - 3) * (global_settings.volume
- sound_min(SOUND_VOLUME))
/ (sound_max(SOUND_VOLUME)
- sound_min(SOUND_VOLUME)) + 2;
}
}
return buf;