diff options
author | Thomas Martitz <kugel@rockbox.org> | 2009-10-15 22:22:07 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2009-10-15 22:22:07 +0000 |
commit | 0070f60441bac95a674c4c5511b652c9a62d8ce7 (patch) | |
tree | acf6ef71b9af53c8fa36bd162bb2d516ceacfb8c /apps/gui/skin_engine/skin_tokens.c | |
parent | 44cacbe595b9bb436951e2ed29a4770cdf9f3e28 (diff) | |
download | rockbox-0070f60441bac95a674c4c5511b652c9a62d8ce7.tar.gz 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/gui/skin_engine/skin_tokens.c')
-rw-r--r-- | apps/gui/skin_engine/skin_tokens.c | 7 |
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, | |||
717 | #if (CONFIG_CODEC != MAS3507D) | 717 | #if (CONFIG_CODEC != MAS3507D) |
718 | case WPS_TOKEN_SOUND_PITCH: | 718 | case WPS_TOKEN_SOUND_PITCH: |
719 | { | 719 | { |
720 | int val = sound_get_pitch(); | 720 | int32_t pitch = sound_get_pitch(); |
721 | snprintf(buf, buf_size, "%d.%d", | 721 | snprintf(buf, buf_size, "%ld.%ld", |
722 | val / 10, val % 10); | 722 | pitch / PITCH_SPEED_PRECISION, |
723 | (pitch % PITCH_SPEED_PRECISION) / (PITCH_SPEED_PRECISION / 10)); | ||
723 | return buf; | 724 | return buf; |
724 | } | 725 | } |
725 | #endif | 726 | #endif |