Added diagnostics to see how often the parameters have been set. Added a somewhat hacky way to avoid doing the parameter updates if not needed, using raw memory comparison.
This commit is contained in:
parent
6487880fb3
commit
d442e2eaea
@ -382,6 +382,8 @@ double StretchAudioSource::getInfileLengthSeconds()
|
|||||||
|
|
||||||
void StretchAudioSource::setRate(double rate)
|
void StretchAudioSource::setRate(double rate)
|
||||||
{
|
{
|
||||||
|
if (rate == m_playrate)
|
||||||
|
return;
|
||||||
std::lock_guard<std::mutex> locker(m_mutex);
|
std::lock_guard<std::mutex> locker(m_mutex);
|
||||||
//if (rate != m_lastplayrate)
|
//if (rate != m_lastplayrate)
|
||||||
{
|
{
|
||||||
@ -394,16 +396,20 @@ void StretchAudioSource::setRate(double rate)
|
|||||||
m_stretchers[i]->set_rap((float)rate);
|
m_stretchers[i]->set_rap((float)rate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
++m_param_change_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StretchAudioSource::setProcessParameters(ProcessParameters * pars)
|
void StretchAudioSource::setProcessParameters(ProcessParameters * pars)
|
||||||
{
|
{
|
||||||
|
if (memcmp(pars, &m_ppar, sizeof(ProcessParameters)) == 0)
|
||||||
|
return;
|
||||||
std::lock_guard<std::mutex> locker(m_mutex);
|
std::lock_guard<std::mutex> locker(m_mutex);
|
||||||
m_ppar = *pars;
|
m_ppar = *pars;
|
||||||
for (int i = 0; i < m_stretchers.size(); ++i)
|
for (int i = 0; i < m_stretchers.size(); ++i)
|
||||||
{
|
{
|
||||||
m_stretchers[i]->set_parameters(pars);
|
m_stretchers[i]->set_parameters(pars);
|
||||||
}
|
}
|
||||||
|
++m_param_change_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessParameters StretchAudioSource::getProcessParameters()
|
ProcessParameters StretchAudioSource::getProcessParameters()
|
||||||
|
@ -91,6 +91,7 @@ public:
|
|||||||
void setLoopingEnabled(bool b);
|
void setLoopingEnabled(bool b);
|
||||||
void setMaxLoops(int64_t numloops) { m_maxloops = numloops; }
|
void setMaxLoops(int64_t numloops) { m_maxloops = numloops; }
|
||||||
void setAudioBufferAsInputSource(AudioBuffer<float>* buf, int sr, int len);
|
void setAudioBufferAsInputSource(AudioBuffer<float>* buf, int sr, int len);
|
||||||
|
int m_param_change_count = 0;
|
||||||
private:
|
private:
|
||||||
CircularBuffer<float> m_stretchoutringbuf{ 1024 * 1024 };
|
CircularBuffer<float> m_stretchoutringbuf{ 1024 * 1024 };
|
||||||
AudioBuffer<float> m_file_inbuf;
|
AudioBuffer<float> m_file_inbuf;
|
||||||
|
@ -96,7 +96,10 @@ void PaulstretchpluginAudioProcessorEditor::timerCallback(int id)
|
|||||||
e->updateComponent();
|
e->updateComponent();
|
||||||
if (processor.isRecordingEnabled() != m_rec_enable.getToggleState())
|
if (processor.isRecordingEnabled() != m_rec_enable.getToggleState())
|
||||||
m_rec_enable.setToggleState(processor.isRecordingEnabled(), dontSendNotification);
|
m_rec_enable.setToggleState(processor.isRecordingEnabled(), dontSendNotification);
|
||||||
|
if (processor.isRecordingEnabled())
|
||||||
m_info_label.setText(String(processor.getRecordingPositionPercent()*100.0, 1),dontSendNotification);
|
m_info_label.setText(String(processor.getRecordingPositionPercent()*100.0, 1),dontSendNotification);
|
||||||
|
else
|
||||||
|
m_info_label.setText(String(processor.m_control->getStretchAudioSource()->m_param_change_count), dontSendNotification);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user