Added method to sound source to get playback position percent. Avoid seeking sound source when changing FFT size. Readme change.
This commit is contained in:
@ -75,6 +75,7 @@ public:
|
||||
bool isLooping() { return m_loop_enabled; }
|
||||
virtual void setLoopEnabled(bool b) = 0;
|
||||
int64_t getCurrentPosition() { return m_currentsample; }
|
||||
double getCurrentPositionPercent() { return 1.0 / info.nsamples*m_currentsample; }
|
||||
virtual bool hasEnded()
|
||||
{
|
||||
return m_currentsample >= info.nsamples*m_activerange.getEnd();
|
||||
|
@ -399,7 +399,8 @@ void StretchAudioSource::initObjects()
|
||||
{
|
||||
ScopedLock locker(m_cs);
|
||||
m_inputfile->setActiveRange(m_playrange);
|
||||
m_inputfile->seek(m_playrange.getStart());
|
||||
if (m_inputfile->getActiveRange().contains(m_inputfile->getCurrentPositionPercent())==false)
|
||||
m_inputfile->seek(m_playrange.getStart());
|
||||
|
||||
m_firstbuffer = true;
|
||||
if (m_stretchoutringbuf.getSize() < m_num_outchans*m_process_fftsize)
|
||||
|
Reference in New Issue
Block a user