summaryrefslogtreecommitdiff
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
parent44cacbe595b9bb436951e2ed29a4770cdf9f3e28 (diff)
downloadrockbox-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
-rw-r--r--apps/gui/skin_engine/skin_tokens.c7
-rw-r--r--docs/CREDITS1
2 files changed, 5 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
diff --git a/docs/CREDITS b/docs/CREDITS
index 52d570d3b4..093ee194eb 100644
--- a/docs/CREDITS
+++ b/docs/CREDITS
@@ -498,6 +498,7 @@ Carsten Schreiter
498Michael Sparmann 498Michael Sparmann
499Seth Opgenorth 499Seth Opgenorth
500Jonas Aaberg 500Jonas Aaberg
501Junio C Hamano
501 502
502The libmad team 503The libmad team
503The wavpack team 504The wavpack team