diff options
Diffstat (limited to 'muse2')
-rw-r--r-- | muse2/muse/midiedit/dcanvas.cpp | 12 | ||||
-rw-r--r-- | muse2/muse/midiedit/prcanvas.cpp | 15 | ||||
-rw-r--r-- | muse2/muse/midiedit/scoreedit.cpp | 7 |
3 files changed, 24 insertions, 10 deletions
diff --git a/muse2/muse/midiedit/dcanvas.cpp b/muse2/muse/midiedit/dcanvas.cpp index b9ff5a20..d0a5ee31 100644 --- a/muse2/muse/midiedit/dcanvas.cpp +++ b/muse2/muse/midiedit/dcanvas.cpp @@ -165,8 +165,6 @@ Undo DrumCanvas::moveCanvasItems(CItemList& items, int dp, int dx, DragType dtyp forbidden=true; break; } - - schedule_resize_all_same_len_clone_parts(opart, opart->lenTick() + diff, operations); } @@ -206,6 +204,14 @@ Undo DrumCanvas::moveCanvasItems(CItemList& items, int dp, int dx, DragType dtyp if(dtype == MOVE_COPY || dtype == MOVE_CLONE) selectItem(ci, false); } + + for(iPartToChange ip2c = parts2change.begin(); ip2c != parts2change.end(); ++ip2c) + { + Part* opart = ip2c->first; + int diff = ip2c->second.xdiff; + + schedule_resize_all_same_len_clone_parts(opart, opart->lenTick() + diff, operations); + } return operations; } @@ -354,7 +360,7 @@ void DrumCanvas::newItem(CItem* item, bool noSnap, bool replace) { schedule_resize_all_same_len_clone_parts(part, event.endTick(), operations); printf("newItem: extending\n"); - } + } } //else forbid action by not applying it song->applyOperationGroup(operations); diff --git a/muse2/muse/midiedit/prcanvas.cpp b/muse2/muse/midiedit/prcanvas.cpp index 73e70e84..5fb59099 100644 --- a/muse2/muse/midiedit/prcanvas.cpp +++ b/muse2/muse/midiedit/prcanvas.cpp @@ -321,8 +321,6 @@ Undo PianoCanvas::moveCanvasItems(CItemList& items, int dp, int dx, DragType dty forbidden=true; break; } - - schedule_resize_all_same_len_clone_parts(opart, opart->lenTick() + diff, operations); } @@ -362,6 +360,14 @@ Undo PianoCanvas::moveCanvasItems(CItemList& items, int dp, int dx, DragType dty if(dtype == MOVE_COPY || dtype == MOVE_CLONE) selectItem(ci, false); } + + for(iPartToChange ip2c = parts2change.begin(); ip2c != parts2change.end(); ++ip2c) + { + Part* opart = ip2c->first; + int diff = ip2c->second.xdiff; + + schedule_resize_all_same_len_clone_parts(opart, opart->lenTick() + diff, operations); + } return operations; } @@ -472,7 +478,7 @@ void PianoCanvas::newItem(CItem* item, bool noSnap) { schedule_resize_all_same_len_clone_parts(part, event.endTick(), operations); printf("newItem: extending\n"); - } + } song->applyOperationGroup(operations); } @@ -517,7 +523,8 @@ void PianoCanvas::resizeItem(CItem* item, bool noSnap, bool) // experime if (diff > 0)// part must be extended? { schedule_resize_all_same_len_clone_parts(part, event.tick()+len, operations); - printf("resizeItem: extending\n");} + printf("resizeItem: extending\n"); + } } //else forbid action by not performing it song->applyOperationGroup(operations); diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index d7131db9..0cb5428f 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -1682,7 +1682,8 @@ void staff_t::create_appropriate_eventlist() Event& event=it->second; if ( ( event.isNote() && !event.isNoteOff() && - (event.endTick() <= part->lenTick()) ) && + // (event.endTick() <= part->lenTick()) ) && + (event.tick() <= part->lenTick()) ) && // changed to accord to prcanvas.cpp and others (flo93) ( ((type==GRAND_TOP) && (event.pitch() >= SPLIT_NOTE)) || ((type==GRAND_BOTTOM) && (event.pitch() < SPLIT_NOTE)) || (type==NORMAL) ) ) @@ -3684,7 +3685,7 @@ void ScoreCanvas::mousePressEvent (QMouseEvent* event) " setting it to " << newevent.lenTick() << endl; } - if (newevent.endTick() > curr_part->lenTick()) + if (newevent.endTick() > curr_part->lenTick()) //FINDMICH EXTEND { if (debugMsg) cout << "clipping inserted note from len="<<newevent.endTick()<<" to len="<<(curr_part->lenTick() - newevent.tick())<<endl; newevent.setLenTick(curr_part->lenTick() - newevent.tick()); @@ -3935,7 +3936,7 @@ void ScoreCanvas::mouseMoveEvent (QMouseEvent* event) if (debugMsg) cout << "not setting len to a negative value. using 0 instead" << endl; } - if (tmp.endTick() > dragged_event_part->lenTick()) + if (tmp.endTick() > dragged_event_part->lenTick()) //FINDMICH EXTEND { tmp.setLenTick(dragged_event_part->lenTick() - tmp.tick()); if (debugMsg) cout << "resized note would exceed its part; limiting length to " << tmp.lenTick() << endl; |