Clean up drag modifiers.
Button 2 drag now is constrained to initial move axis, removing all modifiers from this op. Remove Jump after trim mode. TrimDrag now has: Primary for trim anchored to fade. Secondary for contents trim (as before) Primary & Tertiary for "non overlap" trim All drags have Tertiary for relative snap
This commit is contained in:
parent
c359f881a1
commit
a0bd6975d2
@ -251,18 +251,9 @@ Drag::start_grab (GdkEvent* event, Gdk::Cursor *cursor)
|
||||
{
|
||||
// if dragging with button2, the motion is x constrained, with Alt-button2 it is y constrained
|
||||
|
||||
if (Keyboard::is_button2_event (&event->button)) {
|
||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::SecondaryModifier)) {
|
||||
_y_constrained = true;
|
||||
_x_constrained = false;
|
||||
} else {
|
||||
_y_constrained = false;
|
||||
_x_constrained = true;
|
||||
}
|
||||
} else {
|
||||
_x_constrained = false;
|
||||
_y_constrained = false;
|
||||
}
|
||||
/* we set up x/y dragging constraints on first move */
|
||||
_x_constrained = false;
|
||||
_y_constrained = false;
|
||||
|
||||
_raw_grab_frame = _editor->canvas_event_sample (event, &_grab_x, &_grab_y);
|
||||
|
||||
@ -410,8 +401,16 @@ Drag::motion_handler (GdkEvent* event, bool from_autoscroll)
|
||||
/* just changed */
|
||||
|
||||
if (fabs (current_pointer_y() - _grab_y) > fabs (current_pointer_x() - _grab_x)) {
|
||||
if (event->motion.state & Gdk::BUTTON2_MASK) {
|
||||
_x_constrained = true;
|
||||
_y_constrained = false;
|
||||
}
|
||||
_initially_vertical = true;
|
||||
} else {
|
||||
if (event->motion.state & Gdk::BUTTON2_MASK) {
|
||||
_x_constrained = false;
|
||||
_y_constrained = true;
|
||||
}
|
||||
_initially_vertical = false;
|
||||
}
|
||||
}
|
||||
@ -575,7 +574,6 @@ RegionMotionDrag::RegionMotionDrag (Editor* e, ArdourCanvas::Item* i, RegionView
|
||||
, _total_x_delta (0)
|
||||
, _last_pointer_time_axis_view (0)
|
||||
, _last_pointer_layer (0)
|
||||
, _single_axis (false)
|
||||
, _ndropzone (0)
|
||||
, _pdropzone (0)
|
||||
, _ddropzone (0)
|
||||
@ -589,10 +587,6 @@ RegionMotionDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
|
||||
Drag::start_grab (event, cursor);
|
||||
setup_snap_delta (_last_frame_position);
|
||||
|
||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::ModifierMask (Keyboard::PrimaryModifier | Keyboard::TertiaryModifier))) {
|
||||
_single_axis = true;
|
||||
}
|
||||
|
||||
show_verbose_cursor_time (_last_frame_position);
|
||||
|
||||
pair<TimeAxisView*, double> const tv = _editor->trackview_by_y_position (current_pointer_y ());
|
||||
@ -771,18 +765,6 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move)
|
||||
|
||||
assert (!_views.empty ());
|
||||
|
||||
if (first_move) {
|
||||
if (_single_axis) {
|
||||
if (initially_vertical()) {
|
||||
_y_constrained = false;
|
||||
_x_constrained = true;
|
||||
} else {
|
||||
_y_constrained = true;
|
||||
_x_constrained = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Note: time axis views in this method are often expressed as an index into the _time_axis_views vector */
|
||||
|
||||
/* Find the TimeAxisView that the pointer is now over */
|
||||
@ -2610,7 +2592,6 @@ VideoTimeLineDrag::aborted (bool)
|
||||
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");
|
||||
}
|
||||
@ -2633,7 +2614,7 @@ TrimDrag::start_grab (GdkEvent* event, Gdk::Cursor*)
|
||||
framepos_t const pf = adjusted_current_frame (event);
|
||||
setup_snap_delta (region_start);
|
||||
|
||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)) {
|
||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::SecondaryModifier)) {
|
||||
/* Move the contents of the region around without changing the region bounds */
|
||||
_operation = ContentsTrim;
|
||||
Drag::start_grab (event, _editor->cursors()->trimmer);
|
||||
@ -2642,7 +2623,7 @@ TrimDrag::start_grab (GdkEvent* event, Gdk::Cursor*)
|
||||
if (pf < (region_start + region_length/2)) {
|
||||
/* closer to front */
|
||||
_operation = StartTrim;
|
||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::ModifierMask (Keyboard::PrimaryModifier | Keyboard::TertiaryModifier))) {
|
||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)) {
|
||||
Drag::start_grab (event, _editor->cursors()->anchored_left_side_trim);
|
||||
} else {
|
||||
Drag::start_grab (event, _editor->cursors()->left_side_trim);
|
||||
@ -2650,17 +2631,13 @@ TrimDrag::start_grab (GdkEvent* event, Gdk::Cursor*)
|
||||
} else {
|
||||
/* closer to end */
|
||||
_operation = EndTrim;
|
||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::ModifierMask (Keyboard::PrimaryModifier | Keyboard::TertiaryModifier))) {
|
||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)) {
|
||||
Drag::start_grab (event, _editor->cursors()->anchored_right_side_trim);
|
||||
} else {
|
||||
Drag::start_grab (event, _editor->cursors()->right_side_trim);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* XXX this "feature" gives the user no clue as to what is going to happen. */
|
||||
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::ModifierMask (Keyboard::PrimaryModifier | Keyboard::TertiaryModifier))) {
|
||||
_jump_position_when_done = true;
|
||||
}
|
||||
|
||||
switch (_operation) {
|
||||
case StartTrim:
|
||||
@ -2861,9 +2838,6 @@ TrimDrag::finished (GdkEvent* event, bool movement_occurred)
|
||||
ar->set_fade_in_active(true);
|
||||
}
|
||||
}
|
||||
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) {
|
||||
@ -2876,9 +2850,6 @@ TrimDrag::finished (GdkEvent* event, bool movement_occurred)
|
||||
ar->set_fade_out_active(true);
|
||||
}
|
||||
}
|
||||
if (_jump_position_when_done) {
|
||||
i->view->region()->set_position (i->initial_end - i->view->region()->length());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -345,8 +345,6 @@ protected:
|
||||
double _total_x_delta;
|
||||
int _last_pointer_time_axis_view;
|
||||
double _last_pointer_layer;
|
||||
bool _single_axis;
|
||||
|
||||
private:
|
||||
uint32_t _ndropzone;
|
||||
uint32_t _pdropzone;
|
||||
@ -656,7 +654,6 @@ private:
|
||||
Operation _operation;
|
||||
|
||||
bool _preserve_fade_anchor;
|
||||
bool _jump_position_when_done;
|
||||
};
|
||||
|
||||
/** Meter marker drag */
|
||||
|
Loading…
Reference in New Issue
Block a user