From cc7c665d9b5e6d801f248799dabe05e3729bb1c8 Mon Sep 17 00:00:00 2001 From: Alexander Levin Date: Sat, 11 Jul 2009 16:46:19 +0000 Subject: Improvements to the pitch screen UI (FS#10359 by David Johnston) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21781 a1c6a512-1295-4272-9138-f99709370657 --- apps/tdspeed.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'apps/tdspeed.c') diff --git a/apps/tdspeed.c b/apps/tdspeed.c index 07f8beb..cd01099 100644 --- a/apps/tdspeed.c +++ b/apps/tdspeed.c @@ -25,7 +25,6 @@ #include #include #include "buffer.h" -#include "debug.h" #include "system.h" #include "tdspeed.h" #include "settings.h" @@ -72,7 +71,7 @@ void tdspeed_init() } -bool tdspeed_config(int samplerate, bool stereo, int factor) +bool tdspeed_config(int samplerate, bool stereo, int32_t factor) { struct tdspeed_state_s *st = &tdspeed_state; int src_frame_sz; @@ -84,7 +83,7 @@ bool tdspeed_config(int samplerate, bool stereo, int factor) return false; /* Check parameters */ - if (factor == 100) + if (factor == PITCH_SPEED_100) return false; if (samplerate < MIN_RATE || samplerate > MAX_RATE) return false; @@ -94,14 +93,14 @@ bool tdspeed_config(int samplerate, bool stereo, int factor) st->stereo = stereo; st->dst_step = samplerate / MINFREQ; - if (factor > 100) - st->dst_step = st->dst_step * 100 / factor; + if (factor > PITCH_SPEED_100) + st->dst_step = st->dst_step * PITCH_SPEED_100 / factor; st->dst_order = 1; while (st->dst_step >>= 1) st->dst_order++; st->dst_step = (1 << st->dst_order); - st->src_step = st->dst_step * factor / 100; + st->src_step = st->dst_step * factor / PITCH_SPEED_100; st->shift_max = (st->dst_step > st->src_step) ? st->dst_step : st->src_step; src_frame_sz = st->shift_max + st->dst_step; -- cgit v1.1