{
switch (current_mouse_mode()) {
case MouseObject:
- if (next) set_mouse_mode (MouseRange);
- else set_mouse_mode (MouseTimeFX);
+ if (next) {
+ if (Profile->get_sae()) {
+ set_mouse_mode (MouseZoom);
+ } else {
+ set_mouse_mode (MouseRange);
+ }
+ } else {
+ set_mouse_mode (MouseTimeFX);
+ }
break;
case MouseRange:
break;
case MouseZoom:
- if (next) set_mouse_mode (MouseGain);
- else set_mouse_mode (MouseRange);
+ if (next) {
+ if (Profile->get_sae()) {
+ set_mouse_mode (MouseTimeFX);
+ } else {
+ set_mouse_mode (MouseGain);
+ }
+ } else {
+ if (Profile->get_sae()) {
+ set_mouse_mode (MouseObject);
+ } else {
+ set_mouse_mode (MouseRange);
+ }
+ }
break;
case MouseGain:
break;
case MouseTimeFX:
- if (next) set_mouse_mode (MouseAudition);
- else set_mouse_mode (MouseGain);
+ if (next) {
+ set_mouse_mode (MouseAudition);
+ } else {
+ if (Profile->get_sae()) {
+ set_mouse_mode (MouseZoom);
+ } else {
+ set_mouse_mode (MouseGain);
+ }
+ }
break;
case MouseAudition:
void
Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type)
{
- /* in object/audition/timefx mode, any button press sets
- the selection if the object can be selected. this is a
- bit of hack, because we want to avoid this if the
- mouse operation is a region alignment.
+ /* in object/audition/timefx/gain-automation mode,
+ any button press sets the selection if the object
+ can be selected. this is a bit of hack, because
+ we want to avoid this if the mouse operation is a
+ region alignment.
note: not dbl-click or triple-click
*/
if (((mouse_mode != MouseObject) &&
(mouse_mode != MouseAudition || item_type != RegionItem) &&
(mouse_mode != MouseTimeFX || item_type != RegionItem) &&
+ (mouse_mode != MouseGain) &&
(mouse_mode != MouseRange)) ||
((event->type != GDK_BUTTON_PRESS && event->type != GDK_BUTTON_RELEASE) || event->button.button > 3)) {
}
}
}
-
+
Selection::Operation op = Keyboard::selection_type (event->button.state);
bool press = (event->type == GDK_BUTTON_PRESS);
button_selection (item, event, item_type);
+ //ctrl-drag or right-click-drag on a "range" ruler should start a range drag
+ if (event->type == GDK_BUTTON_PRESS) {
+ if (event->button.button == 3 || ( (event->button.button == 1) && (Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier) ))) {
+ if (item_type == TransportMarkerBarItem) {
+ start_range_markerbar_op (item, event, CreateTransportMarker);
+ return true;
+ }
+ if (item_type == RangeMarkerBarItem) {
+ start_range_markerbar_op (item, event, CreateRangeMarker);
+ return true;
+ }
+ if (item_type == CdMarkerBarItem) {
+ start_range_markerbar_op (item, event, CreateCDMarker);
+ return true;
+ }
+ }
+ }
+
if (drag_info.item == 0 &&
(Keyboard::is_delete_event (&event->button) ||
Keyboard::is_context_menu_event (&event->button) ||
}
return true;
+ case MarkerBarItem:
case TempoBarItem:
- return true;
-
case MeterBarItem:
- return true;
-
+ case TransportMarkerBarItem:
case RangeMarkerBarItem:
- start_range_markerbar_op (item, event, CreateRangeMarker);
- return true;
- break;
-
case CdMarkerBarItem:
- start_range_markerbar_op (item, event, CreateCDMarker);
- return true;
- break;
-
- case TransportMarkerBarItem:
- start_range_markerbar_op (item, event, CreateTransportMarker);
+ if (!Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)) {
+ start_cursor_grab_no_stop(&playhead_cursor->canvas_item, event);
+ }
return true;
break;
case CdMarkerBarItem:
case TempoBarItem:
case MeterBarItem:
- popup_ruler_menu (pixel_to_frame(event->button.x), item_type);
+ popup_ruler_menu (where, item_type);
break;
case MarkerItem:
return true;
case MarkerBarItem:
- if (!Keyboard::modifier_state_contains (event->button.state, Keyboard::snap_modifier())) {
- snap_to (where, 0, true);
+ if (!_dragging_playhead) {
+ if (!Keyboard::modifier_state_contains (event->button.state, Keyboard::snap_modifier())) {
+ snap_to (where, 0, true);
+ }
+ mouse_add_new_marker (where);
}
- mouse_add_new_marker (where);
return true;
case CdMarkerBarItem:
- // if we get here then a dragged range wasn't done
- if (!Keyboard::modifier_state_contains (event->button.state, Keyboard::snap_modifier())) {
- snap_to (where, 0, true);
+ if (!_dragging_playhead) {
+ // if we get here then a dragged range wasn't done
+ if (!Keyboard::modifier_state_contains (event->button.state, Keyboard::snap_modifier())) {
+ snap_to (where, 0, true);
+ }
+ mouse_add_new_marker (where, true);
}
- mouse_add_new_marker (where, true);
return true;
case TempoBarItem:
- if (!Keyboard::modifier_state_contains (event->button.state, Keyboard::snap_modifier())) {
- snap_to (where);
+ if (!_dragging_playhead) {
+ if (!Keyboard::modifier_state_contains (event->button.state, Keyboard::snap_modifier())) {
+ snap_to (where);
+ }
+ mouse_add_new_tempo_event (where);
}
- mouse_add_new_tempo_event (where);
return true;
case MeterBarItem:
- mouse_add_new_meter_event (pixel_to_frame (event->button.x));
+ if (!_dragging_playhead) {
+ mouse_add_new_meter_event (pixel_to_frame (event->button.x));
+ }
return true;
break;
default:
break;
}
-
+
switch (mouse_mode) {
case MouseObject:
switch (item_type) {
switch (item_type) {
case PlayheadCursorItem:
case MarkerItem:
+ case MarkerBarItem:
+ case TempoBarItem:
+ case MeterBarItem:
case RangeMarkerBarItem:
case TransportMarkerBarItem:
case CdMarkerBarItem:
case MarkerViewHandleEndItem:
/* </CMT Additions> */
if (drag_info.item && (event->motion.state & Gdk::BUTTON1_MASK ||
+ (event->motion.state & Gdk::BUTTON3_MASK) ||
(event->motion.state & Gdk::BUTTON2_MASK))) {
if (!from_autoscroll) {
maybe_autoscroll_horizontally (&event->motion);
// if dragging with button2, the motion is x constrained, with Alt-button2 it is y constrained
- if (event->button.button == 2) {
+ if (Keyboard::is_button2_event (&event->button)) {
if (Keyboard::modifier_state_equals (event->button.state, Keyboard::SecondaryModifier)) {
drag_info.y_constrained = true;
drag_info.x_constrained = false;
return false;
}
- drag_info.item->ungrab (event->button.time);
+ drag_info.item->ungrab (event ? event->button.time : 0);
- if (drag_info.finished_callback) {
+ if (drag_info.finished_callback && event) {
drag_info.last_pointer_x = drag_info.current_pointer_x;
drag_info.last_pointer_y = drag_info.current_pointer_y;
(this->*(drag_info.finished_callback)) (item, event);
show_verbose_time_cursor (cursor->current_frame, 10);
}
+void
+Editor::start_cursor_grab_no_stop (ArdourCanvas::Item* item, GdkEvent* event)
+{
+ drag_info.item = item;
+ drag_info.motion_callback = &Editor::cursor_drag_motion_callback;
+ drag_info.finished_callback = &Editor::cursor_drag_finished_ensure_locate_callback;
+
+ start_grab (event);
+
+ if ((drag_info.data = (item->get_data ("cursor"))) == 0) {
+ fatal << _("programming error: cursor canvas item has no cursor data pointer!") << endmsg;
+ /*NOTREACHED*/
+ }
+
+ Cursor* cursor = (Cursor *) drag_info.data;
+ nframes64_t where = event_frame (event, 0, 0);
+
+ snap_to(where);
+ playhead_cursor->set_position (where);
+
+ if (cursor == playhead_cursor) {
+ _dragging_playhead = true;
+
+ if (session && session->is_auditioning()) {
+ session->cancel_audition ();
+ }
+ }
+
+ drag_info.pointer_frame_offset = drag_info.grab_frame - cursor->current_frame;
+
+ show_verbose_time_cursor (cursor->current_frame, 10);
+}
+
void
Editor::cursor_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
{
void
Editor::cursor_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event)
{
- if (drag_info.first_move) return;
+ _dragging_playhead = false;
+
+ if (drag_info.first_move) {
+ return;
+ }
cursor_drag_motion_callback (item, event);
+
+ if (item == &playhead_cursor->canvas_item) {
+ if (session) {
+ session->request_locate (playhead_cursor->current_frame, drag_info.was_rolling);
+ }
+ }
+}
+void
+Editor::cursor_drag_finished_ensure_locate_callback (ArdourCanvas::Item* item, GdkEvent* event)
+{
_dragging_playhead = false;
+ cursor_drag_motion_callback (item, event);
+
if (item == &playhead_cursor->canvas_item) {
if (session) {
session->request_locate (playhead_cursor->current_frame, drag_info.was_rolling);
abort();
}
- edit_point_clock.set (drag_info.copied_locations.front()->start());
+ if (Profile->get_sae()) {
+ edit_point_clock.set (drag_info.copied_locations.front()->start());
+ }
show_verbose_time_cursor (newframe, 10);
#ifdef GTKOSX
double cy = drag_info.grab_y + drag_info.cumulative_y_drag + dy;
- // calculate zero crossing point. back off by .01 to stay on the
- // positive side of zero
- double zero_gain_y = (1.0 - ZERO_GAIN_FRACTION) * line->height() - .01;
-
- // line->parent_group().i2w(_unused, zero_gain_y);
-
- // make sure we hit zero when passing through
- if ((cy < zero_gain_y and (cy - dy) > zero_gain_y)
- or (cy > zero_gain_y and (cy - dy) < zero_gain_y)) {
- cy = zero_gain_y;
- }
-
drag_info.cumulative_y_drag = cy - drag_info.grab_y;
cy = max (0.0, cy);
cy = min ((double) line->height(), cy);
-
double fraction = 1.0 - (cy / line->height());
bool push;
int32_t children = 0, numtracks = 0;
// XXX hard coding track limit, oh my, so very very bad
- bitset <1024> tracks (0x00);
+ bitset <1024> tracks (0x00ul);
/* get a bitmask representing the visible tracks */
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
bool x_move_allowed;
if (Config->get_edit_mode() == Lock) {
- if (drag_info.copy) {
- x_move_allowed = !drag_info.x_constrained;
- } else {
- /* in locked edit mode, reverse the usual meaning of x_constrained */
- x_move_allowed = drag_info.x_constrained;
- }
+ x_move_allowed = drag_info.x_constrained;
} else {
x_move_allowed = !drag_info.x_constrained;
}
the drag.
*/
- if (Config->get_edit_mode() == Lock && !drag_info.copy) {
+ if (Config->get_edit_mode() == Lock) {
drag_info.x_constrained = !drag_info.x_constrained;
}