lollis: show note selected status (using note selection outlien color)
This commit is contained in:
parent
8a204bcf51
commit
31de7e93bf
|
@ -126,6 +126,7 @@ public:
|
||||||
virtual void update_note (GhostEvent* note);
|
virtual void update_note (GhostEvent* note);
|
||||||
virtual void update_hit (GhostEvent* hit);
|
virtual void update_hit (GhostEvent* hit);
|
||||||
virtual void remove_note (NoteBase*);
|
virtual void remove_note (NoteBase*);
|
||||||
|
virtual void note_selected (NoteBase*) {}
|
||||||
|
|
||||||
void model_changed();
|
void model_changed();
|
||||||
void view_changed();
|
void view_changed();
|
||||||
|
|
|
@ -2245,9 +2245,10 @@ MidiRegionView::clear_selection_internal ()
|
||||||
{
|
{
|
||||||
DEBUG_TRACE(DEBUG::Selection, "MRV::clear_selection_internal\n");
|
DEBUG_TRACE(DEBUG::Selection, "MRV::clear_selection_internal\n");
|
||||||
|
|
||||||
for (Selection::iterator i = _selection.begin(); i != _selection.end(); ++i) {
|
for (auto & sel : _selection) {
|
||||||
(*i)->set_selected(false);
|
sel->set_selected(false);
|
||||||
(*i)->hide_velocity();
|
sel->hide_velocity();
|
||||||
|
sync_ghost_selection (sel);
|
||||||
}
|
}
|
||||||
_selection.clear();
|
_selection.clear();
|
||||||
}
|
}
|
||||||
|
@ -2586,6 +2587,8 @@ MidiRegionView::remove_from_selection (NoteBase* ev)
|
||||||
ev->set_selected (false);
|
ev->set_selected (false);
|
||||||
ev->hide_velocity ();
|
ev->hide_velocity ();
|
||||||
|
|
||||||
|
sync_ghost_selection (ev);
|
||||||
|
|
||||||
if (_selection.empty()) {
|
if (_selection.empty()) {
|
||||||
PublicEditor& editor (trackview.editor());
|
PublicEditor& editor (trackview.editor());
|
||||||
editor.get_selection().remove (this);
|
editor.get_selection().remove (this);
|
||||||
|
@ -2629,6 +2632,20 @@ MidiRegionView::add_to_selection (NoteBase* ev)
|
||||||
if (_selection.insert (ev).second == true) {
|
if (_selection.insert (ev).second == true) {
|
||||||
ev->set_selected (true);
|
ev->set_selected (true);
|
||||||
start_playing_midi_note ((ev)->note());
|
start_playing_midi_note ((ev)->note());
|
||||||
|
sync_ghost_selection (ev);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MidiRegionView::sync_ghost_selection (NoteBase* ev)
|
||||||
|
{
|
||||||
|
for (auto & ghost : ghosts) {
|
||||||
|
|
||||||
|
MidiGhostRegion* gr;
|
||||||
|
|
||||||
|
if ((gr = dynamic_cast<MidiGhostRegion*>(ghost)) != 0) {
|
||||||
|
gr->note_selected (ev);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4232,6 +4249,7 @@ MidiRegionView::maybe_select_by_position (GdkEventButton* ev, double /*x*/, doub
|
||||||
for (Events::iterator i = e.begin(); i != e.end(); ++i) {
|
for (Events::iterator i = e.begin(); i != e.end(); ++i) {
|
||||||
if (_selection.insert (i->second).second) {
|
if (_selection.insert (i->second).second) {
|
||||||
i->second->set_selected (true);
|
i->second->set_selected (true);
|
||||||
|
sync_ghost_selection (i->second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4251,6 +4269,7 @@ MidiRegionView::color_handler ()
|
||||||
|
|
||||||
for (Events::iterator i = _events.begin(); i != _events.end(); ++i) {
|
for (Events::iterator i = _events.begin(); i != _events.end(); ++i) {
|
||||||
i->second->set_selected (i->second->selected()); // will change color
|
i->second->set_selected (i->second->selected()); // will change color
|
||||||
|
sync_ghost_selection (i->second);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX probably more to do here */
|
/* XXX probably more to do here */
|
||||||
|
|
|
@ -580,6 +580,8 @@ public:
|
||||||
void update_sysexes ();
|
void update_sysexes ();
|
||||||
void view_changed ();
|
void view_changed ();
|
||||||
void model_changed ();
|
void model_changed ();
|
||||||
|
|
||||||
|
void sync_ghost_selection (NoteBase*);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -226,3 +226,17 @@ VelocityGhostRegion::y_position_to_velocity (double y) const
|
||||||
|
|
||||||
return velocity;
|
return velocity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
VelocityGhostRegion::note_selected (NoteBase* ev)
|
||||||
|
{
|
||||||
|
GhostEvent* gev = find_event (ev->note());
|
||||||
|
|
||||||
|
if (!gev) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ArdourCanvas::Lollipop* lolli = dynamic_cast<ArdourCanvas::Lollipop*> (gev->item);
|
||||||
|
lolli->set_outline_color (ev->selected() ? UIConfiguration::instance().color ("midi note selected outline") : 0x000000ff);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@ public:
|
||||||
void update_note (GhostEvent* note);
|
void update_note (GhostEvent* note);
|
||||||
void update_hit (GhostEvent* hit);
|
void update_hit (GhostEvent* hit);
|
||||||
void remove_note (NoteBase*);
|
void remove_note (NoteBase*);
|
||||||
|
void note_selected (NoteBase*);
|
||||||
|
|
||||||
void set_colors ();
|
void set_colors ();
|
||||||
void drag_lolli (ArdourCanvas::Lollipop* l, GdkEventMotion* ev);
|
void drag_lolli (ArdourCanvas::Lollipop* l, GdkEventMotion* ev);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user