mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
tweak API of Selectable
This commit is contained in:
parent
6adac60323
commit
8125ea5909
7 changed files with 14 additions and 12 deletions
|
|
@ -307,7 +307,7 @@ AudioTimeAxisView::update_control_names ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_selected()) {
|
if (selected()) {
|
||||||
controls_ebox.set_name (controls_base_selected_name);
|
controls_ebox.set_name (controls_base_selected_name);
|
||||||
time_axis_frame.set_name (controls_base_selected_name);
|
time_axis_frame.set_name (controls_base_selected_name);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,7 @@ AutomationLine::update_visibility ()
|
||||||
}
|
}
|
||||||
} else if (_visible & SelectedControlPoints) {
|
} else if (_visible & SelectedControlPoints) {
|
||||||
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
|
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
|
||||||
if ((*i)->get_selected()) {
|
if ((*i)->selected()) {
|
||||||
(*i)->show ();
|
(*i)->show ();
|
||||||
} else {
|
} else {
|
||||||
(*i)->hide ();
|
(*i)->hide ();
|
||||||
|
|
@ -470,9 +470,9 @@ AutomationLine::start_drag_single (ControlPoint* cp, double x, float fraction)
|
||||||
_drag_points.clear ();
|
_drag_points.clear ();
|
||||||
_drag_points.push_back (cp);
|
_drag_points.push_back (cp);
|
||||||
|
|
||||||
if (cp->get_selected ()) {
|
if (cp->selected ()) {
|
||||||
for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) {
|
for (vector<ControlPoint*>::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);
|
_drag_points.push_back (*i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1566,7 +1566,7 @@ Editor::select_all_within (framepos_t start, framepos_t end, double top, double
|
||||||
|
|
||||||
if (preserve_if_selected && op != Selection::Toggle) {
|
if (preserve_if_selected && op != Selection::Toggle) {
|
||||||
list<Selectable*>::iterator i = found.begin();
|
list<Selectable*>::iterator i = found.begin();
|
||||||
while (i != found.end() && (*i)->get_selected()) {
|
while (i != found.end() && (*i)->selected()) {
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1301,7 +1301,7 @@ MidiTimeAxisView::update_control_names ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_selected()) {
|
if (selected()) {
|
||||||
controls_ebox.set_name (controls_base_selected_name);
|
controls_ebox.set_name (controls_base_selected_name);
|
||||||
time_axis_frame.set_name (controls_base_selected_name);
|
time_axis_frame.set_name (controls_base_selected_name);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -37,10 +37,12 @@ class Selectable : public virtual sigc::trackable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get_selected() const {
|
virtual bool selected() const {
|
||||||
return _selected;
|
return _selected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void show_selected() {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool _selected;
|
bool _selected;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -951,7 +951,7 @@ Selection::selected (ArdourMarker* m)
|
||||||
bool
|
bool
|
||||||
Selection::selected (TimeAxisView* tv)
|
Selection::selected (TimeAxisView* tv)
|
||||||
{
|
{
|
||||||
return tv->get_selected ();
|
return tv->selected ();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
@ -997,7 +997,7 @@ Selection::toggle (ControlPoint* cp)
|
||||||
clear_time(); //enforce region/object exclusivity
|
clear_time(); //enforce region/object exclusivity
|
||||||
clear_tracks(); //enforce object/track 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);
|
PointSelection::iterator i = find (points.begin(), points.end(), cp);
|
||||||
if (i == points.end()) {
|
if (i == points.end()) {
|
||||||
points.push_back (cp);
|
points.push_back (cp);
|
||||||
|
|
@ -1147,7 +1147,7 @@ Selection::set (ControlPoint* cp)
|
||||||
clear_time (); //enforce region/object exclusivity
|
clear_time (); //enforce region/object exclusivity
|
||||||
clear_tracks(); //enforce object/track exclusivity
|
clear_tracks(); //enforce object/track exclusivity
|
||||||
|
|
||||||
if (cp->get_selected () && points.size () == 1) {
|
if (cp->selected () && points.size () == 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -499,7 +499,7 @@ StreamView::num_selected_regionviews () const
|
||||||
uint32_t cnt = 0;
|
uint32_t cnt = 0;
|
||||||
|
|
||||||
for (list<RegionView*>::const_iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
for (list<RegionView*>::const_iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
||||||
if ((*i)->get_selected()) {
|
if ((*i)->selected()) {
|
||||||
++cnt;
|
++cnt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -518,7 +518,7 @@ void
|
||||||
StreamView::foreach_selected_regionview (sigc::slot<void,RegionView*> slot)
|
StreamView::foreach_selected_regionview (sigc::slot<void,RegionView*> slot)
|
||||||
{
|
{
|
||||||
for (list<RegionView*>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
for (list<RegionView*>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
||||||
if ((*i)->get_selected()) {
|
if ((*i)->selected()) {
|
||||||
slot (*i);
|
slot (*i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue