mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-07 14:15:46 +01:00
Make drag selection work properly with stacked region mode.
git-svn-id: svn://localhost/ardour2/branches/3.0@5607 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
1aa38f074f
commit
7076f0e88e
3 changed files with 21 additions and 4 deletions
|
|
@ -1227,7 +1227,7 @@ RouteTimeAxisView::get_selectables (nframes_t start, nframes_t end, double top,
|
|||
nframes_t 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, results);
|
||||
_view->get_selectables (start_adjusted, end_adjusted, top, bot, results);
|
||||
}
|
||||
|
||||
/* pick up visible automation tracks */
|
||||
|
|
|
|||
|
|
@ -514,10 +514,27 @@ StreamView::set_selected_regionviews (RegionSelection& regions)
|
|||
}
|
||||
|
||||
void
|
||||
StreamView::get_selectables (nframes_t start, nframes_t end, list<Selectable*>& results)
|
||||
StreamView::get_selectables (nframes_t start, nframes_t end, double top, double bottom, list<Selectable*>& results)
|
||||
{
|
||||
layer_t min_layer = 0;
|
||||
layer_t max_layer = 0;
|
||||
|
||||
if (_layer_display == Stacked) {
|
||||
double const c = child_height ();
|
||||
min_layer = _layers - ((bottom - _trackview.y_position()) / c);
|
||||
max_layer = _layers - ((top - _trackview.y_position()) / c);
|
||||
}
|
||||
|
||||
for (list<RegionView*>::iterator i = region_views.begin(); i != region_views.end(); ++i) {
|
||||
if ((*i)->region()->coverage(start, end) != OverlapNone) {
|
||||
|
||||
bool layer_ok = true;
|
||||
|
||||
if (_layer_display == Stacked) {
|
||||
layer_t const l = (*i)->region()->layer ();
|
||||
layer_ok = (min_layer <= l && l <= max_layer);
|
||||
}
|
||||
|
||||
if ((*i)->region()->coverage (start, end) != OverlapNone && layer_ok) {
|
||||
results.push_back (*i);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ public:
|
|||
void foreach_regionview (sigc::slot<void,RegionView*> slot);
|
||||
|
||||
void set_selected_regionviews (RegionSelection&);
|
||||
void get_selectables (nframes_t start, nframes_t end, std::list<Selectable* >&);
|
||||
void get_selectables (nframes_t, nframes_t, double, double, std::list<Selectable* >&);
|
||||
void get_inverted_selectables (Selection&, std::list<Selectable* >& results);
|
||||
|
||||
virtual void update_contents_metrics(boost::shared_ptr<ARDOUR::Region>) {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue