summaryrefslogtreecommitdiff
path: root/muse2/muse/song.cpp
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2012-05-28 14:15:52 +0000
committerFlorian Jung <flo@windfisch.org>2012-05-28 14:15:52 +0000
commitd2a88cfaad5ac385fc3c6212c09ad7fbc38e9454 (patch)
tree387da0b38255003e1a971629ea0de32273ac3d3c /muse2/muse/song.cpp
parent716f5a5b56a3b7ff59004ef0a1af5f98cb2a691c (diff)
merged with release_2_0
Diffstat (limited to 'muse2/muse/song.cpp')
-rw-r--r--muse2/muse/song.cpp53
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();
}