summaryrefslogtreecommitdiff
path: root/apps/tdspeed.c
diff options
context:
space:
mode:
authorAlexander Levin <al.le@rockbox.org>2009-07-11 16:46:19 +0000
committerAlexander Levin <al.le@rockbox.org>2009-07-11 16:46:19 +0000
commitcc7c665d9b5e6d801f248799dabe05e3729bb1c8 (patch)
tree3c82c6774acc78e814bad736496c693877295866 /apps/tdspeed.c
parent17ac0d7ff9604664a1894fd49883e44291f06451 (diff)
downloadrockbox-cc7c665d9b5e6d801f248799dabe05e3729bb1c8.zip
rockbox-cc7c665d9b5e6d801f248799dabe05e3729bb1c8.tar.gz
rockbox-cc7c665d9b5e6d801f248799dabe05e3729bb1c8.tar.bz2
rockbox-cc7c665d9b5e6d801f248799dabe05e3729bb1c8.tar.xz
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
Diffstat (limited to 'apps/tdspeed.c')
-rw-r--r--apps/tdspeed.c11
1 files changed, 5 insertions, 6 deletions
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 <stdio.h>
#include <string.h>
#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;