diff options
author | nick_m <mainsbridge@gmail.com> | 2016-12-23 05:07:22 +1100 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-12-23 05:07:22 +1100 |
commit | ddd085cf4e4e626d4622e9ac42cc3096707905d8 (patch) | |
tree | 338713cecdadd2cafec5d2011b0fcd4ad901dd4e /gtk2_ardour/midi_region_view.cc | |
parent | 37e858da7dbf645900a596c765ff4d58b8b6df3d (diff) |
hide ghost events appropriately (e.g. after split).
Diffstat (limited to 'gtk2_ardour/midi_region_view.cc')
-rw-r--r-- | gtk2_ardour/midi_region_view.cc | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 1b1dada479..1a2a255a29 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -1248,7 +1248,7 @@ MidiRegionView::redisplay_model() for (std::vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) { MidiGhostRegion* gr = dynamic_cast<MidiGhostRegion*> (*i); if (gr && gr->trackview.y_position() != -1) { - gr->update_note (sus); + gr->update_note (sus, !update); } } } else if ((hit = dynamic_cast<Hit*>(cne))) { @@ -1260,7 +1260,7 @@ MidiRegionView::redisplay_model() for (std::vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) { MidiGhostRegion* gr = dynamic_cast<MidiGhostRegion*> (*i); if (gr && gr->trackview.y_position() != -1) { - gr->update_hit (hit); + gr->update_hit (hit, !update); } } } @@ -1272,21 +1272,23 @@ MidiRegionView::redisplay_model() for (MidiModel::Notes::iterator n = missing_notes.begin(); n != missing_notes.end(); ++n) { boost::shared_ptr<NoteType> note (*n); - NoteBase* cne = add_note (note, true); + NoteBase* cne; bool visible; - for (set<Evoral::event_id_t>::iterator it = _pending_note_selection.begin(); it != _pending_note_selection.end(); ++it) { - if ((*it) == note->id()) { - add_to_selection (cne); + if (note_in_region_range (note, visible)) { + if (visible) { + cne = add_note (note, true); + } else { + cne = add_note (note, false); } + } else { + cne = add_note (note, false); } - if (note_in_region_range (note, visible)) { - if (!visible) { - cne->hide (); + for (set<Evoral::event_id_t>::iterator it = _pending_note_selection.begin(); it != _pending_note_selection.end(); ++it) { + if ((*it) == note->id()) { + add_to_selection (cne); } - } else { - cne->hide (); } } @@ -1547,13 +1549,14 @@ MidiRegionView::add_ghost (TimeAxisView& tv) ghost = new MidiGhostRegion (*this, tv, trackview, unit_position); } + ghost->set_colors (); + ghost->set_height (); + ghost->set_duration (_region->length() / samples_per_pixel); + for (Events::iterator i = _events.begin(); i != _events.end(); ++i) { ghost->add_note(*i); } - ghost->set_colors (); - ghost->set_height (); - ghost->set_duration (_region->length() / samples_per_pixel); ghosts.push_back (ghost); return ghost; |