summaryrefslogtreecommitdiff
path: root/muse2/muse/structure.cpp
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-09-04 17:43:39 +0000
committerFlorian Jung <flo@windfisch.org>2011-09-04 17:43:39 +0000
commit5669de5d2d1b978bd34c80964d299688282d7027 (patch)
treed049caa2e608865a0381a7096d0f0b97a30a6474 /muse2/muse/structure.cpp
parent46369b4c33d841aa1ece363c3deb3775658165ad (diff)
added paste dialog plus minor fixes:
- moved and changed muse.pro file - added update_pro.sh and update_translations.sh - updated translations - moved stuff from functions.cpp out to dialogs.cpp - fixed behaviour of movePartsTotheRight(): parts which begin at "start of move" aren't expanded, but moved now
Diffstat (limited to 'muse2/muse/structure.cpp')
-rw-r--r--muse2/muse/structure.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/muse2/muse/structure.cpp b/muse2/muse/structure.cpp
index 1fb1668d..1a741834 100644
--- a/muse2/muse/structure.cpp
+++ b/muse2/muse/structure.cpp
@@ -19,6 +19,8 @@
#include "structure.h"
#include "globals.h"
+#include <set>
+using std::set;
//---------------------------------------------------------
// adjustGlobalLists
// helper that adjusts tempo, sig, key and marker
@@ -233,7 +235,7 @@ void globalInsert()
}
-Undo movePartsTotheRight(unsigned int startTicks, int moveTicks, bool only_selected)
+Undo movePartsTotheRight(unsigned int startTicks, int moveTicks, bool only_selected, set<Track*>* tracklist)
{
if (moveTicks<=0)
return Undo();
@@ -251,7 +253,9 @@ Undo movePartsTotheRight(unsigned int startTicks, int moveTicks, bool only_selec
for (iTrack it = tracks->begin(); it != tracks->end(); ++it) {
MidiTrack* track = dynamic_cast<MidiTrack*>(*it);
- if (track == 0 || (only_selected && at_least_one_selected && !track->selected()))
+ if ( (track == 0) ||
+ (only_selected && at_least_one_selected && !track->selected()) ||
+ (tracklist && tracklist->find(track)==tracklist->end()) )
continue;
PartList* pl = track->parts();
for (riPart p = pl->rbegin(); p != pl->rend(); ++p) {
@@ -260,7 +264,7 @@ Undo movePartsTotheRight(unsigned int startTicks, int moveTicks, bool only_selec
int l = part->lenTick();
if (t + l <= startTicks)
continue;
- if (startTicks >= t && startTicks < (t+l)) {
+ if (startTicks > t && startTicks < (t+l)) {
MidiPart* nPart = new MidiPart(*(MidiPart*)part);
nPart->setLenTick(l + moveTicks);
EventList* el = nPart->events();
@@ -276,7 +280,7 @@ Undo movePartsTotheRight(unsigned int startTicks, int moveTicks, bool only_selec
}
operations.push_back(UndoOp(UndoOp::ModifyPart, part, nPart, true, true));
}
- else if (t > startTicks) {
+ else if (t >= startTicks) {
MidiPart* nPart = new MidiPart(*(MidiPart*)part);
nPart->setTick(t + moveTicks);
operations.push_back(UndoOp(UndoOp::ModifyPart, part, nPart, true, false));