Undoable add/remove bar (#6347)

* Undoable add/remove bar

* Don't add checkpoints to empty tracks

Authored by: Spekular <Spekular@users.noreply.github.com>
This commit is contained in:
Alex
2022-04-13 20:11:37 +02:00
committed by GitHub
parent 32caf80be1
commit 7c1ebd31c9

View File

@@ -775,10 +775,11 @@ void Song::stopExport()
void Song::insertBar()
{
m_tracksMutex.lockForRead();
for( TrackList::const_iterator it = tracks().begin();
it != tracks().end(); ++it )
for (Track* track: tracks())
{
( *it )->insertBar( m_playPos[Mode_PlaySong] );
// FIXME journal batch of tracks instead of each track individually
if (track->numOfClips() > 0) { track->addJournalCheckPoint(); }
track->insertBar(m_playPos[Mode_PlaySong]);
}
m_tracksMutex.unlock();
}
@@ -789,10 +790,11 @@ void Song::insertBar()
void Song::removeBar()
{
m_tracksMutex.lockForRead();
for( TrackList::const_iterator it = tracks().begin();
it != tracks().end(); ++it )
for (Track* track: tracks())
{
( *it )->removeBar( m_playPos[Mode_PlaySong] );
// FIXME journal batch of tracks instead of each track individually
if (track->numOfClips() > 0) { track->addJournalCheckPoint(); }
track->removeBar(m_playPos[Mode_PlaySong]);
}
m_tracksMutex.unlock();
}