From 8f12d483a79e41212d9c134a47968a4eef594fb1 Mon Sep 17 00:00:00 2001 From: Dave French Date: Sun, 21 Dec 2014 19:59:29 +0000 Subject: [PATCH] Render between loop markers --- include/Song.h | 16 +++------------- src/core/Song.cpp | 24 +++++++++++++++++++++++- 2 files changed, 26 insertions(+), 14 deletions(-) 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();