diff options
author | Ben Loftis <ben@harrisonconsoles.com> | 2015-01-09 12:20:02 -0600 |
---|---|---|
committer | Ben Loftis <ben@harrisonconsoles.com> | 2015-01-09 12:21:10 -0600 |
commit | 9e0cd98ad4fc84e56640ea9a466d3fd0dbccef04 (patch) | |
tree | a6a684b8bd30f6874f0e259941678836e560955a /gtk2_ardour | |
parent | a6e45a471a2af53a58ad28e769b232075cabab92 (diff) |
fix select-all-regions-within (it used to select everything overlapped)
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/automation_streamview.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/automation_streamview.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/automation_time_axis.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/automation_time_axis.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/editor_selection.cc | 4 | ||||
-rw-r--r-- | gtk2_ardour/route_time_axis.cc | 6 | ||||
-rw-r--r-- | gtk2_ardour/route_time_axis.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/streamview.cc | 15 | ||||
-rw-r--r-- | gtk2_ardour/streamview.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/time_axis_view.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/time_axis_view.h | 2 |
11 files changed, 24 insertions, 17 deletions
diff --git a/gtk2_ardour/automation_streamview.cc b/gtk2_ardour/automation_streamview.cc index 9b68c55d23..7eaec7cae4 100644 --- a/gtk2_ardour/automation_streamview.cc +++ b/gtk2_ardour/automation_streamview.cc @@ -284,7 +284,7 @@ AutomationStreamView::clear () * confusing. */ void -AutomationStreamView::get_selectables (framepos_t start, framepos_t end, double botfrac, double topfrac, list<Selectable*>& results) +AutomationStreamView::get_selectables (framepos_t start, framepos_t end, double botfrac, double topfrac, list<Selectable*>& results, bool /*within*/) { for (list<RegionView*>::iterator i = region_views.begin(); i != region_views.end(); ++i) { AutomationRegionView* arv = dynamic_cast<AutomationRegionView*> (*i); diff --git a/gtk2_ardour/automation_streamview.h b/gtk2_ardour/automation_streamview.h index 082e3cc379..67f720dc5f 100644 --- a/gtk2_ardour/automation_streamview.h +++ b/gtk2_ardour/automation_streamview.h @@ -60,7 +60,7 @@ class AutomationStreamView : public StreamView void clear (); - void get_selectables (ARDOUR::framepos_t, ARDOUR::framepos_t, double, double, std::list<Selectable*> &); + void get_selectables (ARDOUR::framepos_t, ARDOUR::framepos_t, double, double, std::list<Selectable*> &, bool within = false); void set_selected_points (PointSelection &); std::list<boost::shared_ptr<AutomationLine> > get_lines () const; diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc index ff50c7bece..60552ce14e 100644 --- a/gtk2_ardour/automation_time_axis.cc +++ b/gtk2_ardour/automation_time_axis.cc @@ -693,7 +693,7 @@ AutomationTimeAxisView::paste_one (framepos_t pos, unsigned paste_count, float t } void -AutomationTimeAxisView::get_selectables (framepos_t start, framepos_t end, double top, double bot, list<Selectable*>& results) +AutomationTimeAxisView::get_selectables (framepos_t start, framepos_t end, double top, double bot, list<Selectable*>& results, bool /*within*/) { if (!_line && !_view) { return; diff --git a/gtk2_ardour/automation_time_axis.h b/gtk2_ardour/automation_time_axis.h index b726de6440..53928724d8 100644 --- a/gtk2_ardour/automation_time_axis.h +++ b/gtk2_ardour/automation_time_axis.h @@ -84,7 +84,7 @@ class AutomationTimeAxisView : public TimeAxisView { std::list<boost::shared_ptr<AutomationLine> > lines () const; void set_selected_points (PointSelection&); - void get_selectables (ARDOUR::framepos_t start, ARDOUR::framepos_t end, double top, double bot, std::list<Selectable *>&); + void get_selectables (ARDOUR::framepos_t start, ARDOUR::framepos_t end, double top, double bot, std::list<Selectable *>&, bool within = false); void get_inverted_selectables (Selection&, std::list<Selectable*>& results); void show_timestretch (framepos_t /*start*/, framepos_t /*end*/, int /*layers*/, int /*layer*/) {} diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 117459263c..60f8b0433b 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -1791,7 +1791,7 @@ Editor::select_all_selectables_using_edit (bool after) } void -Editor::select_all_selectables_between (bool /*within*/) +Editor::select_all_selectables_between (bool within) { framepos_t start; framepos_t end; @@ -1821,7 +1821,7 @@ Editor::select_all_selectables_between (bool /*within*/) if ((*iter)->hidden()) { continue; } - (*iter)->get_selectables (start, end, 0, DBL_MAX, touched); + (*iter)->get_selectables (start, end, 0, DBL_MAX, touched, within); } begin_reversible_selection_op(_("Select all Selectables Between")); diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index c54775d845..d2d4820308 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -1342,7 +1342,7 @@ RouteTimeAxisView::set_selected_regionviews (RegionSelection& regions) * @param results List to add things to. */ void -RouteTimeAxisView::get_selectables (framepos_t start, framepos_t end, double top, double bot, list<Selectable*>& results) +RouteTimeAxisView::get_selectables (framepos_t start, framepos_t end, double top, double bot, list<Selectable*>& results, bool within) { double speed = 1.0; @@ -1354,14 +1354,14 @@ RouteTimeAxisView::get_selectables (framepos_t start, framepos_t end, double top framepos_t const end_adjusted = session_frame_to_track_frame(end, speed); if ((_view && ((top < 0.0 && bot < 0.0))) || touched (top, bot)) { - _view->get_selectables (start_adjusted, end_adjusted, top, bot, results); + _view->get_selectables (start_adjusted, end_adjusted, top, bot, results, within); } /* pick up visible automation tracks */ for (Children::iterator i = children.begin(); i != children.end(); ++i) { if (!(*i)->hidden()) { - (*i)->get_selectables (start_adjusted, end_adjusted, top, bot, results); + (*i)->get_selectables (start_adjusted, end_adjusted, top, bot, results, within); } } } diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h index 7ea86e9b1b..3aedc4d336 100644 --- a/gtk2_ardour/route_time_axis.h +++ b/gtk2_ardour/route_time_axis.h @@ -90,7 +90,7 @@ public: void selection_click (GdkEventButton*); void set_selected_points (PointSelection&); void set_selected_regionviews (RegionSelection&); - void get_selectables (ARDOUR::framepos_t start, ARDOUR::framepos_t end, double top, double bot, std::list<Selectable *>&); + void get_selectables (ARDOUR::framepos_t start, ARDOUR::framepos_t end, double top, double bot, std::list<Selectable *>&, bool within = false); void get_inverted_selectables (Selection&, std::list<Selectable*>&); void set_layer_display (LayerDisplay d, bool apply_to_selection = false); LayerDisplay layer_display () const; diff --git a/gtk2_ardour/streamview.cc b/gtk2_ardour/streamview.cc index de94c70060..1d50a06a2e 100644 --- a/gtk2_ardour/streamview.cc +++ b/gtk2_ardour/streamview.cc @@ -548,7 +548,7 @@ StreamView::set_selected_regionviews (RegionSelection& regions) * @param result Filled in with selectable things. */ void -StreamView::get_selectables (framepos_t start, framepos_t end, double top, double bottom, list<Selectable*>& results) +StreamView::get_selectables (framepos_t start, framepos_t end, double top, double bottom, list<Selectable*>& results, bool within) { if (_trackview.editor().internal_editing()) { return; // Don't select regions with an internal tool @@ -584,10 +584,17 @@ StreamView::get_selectables (framepos_t start, framepos_t end, double top, doubl layer_t const l = (*i)->region()->layer (); layer_ok = (min_layer <= l && l <= max_layer); } - - if ((*i)->region()->coverage (start, end) != Evoral::OverlapNone && layer_ok) { - results.push_back (*i); + + if (within) { + if ((*i)->region()->coverage (start, end) == Evoral::OverlapExternal && layer_ok) { + results.push_back (*i); + } + } else { + if ((*i)->region()->coverage (start, end) != Evoral::OverlapNone && layer_ok) { + results.push_back (*i); + } } + } } diff --git a/gtk2_ardour/streamview.h b/gtk2_ardour/streamview.h index 73b1f0a420..0c3faf3b21 100644 --- a/gtk2_ardour/streamview.h +++ b/gtk2_ardour/streamview.h @@ -97,7 +97,7 @@ public: void foreach_selected_regionview (sigc::slot<void,RegionView*> slot); void set_selected_regionviews (RegionSelection&); - void get_selectables (ARDOUR::framepos_t, ARDOUR::framepos_t, double, double, std::list<Selectable* >&); + void get_selectables (ARDOUR::framepos_t, ARDOUR::framepos_t, double, double, std::list<Selectable* >&, bool within = false); void get_inverted_selectables (Selection&, std::list<Selectable* >& results); virtual void update_contents_metrics(boost::shared_ptr<ARDOUR::Region>) {} diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index 648d2521eb..3032d834bf 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -1088,7 +1088,7 @@ TimeAxisView::remove_child (boost::shared_ptr<TimeAxisView> child) * @param result Filled in with selectable things. */ void -TimeAxisView::get_selectables (framepos_t /*start*/, framepos_t /*end*/, double /*top*/, double /*bot*/, list<Selectable*>& /*result*/) +TimeAxisView::get_selectables (framepos_t /*start*/, framepos_t /*end*/, double /*top*/, double /*bot*/, list<Selectable*>& /*result*/, bool /*within*/) { return; } diff --git a/gtk2_ardour/time_axis_view.h b/gtk2_ardour/time_axis_view.h index 7935d4025d..6827251472 100644 --- a/gtk2_ardour/time_axis_view.h +++ b/gtk2_ardour/time_axis_view.h @@ -187,7 +187,7 @@ class TimeAxisView : public virtual AxisView void order_selection_trims (ArdourCanvas::Item *item, bool put_start_on_top); - virtual void get_selectables (ARDOUR::framepos_t, ARDOUR::framepos_t, double, double, std::list<Selectable*>&); + virtual void get_selectables (ARDOUR::framepos_t, ARDOUR::framepos_t, double, double, std::list<Selectable*>&, bool within = false); virtual void get_inverted_selectables (Selection&, std::list<Selectable *>& results); void add_ghost (RegionView*); |