Shorten the FFT switch crossfade length. Remove commented out code. Formatting change.

This commit is contained in:
xenakios 2018-02-13 22:16:18 +02:00
parent acbbe693bd
commit b6f5c0ea7d
3 changed files with 7 additions and 10 deletions

View File

@ -28,11 +28,14 @@ FFT::FFT(int nsamples_, bool no_inverse)
printf("WARNING: Odd sample size on FFT::FFT() (%d)",nsamples);
};
smp.resize(nsamples);
for (int i = 0; i < nsamples; i++) smp[i] = 0.0;
for (int i = 0; i < nsamples; i++)
smp[i] = 0.0;
freq.resize(nsamples/2+1);
for (int i=0;i<nsamples/2+1;i++) freq[i]=0.0;
for (int i=0;i<nsamples/2+1;i++)
freq[i]=0.0;
window.data.resize(nsamples);
for (int i=0;i<nsamples;i++) window.data[i]=0.707f;
for (int i=0;i<nsamples;i++)
window.data[i]=0.707f;
window.type=W_RECTANGULAR;

View File

@ -529,7 +529,7 @@ void StretchAudioSource::setFFTSize(int size)
{
m_xfadetask.state = 1;
m_xfadetask.counter = 0;
m_xfadetask.xfade_len = 44100;
m_xfadetask.xfade_len = 16384;
m_xfadetask.requested_fft_size = size;
}
else

View File

@ -458,7 +458,6 @@ void WaveformComponent::paint(Graphics & g)
if (m_image_dirty == true || m_waveimage.getWidth() != getWidth()
|| m_waveimage.getHeight() != getHeight() - m_topmargin)
{
//Logger::writeToLog("updating cached waveform image");
if (m_waveimage.getWidth() != getWidth()
|| m_waveimage.getHeight() != getHeight() - m_topmargin)
{
@ -472,15 +471,11 @@ void WaveformComponent::paint(Graphics & g)
}
else
{
//g.fillAll(Colours::black);
g.setColour(Colours::darkgrey);
m_thumbnail->drawChannels(g, { 0,m_topmargin,getWidth(),getHeight() - m_topmargin },
thumblen*m_view_range.getStart(), thumblen*m_view_range.getEnd(), 1.0f);
}
//g.setColour(Colours::darkgrey);
//m_thumb->drawChannels(g, { 0,m_topmargin,getWidth(),getHeight()-m_topmargin },
// 0.0, thumblen, 1.0f);
g.setColour(Colours::white.withAlpha(0.5f));
double sel_len = m_time_sel_end - m_time_sel_start;
//if (sel_len > 0.0 && sel_len < 1.0)
@ -530,7 +525,6 @@ void WaveformComponent::timerCallback()
void WaveformComponent::setFileCachedRange(std::pair<Range<double>, Range<double>> rng)
{
m_file_cached = rng;
//repaint();
}
void WaveformComponent::setTimerEnabled(bool b)