-}
-
-RegionMotionDrag::TimeAxisViewSummary
-RegionMotionDrag::get_time_axis_view_summary ()
-{
- int32_t children = 0;
- TimeAxisViewSummary sum;
-
- _editor->visible_order_range (&sum.visible_y_low, &sum.visible_y_high);
-
- /* get a bitmask representing the visible tracks */
-
- for (TrackViewList::iterator i = _editor->track_views.begin(); i != _editor->track_views.end(); ++i) {
- RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (*i);
- TimeAxisView::Children children_list;
-
- /* zeroes are audio/MIDI tracks. ones are other types. */
-
- if (!rtv->hidden()) {
-
- if (!rtv->is_track()) {
- /* not an audio nor MIDI track */
- sum.tracks = sum.tracks |= (0x01 << rtv->order());
- }
-
- sum.height_list[rtv->order()] = (*i)->current_height();
- children = 1;
-
- if ((children_list = rtv->get_child_list()).size() > 0) {
- for (TimeAxisView::Children::iterator j = children_list.begin(); j != children_list.end(); ++j) {
- sum.tracks = sum.tracks |= (0x01 << (rtv->order() + children));
- sum.height_list[rtv->order() + children] = (*j)->current_height();
- children++;
- }
- }
- }
- }
-
- return sum;
-}
-
-bool
-RegionMotionDrag::compute_y_delta (
- TimeAxisView const * last_pointer_view, TimeAxisView* current_pointer_view,
- int32_t last_pointer_layer, int32_t current_pointer_layer,
- TimeAxisViewSummary const & tavs,
- int32_t* pointer_order_span, int32_t* pointer_layer_span,
- int32_t* canvas_pointer_order_span
- )
-{
- if (_brushing) {
- *pointer_order_span = 0;
- *pointer_layer_span = 0;
- return true;
- }
-
- bool clamp_y_axis = false;
-
- /* the change in track order between this callback and the last */
- *pointer_order_span = last_pointer_view->order() - current_pointer_view->order();
- /* the change in layer between this callback and the last;
- only meaningful if pointer_order_span == 0 (ie we've not moved tracks) */
- *pointer_layer_span = last_pointer_layer - current_pointer_layer;
-
- if (*pointer_order_span != 0) {
-
- /* find the actual pointer span, in terms of the number of visible tracks;
- to do this, we reduce |pointer_order_span| by the number of hidden tracks
- over the span */
-
- *canvas_pointer_order_span = *pointer_order_span;
- if (last_pointer_view->order() >= current_pointer_view->order()) {
- for (int32_t y = current_pointer_view->order(); y < last_pointer_view->order(); y++) {
- if (tavs.height_list[y] == 0) {
- *canvas_pointer_order_span--;
- }
- }
- } else {
- for (int32_t y = last_pointer_view->order(); y <= current_pointer_view->order(); y++) {
- if (tavs.height_list[y] == 0) {
- *canvas_pointer_order_span++;
- }
- }
- }
-
- for (list<DraggingView>::const_iterator i = _views.begin(); i != _views.end(); ++i) {
-
- RegionView* rv = i->view;
-
- if (rv->region()->locked()) {
- continue;
- }
-
- double ix1, ix2, iy1, iy2;
- rv->get_canvas_frame()->get_bounds (ix1, iy1, ix2, iy2);
- rv->get_canvas_frame()->i2w (ix1, iy1);
- iy1 += _editor->vertical_adjustment.get_value() - _editor->canvas_timebars_vsize;
-
- /* get the new trackview for this particular region */
- pair<TimeAxisView*, int> const tvp = _editor->trackview_by_y_position (iy1);
- assert (tvp.first);
- RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (tvp.first);
-
- /* XXX: not sure that we should be passing canvas_pointer_order_span in here,
- as surely this is a per-region thing... */