+ /* get all lines in the automation view */
+ list<boost::shared_ptr<AutomationLine> > lines = _atav->lines ();
+
+ /* find those that overlap the ranges being dragged */
+ list<boost::shared_ptr<AutomationLine> >::iterator i = lines.begin ();
+ while (i != lines.end ()) {
+ list<boost::shared_ptr<AutomationLine> >::iterator j = i;
+ ++j;
+
+ pair<framepos_t, framepos_t> const r = (*i)->get_point_x_range ();
+
+ /* check this range against all the AudioRanges that we are using */
+ list<AudioRange>::const_iterator k = _ranges.begin ();
+ while (k != _ranges.end()) {
+ if (k->coverage (r.first, r.second) != OverlapNone) {
+ break;
+ }
+ ++k;
+ }
+
+ /* add it to our list if it overlaps at all */
+ if (k != _ranges.end()) {
+ Line n;
+ n.line = *i;
+ n.state = 0;
+ n.range = r;
+ _lines.push_back (n);
+ }
+
+ i = j;
+ }
+
+ /* Now ::lines contains the AutomationLines that somehow overlap our drag */