diff options
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()) |