From 8125ea590986a3301f91b44aafeebd784c2ee6b4 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 5 Jun 2016 19:49:51 -0400 Subject: tweak API of Selectable --- gtk2_ardour/audio_time_axis.cc | 2 +- gtk2_ardour/automation_line.cc | 6 +++--- gtk2_ardour/editor_selection.cc | 2 +- gtk2_ardour/midi_time_axis.cc | 2 +- gtk2_ardour/selectable.h | 4 +++- gtk2_ardour/selection.cc | 6 +++--- gtk2_ardour/streamview.cc | 4 ++-- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc index ead0b8ffb1..6a9a32eac5 100644 --- a/gtk2_ardour/audio_time_axis.cc +++ b/gtk2_ardour/audio_time_axis.cc @@ -307,7 +307,7 @@ AudioTimeAxisView::update_control_names () } } - if (get_selected()) { + if (selected()) { controls_ebox.set_name (controls_base_selected_name); time_axis_frame.set_name (controls_base_selected_name); } else { diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index cf7e10dd8a..5d3f0782e8 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -171,7 +171,7 @@ AutomationLine::update_visibility () } } else if (_visible & SelectedControlPoints) { for (vector::iterator i = control_points.begin(); i != control_points.end(); ++i) { - if ((*i)->get_selected()) { + if ((*i)->selected()) { (*i)->show (); } else { (*i)->hide (); @@ -470,9 +470,9 @@ AutomationLine::start_drag_single (ControlPoint* cp, double x, float fraction) _drag_points.clear (); _drag_points.push_back (cp); - if (cp->get_selected ()) { + if (cp->selected ()) { for (vector::iterator i = control_points.begin(); i != control_points.end(); ++i) { - if (*i != cp && (*i)->get_selected()) { + if (*i != cp && (*i)->selected()) { _drag_points.push_back (*i); } } diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index ede87169e8..639e87a848 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -1566,7 +1566,7 @@ Editor::select_all_within (framepos_t start, framepos_t end, double top, double if (preserve_if_selected && op != Selection::Toggle) { list::iterator i = found.begin(); - while (i != found.end() && (*i)->get_selected()) { + while (i != found.end() && (*i)->selected()) { ++i; } diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index 34c1254c54..9f68aa5e55 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -1301,7 +1301,7 @@ MidiTimeAxisView::update_control_names () } } - if (get_selected()) { + if (selected()) { controls_ebox.set_name (controls_base_selected_name); time_axis_frame.set_name (controls_base_selected_name); } else { diff --git a/gtk2_ardour/selectable.h b/gtk2_ardour/selectable.h index 2d31dbf62b..c22a1b54f6 100644 --- a/gtk2_ardour/selectable.h +++ b/gtk2_ardour/selectable.h @@ -37,10 +37,12 @@ class Selectable : public virtual sigc::trackable } } - bool get_selected() const { + virtual bool selected() const { return _selected; } + virtual void show_selected() {} + protected: bool _selected; }; diff --git a/gtk2_ardour/selection.cc b/gtk2_ardour/selection.cc index 2e5b8b84e0..fefca3d1ec 100644 --- a/gtk2_ardour/selection.cc +++ b/gtk2_ardour/selection.cc @@ -951,7 +951,7 @@ Selection::selected (ArdourMarker* m) bool Selection::selected (TimeAxisView* tv) { - return tv->get_selected (); + return tv->selected (); } bool @@ -997,7 +997,7 @@ Selection::toggle (ControlPoint* cp) clear_time(); //enforce region/object exclusivity clear_tracks(); //enforce object/track exclusivity - cp->set_selected (!cp->get_selected ()); + cp->set_selected (!cp->selected ()); PointSelection::iterator i = find (points.begin(), points.end(), cp); if (i == points.end()) { points.push_back (cp); @@ -1147,7 +1147,7 @@ Selection::set (ControlPoint* cp) clear_time (); //enforce region/object exclusivity clear_tracks(); //enforce object/track exclusivity - if (cp->get_selected () && points.size () == 1) { + if (cp->selected () && points.size () == 1) { return; } diff --git a/gtk2_ardour/streamview.cc b/gtk2_ardour/streamview.cc index bf14eaf2e2..be4b3949df 100644 --- a/gtk2_ardour/streamview.cc +++ b/gtk2_ardour/streamview.cc @@ -499,7 +499,7 @@ StreamView::num_selected_regionviews () const uint32_t cnt = 0; for (list::const_iterator i = region_views.begin(); i != region_views.end(); ++i) { - if ((*i)->get_selected()) { + if ((*i)->selected()) { ++cnt; } } @@ -518,7 +518,7 @@ void StreamView::foreach_selected_regionview (sigc::slot slot) { for (list::iterator i = region_views.begin(); i != region_views.end(); ++i) { - if ((*i)->get_selected()) { + if ((*i)->selected()) { slot (*i); } } -- cgit v1.2.3