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:
parent
9e94b380f0
commit
4a6ab0d031
1 changed files with 19 additions and 4 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue