diff options
author | David Robillard <d@drobilla.net> | 2014-12-06 23:42:11 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-12-06 23:42:11 -0500 |
commit | bfbb0f61782d7b79a8e67e66d8b483c00675a118 (patch) | |
tree | cb651a48d8f401083cead765646ef51cf8dc4a24 /gtk2_ardour/editor_ops.cc | |
parent | f4a30e1f607c285064daeea280dca209624be167 (diff) |
Add legatize and remove overlap MIDI operations.
We're going to need the ability to apply MIDI edit operations to a note/control
selection soon...
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 4d4176d421..b5ee683999 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -50,6 +50,7 @@ #include "ardour/playlist_factory.h" #include "ardour/profile.h" #include "ardour/quantize.h" +#include "ardour/legatize.h" #include "ardour/region_factory.h" #include "ardour/reverse.h" #include "ardour/session.h" @@ -4988,6 +4989,36 @@ Editor::quantize_region () } void +Editor::legatize_region (bool shrink_only) +{ + int selected_midi_region_cnt = 0; + + if (!_session) { + return; + } + + RegionSelection rs = get_regions_from_selection_and_entered (); + + if (rs.empty()) { + return; + } + + for (RegionSelection::iterator r = rs.begin(); r != rs.end(); ++r) { + MidiRegionView* const mrv = dynamic_cast<MidiRegionView*> (*r); + if (mrv) { + selected_midi_region_cnt++; + } + } + + if (selected_midi_region_cnt == 0) { + return; + } + + Legatize legatize(shrink_only); + apply_midi_note_edit_op (legatize); +} + +void Editor::insert_patch_change (bool from_context) { RegionSelection rs = get_regions_from_selection_and_entered (); |