Made rewind a parameter. Attempts to fix the time range not being recalled properly in hosts because the time range parameters may be quickly changed when the plugin is initializing and doing the sound source smoothing fades. etc
This commit is contained in:
@ -330,6 +330,7 @@ public:
|
||||
void setActiveRange(Range<double> rng) override
|
||||
{
|
||||
std::lock_guard<std::mutex> locker(m_mutex);
|
||||
|
||||
/*
|
||||
if (rng.contains(getCurrentPositionPercent()))
|
||||
{
|
||||
@ -338,7 +339,7 @@ public:
|
||||
}
|
||||
*/
|
||||
m_seekfade.requestedrange = rng;
|
||||
if (m_seekfade.state == 0)
|
||||
//if (m_seekfade.state == 0)
|
||||
{
|
||||
m_seekfade.counter = 0;
|
||||
m_seekfade.state = 1;
|
||||
|
@ -156,7 +156,7 @@ void StretchAudioSource::setAudioBufferAsInputSource(AudioBuffer<float>* buf, in
|
||||
|
||||
m_curfile = File();
|
||||
if (m_playrange.isEmpty())
|
||||
setPlayRange({ 0.0,1.0 }, true);
|
||||
setPlayRange({ 0.0,1.0 });
|
||||
++m_param_change_count;
|
||||
}
|
||||
|
||||
@ -684,6 +684,7 @@ void StretchAudioSource::seekPercent(double pos)
|
||||
{
|
||||
ScopedLock locker(m_cs);
|
||||
m_seekpos = pos;
|
||||
//m_firstbuffer = true;
|
||||
//m_resampler->Reset();
|
||||
m_inputfile->seek(pos);
|
||||
++m_param_change_count;
|
||||
@ -715,7 +716,7 @@ void StretchAudioSource::setOnsetDetection(double x)
|
||||
}
|
||||
}
|
||||
|
||||
void StretchAudioSource::setPlayRange(Range<double> playrange, bool isloop)
|
||||
void StretchAudioSource::setPlayRange(Range<double> playrange)
|
||||
{
|
||||
if (m_playrange.isEmpty() == false && playrange == m_playrange)
|
||||
return;
|
||||
@ -727,7 +728,7 @@ void StretchAudioSource::setPlayRange(Range<double> playrange, bool isloop)
|
||||
m_playrange = playrange;
|
||||
m_stream_end_reached = false;
|
||||
m_inputfile->setActiveRange(m_playrange);
|
||||
m_inputfile->setLoopEnabled(isloop);
|
||||
|
||||
//if (m_playrange.contains(m_seekpos) == false)
|
||||
// m_inputfile->seek(m_playrange.getStart());
|
||||
m_seekpos = m_playrange.getStart();
|
||||
|
@ -77,7 +77,7 @@ public:
|
||||
double getOutputDurationSecondsForRange(Range<double> range, int fftsize);
|
||||
|
||||
void setOnsetDetection(double x);
|
||||
void setPlayRange(Range<double> playrange, bool isloop);
|
||||
void setPlayRange(Range<double> playrange);
|
||||
Range<double> getPlayRange() { return m_playrange; }
|
||||
bool isLoopEnabled();
|
||||
bool hasReachedEnd();
|
||||
|
Reference in New Issue
Block a user