Skip to content

Commit

Permalink
Fix crash on CLI rendering (LMMS#5579)
Browse files Browse the repository at this point in the history
This is a temporary workaround. To make all export options available in CLI,
some properties of TimeLineWidget should be moved to a core class.
  • Loading branch information
PhysSong authored Jul 20, 2020
1 parent e5924d1 commit acda31d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/core/Song.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -767,12 +767,16 @@ void Song::startExport()
m_exportSongEnd += MidiTime(1,0);

m_exportSongBegin = MidiTime(0,0);
m_exportLoopBegin = m_playPos[Mode_PlaySong].m_timeLine->loopBegin() < m_exportSongEnd &&
m_playPos[Mode_PlaySong].m_timeLine->loopEnd() <= m_exportSongEnd ?
m_playPos[Mode_PlaySong].m_timeLine->loopBegin() : MidiTime(0,0);
m_exportLoopEnd = m_playPos[Mode_PlaySong].m_timeLine->loopBegin() < m_exportSongEnd &&
m_playPos[Mode_PlaySong].m_timeLine->loopEnd() <= m_exportSongEnd ?
m_playPos[Mode_PlaySong].m_timeLine->loopEnd() : MidiTime(0,0);
// FIXME: remove this check once we load timeline in headless mode
if (m_playPos[Mode_PlaySong].m_timeLine)
{
m_exportLoopBegin = m_playPos[Mode_PlaySong].m_timeLine->loopBegin() < m_exportSongEnd &&
m_playPos[Mode_PlaySong].m_timeLine->loopEnd() <= m_exportSongEnd ?
m_playPos[Mode_PlaySong].m_timeLine->loopBegin() : MidiTime(0,0);
m_exportLoopEnd = m_playPos[Mode_PlaySong].m_timeLine->loopBegin() < m_exportSongEnd &&
m_playPos[Mode_PlaySong].m_timeLine->loopEnd() <= m_exportSongEnd ?
m_playPos[Mode_PlaySong].m_timeLine->loopEnd() : MidiTime(0,0);
}

m_playPos[Mode_PlaySong].setTicks( 0 );
}
Expand Down

0 comments on commit acda31d

Please sign in to comment.