diff options
author | David Robillard <d@drobilla.net> | 2014-12-28 21:31:33 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-12-28 21:31:33 -0500 |
commit | d283608fe9ece413838ddd7f530901e96c5bceda (patch) | |
tree | e6642806bcf7b3604e0937aa8a9f37d036e41c15 /gtk2_ardour/midi_region_view.cc | |
parent | 606efb601c15fa966a3b34cbda07b2d05be8c5b0 (diff) |
Automation ghost notes for percussive hits.
Diffstat (limited to 'gtk2_ardour/midi_region_view.cc')
-rw-r--r-- | gtk2_ardour/midi_region_view.cc | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 514d136920..097178a0e6 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -1456,8 +1456,6 @@ MidiRegionView::apply_note_range (uint8_t min, uint8_t max, bool force) GhostRegion* MidiRegionView::add_ghost (TimeAxisView& tv) { - Note* note; - double unit_position = _region->position () / samples_per_pixel; MidiTimeAxisView* mtv = dynamic_cast<MidiTimeAxisView*>(&tv); MidiGhostRegion* ghost; @@ -1472,9 +1470,7 @@ MidiRegionView::add_ghost (TimeAxisView& tv) } for (Events::iterator i = _events.begin(); i != _events.end(); ++i) { - if ((note = dynamic_cast<Note*>(*i)) != 0) { - ghost->add_note(note); - } + ghost->add_note(*i); } ghost->set_height (); @@ -1738,14 +1734,6 @@ MidiRegionView::add_note(const boost::shared_ptr<NoteType> note, bool visible) event = ev_rect; - MidiGhostRegion* gr; - - for (std::vector<GhostRegion*>::iterator g = ghosts.begin(); g != ghosts.end(); ++g) { - if ((gr = dynamic_cast<MidiGhostRegion*>(*g)) != 0) { - gr->add_note(ev_rect); - } - } - } else if (midi_view()->note_mode() == Percussive) { const double diamond_size = std::max(1., floor(midi_stream_view()->note_height()) - 2.); @@ -1761,6 +1749,14 @@ MidiRegionView::add_note(const boost::shared_ptr<NoteType> note, bool visible) } if (event) { + MidiGhostRegion* gr; + + for (std::vector<GhostRegion*>::iterator g = ghosts.begin(); g != ghosts.end(); ++g) { + if ((gr = dynamic_cast<MidiGhostRegion*>(*g)) != 0) { + gr->add_note(event); + } + } + if (_marked_for_selection.find(note) != _marked_for_selection.end()) { note_selected(event, true); } |