Fix loop condition in project rendering (#3105, #2030) (#3576)

* Change loop condition in ProjectRenderer::run()

* Remove Song::isExportDone()
This commit is contained in:
Hyunjin Song
2017-05-30 01:40:05 +09:00
committed by Umcaruje
parent 1eef218aeb
commit 4ff091fd6f
2 changed files with 3 additions and 25 deletions

View File

@@ -172,10 +172,11 @@ void ProjectRenderer::run()
m_progress = 0;
std::pair<MidiTime, MidiTime> exportEndpoints = Engine::getSong()->getExportEndpoints();
tick_t startTick = exportEndpoints.first.getTicks();
tick_t lengthTicks = exportEndpoints.second.getTicks() - startTick;
tick_t endTick = exportEndpoints.second.getTicks();
tick_t lengthTicks = endTick - startTick;
// Continually track and emit progress percentage to listeners
while( Engine::getSong()->isExportDone() == false &&
while( exportPos.getTicks() < endTick &&
Engine::getSong()->isExporting() == true
&& !m_abort )
{

View File

@@ -464,29 +464,6 @@ void Song::processAutomations(const TrackList &tracklist, MidiTime timeStart, fp
}
}
bool Song::isExportDone() const
{
if ( m_renderBetweenMarkers )
{
return m_exporting == true &&
m_playPos[Mode_PlaySong].getTicks() >=
m_playPos[Mode_PlaySong].m_timeLine->loopEnd().getTicks();
}
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();
}
}
std::pair<MidiTime, MidiTime> Song::getExportEndpoints() const
{
if ( m_renderBetweenMarkers )