Fix crash on CLI rendering (#5579)

This is a temporary workaround. To make all export options available in CLI,
some properties of TimeLineWidget should be moved to a core class.
This commit is contained in:
Hyunjin Song
2020-07-20 11:38:46 +09:00
committed by GitHub
parent 619b1d67cd
commit 5a7ec92cf0

View File

@@ -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 );
}