diff options
author | Florian Jung <flo@windfisch.org> | 2013-08-28 00:49:49 +0200 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2013-08-28 00:50:24 +0200 |
commit | c5e6fd0f6dfbf18847b601668ba8c657d776da31 (patch) | |
tree | 32ce317253bb39b0928b521c33007f39cabd150d /muse2/muse/song.cpp | |
parent | 3c1ae69c8e4a679588d0db4886f21e150bae572e (diff) |
operations are now replicated for all clones. minor cleanups.
it compiles and seems to work again! :)
Diffstat (limited to 'muse2/muse/song.cpp')
-rw-r--r-- | muse2/muse/song.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/muse2/muse/song.cpp b/muse2/muse/song.cpp index b6d866e1..3cf1960d 100644 --- a/muse2/muse/song.cpp +++ b/muse2/muse/song.cpp @@ -216,9 +216,7 @@ Track* Song::addNewTrack(QAction* action, Track* insertAt) if((Track::TrackType)n >= Track::AUDIO_SOFTSYNTH) return 0; - Undo operations; - Track* t = addTrack(operations, (Track::TrackType)n, insertAt); - applyOperationGroup(operations); + Track* t = addTrack((Track::TrackType)n, insertAt); if (t->isVisible()) { deselectTracks(); t->setSelected(true); @@ -236,7 +234,7 @@ Track* Song::addNewTrack(QAction* action, Track* insertAt) // If insertAt is valid, inserts before insertAt. Else at the end after all tracks. //--------------------------------------------------------- -Track* Song::addTrack(Undo& /*operations*/, Track::TrackType type, Track* insertAt) +Track* Song::addTrack(Track::TrackType type, Track* insertAt) { Track* track = 0; int lastAuxIdx = _auxs.size(); @@ -293,12 +291,9 @@ Track* Song::addTrack(Undo& /*operations*/, Track::TrackType type, Track* insert int idx = insertAt ? _tracks.index(insertAt) : -1; - insertTrack1(track, idx); // this and the below are replaced - msgInsertTrack(track, idx, true); // by the UndoOp-operation - insertTrack3(track, idx); // does nothing - // No, can't do this. insertTrack2 needs to be called now, not later, otherwise it sees + // Apply it *now*. insertTrack2 needs to be called now, not later, otherwise it sees // that the track may have routes, and reciprocates them, causing duplicate routes. - ///operations.push_back(UndoOp(UndoOp::AddTrack, idx, track)); + applyOperation(UndoOp(UndoOp::AddTrack, idx, track)); // Add default track <-> midiport routes. if(track->isMidiTrack()) |