Skip to content

Commit

Permalink
Undoable add/remove bar (#6347)
Browse files Browse the repository at this point in the history
* Undoable add/remove bar

* Don't add checkpoints to empty tracks

Authored by: Spekular <[email protected]>
  • Loading branch information
allejok96 authored Apr 13, 2022
1 parent 32caf80 commit 7c1ebd3
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/core/Song.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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();
}
Expand Down

0 comments on commit 7c1ebd3

Please sign in to comment.