From a7fba3acdfaa382effcc02633708d7cf5a7ec2a4 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Tue, 30 Aug 2011 17:00:30 +0000 Subject: improved movePartsToTheRight and merged with globalInsert --- muse2/muse/arranger/pcanvas.cpp | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) (limited to 'muse2/muse/arranger/pcanvas.cpp') diff --git a/muse2/muse/arranger/pcanvas.cpp b/muse2/muse/arranger/pcanvas.cpp index 572492d6..19e53f2e 100644 --- a/muse2/muse/arranger/pcanvas.cpp +++ b/muse2/muse/arranger/pcanvas.cpp @@ -27,6 +27,7 @@ #include "widgets/tools.h" #include "arranger.h" #include "arrangerview.h" +#include "structure.h" #include "pcanvas.h" #include "midieditor.h" #include "globals.h" @@ -2878,40 +2879,6 @@ void PartCanvas::paste(bool clone, bool toTrack, bool doInsert) } -//--------------------------------------------------------- -// movePartsToTheRight -//--------------------------------------------------------- -Undo PartCanvas::movePartsTotheRight(unsigned int startTicks, int length) -{ - Undo operations; - - // all parts that start after the pasted parts will be moved the entire length of the pasted parts - for (iCItem i = items.begin(); i != items.end(); ++i) { - if (!i->second->isSelected()) { - Part* part = i->second->part(); - if (part->tick() >= startTicks) { - Part *newPart = part->clone(); - newPart->setTick(newPart->tick()+length); - - operations.push_back(UndoOp(UndoOp::ModifyPart,part,newPart,false,false)); - } - } - } - // perhaps ask if markers should be moved? - MarkerList *markerlist = song->marker(); - for(iMarker i = markerlist->begin(); i != markerlist->end(); ++i) - { - Marker* m = &i->second; - if (m->tick() >= startTicks) { - Marker *oldMarker = new Marker(); - *oldMarker = *m; - m->setTick(m->tick()+length); - operations.push_back(UndoOp(UndoOp::ModifyMarker,oldMarker, m)); - } - } - - return operations; -} //--------------------------------------------------------- // startDrag //--------------------------------------------------------- -- cgit v1.2.3