summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-10-15 22:22:07 +0000
committerThomas Martitz <kugel@rockbox.org>2009-10-15 22:22:07 +0000
commit0070f60441bac95a674c4c5511b652c9a62d8ce7 (patch)
treeacf6ef71b9af53c8fa36bd162bb2d516ceacfb8c /apps
parent44cacbe595b9bb436951e2ed29a4770cdf9f3e28 (diff)
downloadrockbox-0070f60441bac95a674c4c5511b652c9a62d8ce7.tar.gz
rockbox-0070f60441bac95a674c4c5511b652c9a62d8ce7.tar.bz2
rockbox-0070f60441bac95a674c4c5511b652c9a62d8ce7.zip
Fix %Sp expansion in wps
The value returned from sound_get_pitch() was shown assuming that 100% corresponds to 1000 by skin_tokens.c::get_token_value(). The value actually is 100*PITCH_SPEED_PRECISION. Steal the way the callchain from gui_syncpitchscreen_run() to pitchscreen_draw() in apps/gui/pitchscreen.c formats the value and use it here for consistency. Flyspray: FS#10673 Author: Junio C Hamano git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23199 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/skin_engine/skin_tokens.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c
index e0d4595122..ad4613ed99 100644
--- a/apps/gui/skin_engine/skin_tokens.c
+++ b/apps/gui/skin_engine/skin_tokens.c
@@ -717,9 +717,10 @@ const char *get_token_value(struct gui_wps *gwps,
#if (CONFIG_CODEC != MAS3507D)
case WPS_TOKEN_SOUND_PITCH:
{
- int val = sound_get_pitch();
- snprintf(buf, buf_size, "%d.%d",
- val / 10, val % 10);
+ int32_t pitch = sound_get_pitch();
+ snprintf(buf, buf_size, "%ld.%ld",
+ pitch / PITCH_SPEED_PRECISION,
+ (pitch % PITCH_SPEED_PRECISION) / (PITCH_SPEED_PRECISION / 10));
return buf;
}
#endif