diff options
author | nick_m <mainsbridge@gmail.com> | 2017-02-07 03:10:02 +1100 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2017-02-07 03:10:02 +1100 |
commit | b24dd49c1a3b9b191670bd029af0a5364fc8d088 (patch) | |
tree | 084e0292314d276e4f388f428b9efeaa74a094bc /gtk2_ardour/midi_region_view.cc | |
parent | 7a1404ff8b0b2911a9bc4958925d43e97744eabb (diff) |
update note length when dragging notes (over tempo change)
Diffstat (limited to 'gtk2_ardour/midi_region_view.cc')
-rw-r--r-- | gtk2_ardour/midi_region_view.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index d36121a55b..b495fe5c64 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -2582,6 +2582,15 @@ MidiRegionView::move_selection(double dx_qn, double dy, double cumulative_dy) - n->item()->item_to_canvas (ArdourCanvas::Duple (n->x0(), 0)).x; (*i)->move_event(dx, dy); + + /* update length */ + if (midi_view()->note_mode() == Sustained) { + Note* sus = dynamic_cast<Note*> (*i); + double const len_dx = editor->sample_to_pixel_unrounded ( + tmap.frame_at_quarter_note (note_time_qn + dx_qn + n->note()->length().to_double())); + + sus->set_x1 (n->item()->canvas_to_item (ArdourCanvas::Duple (len_dx, 0)).x); + } } if (dy && !_selection.empty() && !_no_sound_notes && UIConfiguration::instance().get_sound_midi_notes()) { @@ -2660,6 +2669,14 @@ MidiRegionView::move_copies (double dx_qn, double dy, double cumulative_dy) - n->item()->item_to_canvas (ArdourCanvas::Duple (n->x0(), 0)).x; (*i)->move_event(dx, dy); + + if (midi_view()->note_mode() == Sustained) { + Note* sus = dynamic_cast<Note*> (*i); + double const len_dx = editor->sample_to_pixel_unrounded ( + tmap.frame_at_quarter_note (note_time_qn + dx_qn + n->note()->length().to_double())); + + sus->set_x1 (n->item()->canvas_to_item (ArdourCanvas::Duple (len_dx, 0)).x); + } } if (dy && !_copy_drag_events.empty() && !_no_sound_notes && UIConfiguration::instance().get_sound_midi_notes()) { |