- cerr << "Done with TV, top = " << to_playlist << " from = " << from_playlist << endl;
-
- if (to_playlist) {
- sdc.push_back (new StatefulDiffCommand (to_playlist));
- cerr << "Saved diff for to:" << to_playlist->name() << endl;
- }
-
- if (from_playlist && (from_playlist != to_playlist)) {
- sdc.push_back (new StatefulDiffCommand (from_playlist));
- cerr << "Saved diff for from:" << from_playlist->name() << endl;
- }
- }
-
- /*
- if we've created new regions either by copying or moving
- to a new track, we want to replace the old selection with the new ones
- */
-
- if (new_views.size() > 0) {
- _editor->selection->set (new_views);
- }
-
- for (set<boost::shared_ptr<Playlist> >::iterator p = frozen_playlists.begin(); p != frozen_playlists.end(); ++p) {
- (*p)->thaw();
- }
-
- out:
- for (vector<StatefulDiffCommand*>::iterator i = sdc.begin(); i != sdc.end(); ++i) {
- _editor->session()->add_command (*i);
- }
-
- _editor->commit_reversible_command ();
-
- for (vector<RegionView*>::iterator x = copies.begin(); x != copies.end(); ++x) {
- delete *x;
- }
-}
-
-void
-RegionMoveDrag::aborted ()
-{
- if (_copy) {
-
- for (list<DraggingView>::const_iterator i = _views.begin(); i != _views.end(); ++i) {
- delete i->view;
- }
-
- _views.clear ();
-
- } else {
- RegionMotionDrag::aborted ();
- }
-}
-
-void
-RegionMotionDrag::aborted ()
-{
- for (list<DraggingView>::const_iterator i = _views.begin(); i != _views.end(); ++i) {
- RegionView* rv = i->view;
- TimeAxisView* tv = &(rv->get_time_axis_view ());
- RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (tv);
- assert (rtv);
- rv->get_canvas_group()->reparent (*rtv->view()->canvas_item());
- rv->get_canvas_group()->property_y() = 0;
- rv->get_time_axis_view().reveal_dependent_views (*rv);
- rv->fake_set_opaque (false);
- rv->move (-_total_x_delta, 0);
- rv->set_height (rtv->view()->child_height ());
- }
-
- _editor->update_canvas_now ();
-}
-
-
-bool
-RegionMotionDrag::x_move_allowed () const
-{
- if (Config->get_edit_mode() == Lock) {
- /* in locked edit mode, reverse the usual meaning of _x_constrained */
- return _x_constrained;
- }
-
- return !_x_constrained;
-}
-
-void
-RegionMotionDrag::copy_regions (GdkEvent* event)
-{
- /* duplicate the regionview(s) and region(s) */