diff options
author | Alexander Levin <al.le@rockbox.org> | 2009-07-11 16:46:19 +0000 |
---|---|---|
committer | Alexander Levin <al.le@rockbox.org> | 2009-07-11 16:46:19 +0000 |
commit | cc7c665d9b5e6d801f248799dabe05e3729bb1c8 (patch) | |
tree | 3c82c6774acc78e814bad736496c693877295866 /apps/dsp.c | |
parent | 17ac0d7ff9604664a1894fd49883e44291f06451 (diff) | |
download | rockbox-cc7c665d9b5e6d801f248799dabe05e3729bb1c8.tar.gz rockbox-cc7c665d9b5e6d801f248799dabe05e3729bb1c8.zip |
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/dsp.c')
-rw-r--r-- | apps/dsp.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/apps/dsp.c b/apps/dsp.c index 30b4ed357b..ec59417621 100644 --- a/apps/dsp.c +++ b/apps/dsp.c @@ -162,7 +162,7 @@ struct dsp_config int sample_depth; int sample_bytes; int stereo_mode; - int tdspeed_percent; /* Speed % */ + int32_t tdspeed_percent; /* Speed% * PITCH_SPEED_PRECISION */ bool tdspeed_active; /* Timestretch is in use */ int frac_bits; #ifdef HAVE_SW_TONE_CONTROLS @@ -205,7 +205,7 @@ static int treble; /* A/V */ #endif /* Settings applicable to audio codec only */ -static int pitch_ratio = 1000; +static int32_t pitch_ratio = PITCH_SPEED_100; static int channels_mode; long dsp_sw_gain; long dsp_sw_cross; @@ -254,14 +254,14 @@ static inline int32_t clip_sample_16(int32_t sample) return sample; } -int sound_get_pitch(void) +int32_t sound_get_pitch(void) { return pitch_ratio; } -void sound_set_pitch(int permille) +void sound_set_pitch(int32_t percent) { - pitch_ratio = permille; + pitch_ratio = percent; dsp_configure(&AUDIO_DSP, DSP_SWITCH_FREQUENCY, AUDIO_DSP.codec_frequency); } @@ -277,7 +277,7 @@ static void tdspeed_setup(struct dsp_config *dspc) if(!dsp_timestretch_available()) return; /* Timestretch not enabled or buffer not allocated */ if (dspc->tdspeed_percent == 0) - dspc->tdspeed_percent = 100; + dspc->tdspeed_percent = PITCH_SPEED_100; if (!tdspeed_config( dspc->codec_frequency == 0 ? NATIVE_FREQUENCY : dspc->codec_frequency, dspc->stereo_mode != STEREO_MONO, @@ -312,13 +312,13 @@ void dsp_timestretch_enable(bool enabled) } } -void dsp_set_timestretch(int percent) +void dsp_set_timestretch(int32_t percent) { AUDIO_DSP.tdspeed_percent = percent; tdspeed_setup(&AUDIO_DSP); } -int dsp_get_timestretch() +int32_t dsp_get_timestretch() { return AUDIO_DSP.tdspeed_percent; } @@ -1347,7 +1347,7 @@ intptr_t dsp_configure(struct dsp_config *dsp, int setting, intptr_t value) not need this feature. */ if (dsp == &AUDIO_DSP) - dsp->frequency = pitch_ratio * dsp->codec_frequency / 1000; + dsp->frequency = pitch_ratio * dsp->codec_frequency / PITCH_SPEED_100; else dsp->frequency = dsp->codec_frequency; |