Skip to content

Commit

Permalink
Fix loop condition in project rendering (#3105, #2030) (#3576)
Browse files Browse the repository at this point in the history
* Change loop condition in ProjectRenderer::run()

* Remove Song::isExportDone()
  • Loading branch information
PhysSong authored and Umcaruje committed May 29, 2017
1 parent 1eef218 commit 4ff091f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 25 deletions.
5 changes: 3 additions & 2 deletions src/core/ProjectRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{
Expand Down
23 changes: 0 additions & 23 deletions src/core/Song.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down

0 comments on commit 4ff091f

Please sign in to comment.