summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_mouse.cc
diff options
context:
space:
mode:
authorBen Loftis <ben@glw.com>2012-11-20 19:43:43 +0000
committerBen Loftis <ben@glw.com>2012-11-20 19:43:43 +0000
commitbeb3ec2d7a440308bce6e2db793d78f528c9fa85 (patch)
treee673c98d6d5011f78eebd2e4b18975e95773ec6c /gtk2_ardour/editor_mouse.cc
parent38c10a4d2367111f3b9c7ac2223a8b633bfeb147 (diff)
Always Play Range is now Follow Edits, and is based on Mixbus implementation. Added menu item. Follow Edits button replaces Auto Play; removed the connector between play and play-range. Some Smart Mode changes came along for the ride but will be cleaned up shortly
git-svn-id: svn://localhost/ardour2/branches/3.0@13537 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_mouse.cc')
-rw-r--r--gtk2_ardour/editor_mouse.cc53
1 files changed, 47 insertions, 6 deletions
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index 61e8b5d035..1096afad87 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -361,6 +361,25 @@ Editor::set_mouse_mode (MouseMode m, bool force)
tact->set_active (true);
MouseModeChanged (); /* EMIT SIGNAL */
+
+ if ( (mouse_mode != MouseRange) && (mouse_mode != MouseGain) ) {
+
+ cancel_time_selection(); //disable the range, because an invisible operating range can cause confusing operation
+
+ } else {
+
+ /*
+ in range mode,show the range selection.
+ */
+
+ cancel_selection();
+
+ for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) {
+ if ((*i)->get_selected()) {
+ (*i)->show_selection (selection->time);
+ }
+ }
+ }
}
void
@@ -1290,8 +1309,6 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
return true;
}
-
-
if (internal_editing()) {
bool leave_internal_edit_mode = false;
@@ -1344,6 +1361,13 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
return true;
}
+ //not rolling, range mode click + join_play_range : locate the PH here
+ if ( !_drags->active () && !_session->transport_rolling() && ( (mouse_mode == MouseRange) || _join_object_range_state == JOIN_OBJECT_RANGE_RANGE ) && Config->get_always_play_range() ) {
+ framepos_t where = event_frame (event, 0, 0);
+ snap_to(where);
+ _session->request_locate (where, false);
+ }
+
switch (event->button.button) {
case 1:
return button_press_handler_1 (item, event, item_type);
@@ -1415,7 +1439,17 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
were_dragging = true;
}
- update_region_layering_order_editor ();
+ //a mouse click (no drag) in the range area of an audio track. maybe locate the playhead here
+ if ( !_drags->active () && (effective_mouse_mode() == MouseRange) && Config->get_always_play_range() && (item_type != AutomationTrackItem) && !Keyboard::is_context_menu_event (&event->button)) {
+ if ( _join_object_range_state == JOIN_OBJECT_RANGE_RANGE ) {
+ framepos_t pos = event_frame (event, 0, 0);
+ snap_to(pos);
+ _session->request_locate (pos, false);
+ return true;
+ }
+ }
+
+ update_region_layering_order_editor ();
/* edit events get handled here */
@@ -2412,6 +2446,15 @@ Editor::cancel_selection ()
clicked_selection = 0;
}
+void
+Editor::cancel_time_selection ()
+{
+ for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
+ (*i)->hide_selection ();
+ }
+ selection->time.clear ();
+ clicked_selection = 0;
+}
void
Editor::point_trim (GdkEvent* event, framepos_t new_bound)
@@ -2795,10 +2838,8 @@ Editor::update_join_object_range_location (double /*x*/, double y)
rtv->canvas_display()->w2i (cx, cy);
double const c = cy / (rtv->view()->child_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE);
- double d;
- double const f = modf (c, &d);
- _join_object_range_state = f < 0.5 ? JOIN_OBJECT_RANGE_RANGE : JOIN_OBJECT_RANGE_OBJECT;
+ _join_object_range_state = c <= 0.5 ? JOIN_OBJECT_RANGE_RANGE : JOIN_OBJECT_RANGE_OBJECT;
}
}
}