1
0
Fork 0
forked from len0rd/rockbox

Renamed routines and changed comments for clarity.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21309 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Steve Bavin 2009-06-16 07:10:05 +00:00
parent e3cb71d6b1
commit d6ad019af3
4 changed files with 18 additions and 19 deletions

View file

@ -270,7 +270,7 @@ static void tdspeed_setup(struct dsp_config *dspc)
dspc->tdspeed_active = false;
if (dspc == &AUDIO_DSP)
{
if(!dsp_timestretch_enabled())
if(!dsp_timestretch_available())
return;
if (dspc->tdspeed_percent == 0)
dspc->tdspeed_percent = 100;
@ -285,26 +285,25 @@ static void tdspeed_setup(struct dsp_config *dspc)
}
}
void dsp_timestretch_enable(bool enable)
void dsp_timestretch_enable(bool enabled)
{
if (enable)
/* Hook to set up timestretch buffer on first call to settings_apply() */
if (big_sample_buf_count < 0) /* Only do something on first call */
{
/* Set up timestretch buffers on first enable */
if (big_sample_buf_count < 0)
if (enabled)
{
/* Set up timestretch buffers */
big_sample_buf_count = SMALL_SAMPLE_BUF_COUNT * RESAMPLE_RATIO;
big_sample_buf = small_resample_buf;
big_resample_buf = (int32_t *) buffer_alloc(big_sample_buf_count * RESAMPLE_RATIO * sizeof(int32_t));
}
}
else
{
/* If not enabled at startup, buffers will never be available */
if (big_sample_buf_count < 0)
else
{
/* Not enabled at startup, "big" buffers will never be available */
big_sample_buf_count = 0;
}
tdspeed_setup(&AUDIO_DSP);
}
global_settings.timestretch_enabled = enable;
tdspeed_setup(&AUDIO_DSP);
}
void dsp_set_timestretch(int percent)
@ -318,7 +317,7 @@ int dsp_get_timestretch()
return AUDIO_DSP.tdspeed_percent;
}
bool dsp_timestretch_enabled()
bool dsp_timestretch_available()
{
return (global_settings.timestretch_enabled && big_sample_buf_count > 0);
}