diff options
author | Tim E. Real <termtech@rogers.com> | 2010-10-09 06:29:26 +0000 |
---|---|---|
committer | Tim E. Real <termtech@rogers.com> | 2010-10-09 06:29:26 +0000 |
commit | a27706d9629e8b592cca4659f865b70adef24e6d (patch) | |
tree | 3fd8f07c9283f9b6e21a6f178beb8bb42158f947 | |
parent | 97b1b1e8ce4fb278da997c8ef1c6ee20ea1a28a4 (diff) |
See ChangeLog
-rw-r--r-- | muse/ChangeLog | 3 | ||||
-rw-r--r-- | muse/muse/part.cpp | 40 |
2 files changed, 37 insertions, 6 deletions
diff --git a/muse/ChangeLog b/muse/ChangeLog index 7cc6eff4..a5cd7d5e 100644 --- a/muse/ChangeLog +++ b/muse/ChangeLog @@ -1,3 +1,6 @@ +09.10.2010 + * Fixed: Gluing of midi track parts, over tempo changes, caused incorrect note times and lengths. (T356) + - Fixed Song::cmdGluePart(). 08.10.2010 * Disabled: Precount does not work, disabled function in gui (rj) ======================================= diff --git a/muse/muse/part.cpp b/muse/muse/part.cpp index c9a6308c..250cf3ea 100644 --- a/muse/muse/part.cpp +++ b/muse/muse/part.cpp @@ -1319,6 +1319,10 @@ void Song::changePart(Part* oPart, Part* nPart) void Song::cmdGluePart(Track* track, Part* oPart) { + // p3.3.54 + if(track->type() != Track::WAVE && !track->isMidiTrack()) + return; + PartList* pl = track->parts(); Part* nextPart = 0; @@ -1344,12 +1348,36 @@ void Song::cmdGluePart(Track* track, Part* oPart) dl->add(ie->second); EventList* sl2 = nextPart->events(); - int frameOffset = nextPart->frame() - oPart->frame(); - for (iEvent ie = sl2->begin(); ie != sl2->end(); ++ie) { - Event event = ie->second.clone(); - event.setFrame(event.frame() + frameOffset); - dl->add(event); - } + + //int frameOffset = nextPart->frame() - oPart->frame(); + //for (iEvent ie = sl2->begin(); ie != sl2->end(); ++ie) { + // Event event = ie->second.clone(); + // event.setFrame(event.frame() + frameOffset); + // dl->add(event); + // } + // p3.3.54 Changed. + if(track->type() == Track::WAVE) + { + int frameOffset = nextPart->frame() - oPart->frame(); + for (iEvent ie = sl2->begin(); ie != sl2->end(); ++ie) + { + Event event = ie->second.clone(); + event.setFrame(event.frame() + frameOffset); + dl->add(event); + } + } + else + if(track->isMidiTrack()) + { + int tickOffset = nextPart->tick() - oPart->tick(); + for (iEvent ie = sl2->begin(); ie != sl2->end(); ++ie) + { + Event event = ie->second.clone(); + event.setTick(event.tick() + tickOffset); + dl->add(event); + } + } + startUndo(); audio->msgRemovePart(nextPart, false); // Indicate no undo, and do port controller values but not clone parts. |