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:
xenakios 2018-01-31 20:06:12 +02:00
parent 42061670a8
commit b179285b93
3 changed files with 5 additions and 2 deletions

View File

@ -75,6 +75,7 @@ public:
bool isLooping() { return m_loop_enabled; } bool isLooping() { return m_loop_enabled; }
virtual void setLoopEnabled(bool b) = 0; virtual void setLoopEnabled(bool b) = 0;
int64_t getCurrentPosition() { return m_currentsample; } int64_t getCurrentPosition() { return m_currentsample; }
double getCurrentPositionPercent() { return 1.0 / info.nsamples*m_currentsample; }
virtual bool hasEnded() virtual bool hasEnded()
{ {
return m_currentsample >= info.nsamples*m_activerange.getEnd(); return m_currentsample >= info.nsamples*m_activerange.getEnd();

View File

@ -399,6 +399,7 @@ void StretchAudioSource::initObjects()
{ {
ScopedLock locker(m_cs); ScopedLock locker(m_cs);
m_inputfile->setActiveRange(m_playrange); m_inputfile->setActiveRange(m_playrange);
if (m_inputfile->getActiveRange().contains(m_inputfile->getCurrentPositionPercent())==false)
m_inputfile->seek(m_playrange.getStart()); m_inputfile->seek(m_playrange.getStart());
m_firstbuffer = true; m_firstbuffer = true;

View File

@ -44,10 +44,11 @@ History :
provide the file name of the source of audio file, so audio clip/event/item specific audio won't be imported) provide the file name of the source of audio file, so audio clip/event/item specific audio won't be imported)
-Removed an unnecessary level of buffering (doesn't reduce latency but should help a bit with CPU usage) -Removed an unnecessary level of buffering (doesn't reduce latency but should help a bit with CPU usage)
-Added About window -Added About window
01-30-2018 1.0.0 preview 5 01-31-2018 1.0.0 preview 5
-Added buttons to enable/disable spectral processing steps -Added buttons to enable/disable spectral processing steps
-Restored ability to set capture buffer length (via the settings menu) -Restored ability to set capture buffer length (via the settings menu)
-Seek to play range beginning when audio file imported -Seek to play range beginning when audio file imported
-No longer seeks to beginning of play range when changing FFT size
-Fixes to waveform display issues -Fixes to waveform display issues
-Double click on waveform selects whole waveform -Double click on waveform selects whole waveform