diff --git a/include/Song.h b/include/Song.h index 81f12303d..7873bafd6 100644 --- a/include/Song.h +++ b/include/Song.h @@ -34,6 +34,7 @@ #include "MeterModel.h" #include "VstSyncController.h" + class AutomationTrack; class Pattern; class Timeline; @@ -169,19 +170,8 @@ public: return m_recording; } - inline bool isExportDone() const - { - if ( m_exportLoop ) - { - return m_exporting == true && - m_playPos[Mode_PlaySong].getTicks() >= length() * ticksPerTact(); - } - else - { - return m_exporting == true && - m_playPos[Mode_PlaySong].getTicks() >= ( length() + 1 ) * ticksPerTact(); - } - } + bool isExportDone() const; + inline PlayModes playMode() const { diff --git a/src/core/Song.cpp b/src/core/Song.cpp index 2dd9c549b..de749065b 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -386,6 +386,21 @@ void Song::processNextBuffer() } } +bool Song::isExportDone() const +{ + if ( m_exportLoop ) + { + return m_exporting == true && + m_playPos[Mode_PlaySong].getTicks() >= m_playPos[Mode_PlaySong].m_timeLine->loopEnd().getTicks(); + + } + else + { + return m_exporting == true && + m_playPos[Mode_PlaySong].getTicks() >= ( length() + 1 ) * ticksPerTact(); + } +} + @@ -619,7 +634,14 @@ void Song::stop() void Song::startExport() { stop(); - m_playPos[Mode_PlaySong].setTicks( 0 ); + if(m_exportLoop) + { + m_playPos[Mode_PlaySong].setTicks( m_playPos[Mode_PlaySong].m_timeLine->loopBegin().getTicks() ); + } + else + { + m_playPos[Mode_PlaySong].setTicks( 0 ); + } playSong();