diff options
Diffstat (limited to 'muse2/muse/song.cpp')
-rw-r--r-- | muse2/muse/song.cpp | 53 |
1 files changed, 19 insertions, 34 deletions
diff --git a/muse2/muse/song.cpp b/muse2/muse/song.cpp index 1b7354f2..0c7a0c73 100644 --- a/muse2/muse/song.cpp +++ b/muse2/muse/song.cpp @@ -84,8 +84,8 @@ Song::Song(const char* name) noteFifoSize = 0; noteFifoWindex = 0; noteFifoRindex = 0; - undoList = new UndoList; - redoList = new UndoList; + undoList = new UndoList(true); // "true" means "this is an undoList", + redoList = new UndoList(false); // "false" means "redoList" _markerList = new MarkerList; _globalPitchShift = 0; bounceTrack = NULL; @@ -570,24 +570,6 @@ void Song::deselectTracks() (*t)->setSelected(false); } -/* DELETETHIS 17 -//--------------------------------------------------------- -// changeTrack -// oldTrack - copy of the original track befor modification -// newTrack - modified original track -//--------------------------------------------------------- - -void Song::changeTrack(Track* oldTrack, Track* newTrack) - { - oldTrack->setSelected(false); //?? - int idx = _tracks.index(newTrack); - - //addUndo(UndoOp(UndoOp::ModifyTrack, oldTrack, newTrack)); - addUndo(UndoOp(UndoOp::ModifyTrack, idx, oldTrack, newTrack)); - updateFlags |= SC_TRACK_MODIFIED; - } -*/ - //--------------------------------------------------------- // addEvent // return true if event was added @@ -2100,13 +2082,11 @@ void Song::clear(bool signal, bool clear_all) MusEGlobal::keymap.clear(); undoList->clearDelete(); - // DELETETHIS - //redoList->clear(); // Check this - Should we do a clearDelete? IIRC it was OK this way - no clearDelete in case of same items in both lists. - redoList->clearDelete(); // p4.0.46 Tim + redoList->clearDelete(); if(MusEGlobal::undoAction) - MusEGlobal::undoAction->setEnabled(false); // + MusEGlobal::undoAction->setEnabled(false); if(MusEGlobal::redoAction) - MusEGlobal::redoAction->setEnabled(false); // + MusEGlobal::redoAction->setEnabled(false); _markerList->clear(); pos[0].setTick(0); @@ -2195,11 +2175,9 @@ void Song::cleanupForQuit() MusEGlobal::keymap.clear(); if(MusEGlobal::debugMsg) - printf("deleting undoList, clearing redoList\n"); + printf("deleting undoList and redoList\n"); undoList->clearDelete(); - //DELETETHIS - //redoList->clear(); // Check this - Should we do a clearDelete? IIRC it was OK this way - no clearDelete in case of same items in both lists. - redoList->clearDelete(); // p4.0.46 Tim + redoList->clearDelete(); _markerList->clear(); @@ -2262,10 +2240,6 @@ void Song::cleanupForQuit() // are handled by ~AudioTrack. if(MusEGlobal::debugMsg) - printf("Muse: Deleting sound files\n"); - SndFile::sndFiles.clearDelete(); - - if(MusEGlobal::debugMsg) printf("...finished cleaning up.\n"); } @@ -2765,16 +2739,24 @@ void Song::clearRecAutomation(bool clearList) void Song::processAutomationEvents() { + MusEGlobal::audio->msgIdle(true); // gain access to all data structures + // Just clear all pressed and touched flags, not rec event lists. clearRecAutomation(false); if (!MusEGlobal::automation) + { + MusEGlobal::audio->msgIdle(false); return; + } + for(iTrack i = _tracks.begin(); i != _tracks.end(); ++i) { if(!(*i)->isMidiTrack()) // Process (and clear) rec events. ((AudioTrack*)(*i))->processAutomationEvents(); } + + MusEGlobal::audio->msgIdle(false); } //--------------------------------------------------------- @@ -2794,7 +2776,10 @@ void Song::abortRolling() void Song::stopRolling() { - abortRolling(); + if (record()) + MusEGlobal::audio->recordStop(); + setStopPlay(false); + processAutomationEvents(); } |