if (event->motion.state & Gdk::BUTTON1_MASK || event->motion.state & Gdk::BUTTON2_MASK) {
if (!from_autoscroll) {
- bool const moving_left = _drags->current_pointer_x() < _last_pointer_x;
- bool const moving_up = _drags->current_pointer_y() < _last_pointer_y;
- _editor->maybe_autoscroll (true, allow_vertical_autoscroll (), moving_left, moving_up);
+ _editor->maybe_autoscroll (true, allow_vertical_autoscroll (), false);
}
- motion (event, _move_threshold_passed != old_move_threshold_passed);
-
- _last_pointer_x = _drags->current_pointer_x ();
- _last_pointer_y = _drags->current_pointer_y ();
- _last_pointer_frame = adjusted_current_frame (event);
+ if (!_editor->autoscroll_active() || from_autoscroll) {
+ motion (event, _move_threshold_passed != old_move_threshold_passed);
+
+ _last_pointer_x = _drags->current_pointer_x ();
+ _last_pointer_y = _drags->current_pointer_y ();
+ _last_pointer_frame = adjusted_current_frame (event);
+ }
return true;
}
} else {
+ boost::shared_ptr<Playlist> playlist = dest_rtv->playlist();
+
+ /* this movement may result in a crossfade being modified, or a layering change,
+ so we need to get undo data from the playlist as well as the region.
+ */
+
+ pair<PlaylistSet::iterator, bool> r = modified_playlists.insert (playlist);
+ if (r.second) {
+ playlist->clear_changes ();
+ }
+
rv->region()->clear_changes ();
/*
rv->drag_end ();
/* just change the model */
-
- boost::shared_ptr<Playlist> playlist = dest_rtv->playlist();
-
if (dest_rtv->view()->layer_display() == Stacked || dest_rtv->view()->layer_display() == Expanded) {
playlist->set_layer (rv->region(), dest_layer);
}
/* freeze playlist to avoid lots of relayering in the case of a multi-region drag */
- pair<PlaylistSet::iterator, bool> r = frozen_playlists.insert (playlist);
+ r = frozen_playlists.insert (playlist);
if (r.second) {
playlist->freeze ();
}
- /* this movement may result in a crossfade being modified, so we need to get undo
- data from the playlist as well as the region.
- */
-
- r = modified_playlists.insert (playlist);
- if (r.second) {
- playlist->clear_changes ();
- }
-
rv->region()->set_position (where);
_editor->session()->add_command (new StatefulDiffCommand (rv->region()));
TrimDrag::TrimDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p, list<RegionView*> const & v, bool preserve_fade_anchor)
: RegionDrag (e, i, p, v)
+ , _preserve_fade_anchor (preserve_fade_anchor)
+ , _jump_position_when_done (false)
{
DEBUG_TRACE (DEBUG::Drags, "New TrimDrag\n");
- _preserve_fade_anchor = preserve_fade_anchor;
}
void
}
}
+ if (Keyboard::modifier_state_equals (event->button.state, Keyboard::TertiaryModifier)) {
+ _jump_position_when_done = true;
+ }
+
switch (_operation) {
case StartTrim:
show_verbose_cursor_time (region_start);
case ContentsTrim:
{
- frame_delta = (adjusted_current_frame(event) - last_pointer_frame());
- // frame_delta = (last_pointer_frame() - adjusted_current_frame(event));
+ frame_delta = (last_pointer_frame() - adjusted_current_frame(event));
for (list<DraggingView>::const_iterator i = _views.begin(); i != _views.end(); ++i) {
i->view->move_contents (frame_delta);
ar->set_fade_in_length(new_length);
}
}
+ if (_jump_position_when_done) {
+ i->view->region()->set_position (i->initial_position);
+ }
}
} else if (_operation == EndTrim) {
for (list<DraggingView>::const_iterator i = _views.begin(); i != _views.end(); ++i) {
ar->set_fade_out_length(new_length);
}
}
+ if (_jump_position_when_done) {
+ i->view->region()->set_position (i->initial_end - i->view->region()->length());
+ }
}
}
break;
}
- if (event->button.x >= _editor->horizontal_position() + _editor->_visible_canvas_width) {
- _editor->start_canvas_autoscroll (1, 0);
- }
+ _editor->maybe_autoscroll (true, false, false);
if (start != end) {
switch (_operation) {
}
}
- if (event->button.x >= _editor->horizontal_position() + _editor->_visible_canvas_width) {
- _editor->start_canvas_autoscroll (1, 0);
- }
+ _editor->maybe_autoscroll (true, false, false);
if (start != end) {
_editor->temp_location->set (start, end);