summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_mouse.cc
diff options
context:
space:
mode:
authorBen Loftis <ben@harrisonconsoles.com>2014-08-05 15:42:06 -0500
committerBen Loftis <ben@harrisonconsoles.com>2014-08-05 15:42:06 -0500
commit16ca4e0f9a4ffc87e8e572b8d69767648c2170ae (patch)
tree1ff9d225e598e4ed7c2379e1a870b9cce1f4d59f /gtk2_ardour/editor_mouse.cc
parent45afed5e9a38e50030c9f82f81f60a1bb883e867 (diff)
Initial steps towards usable range-based automation editing.
TODO: needs undo. only works in top quarter of automation lane. selection model feels weird sometimes. needs to show gain curve when you are using Range tool
Diffstat (limited to 'gtk2_ardour/editor_mouse.cc')
-rw-r--r--gtk2_ardour/editor_mouse.cc66
1 files changed, 14 insertions, 52 deletions
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index c12d11ff3f..8d800ae205 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -776,19 +776,9 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
/* grab selection for moving */
_drags->set (new SelectionDrag (this, item, SelectionDrag::SelectionMove), event);
} else {
- double const y = event->button.y;
- pair<TimeAxisView*, int> tvp = trackview_by_y_position (y);
- if (tvp.first) {
- AutomationTimeAxisView* atv = dynamic_cast<AutomationTimeAxisView*> (tvp.first);
- if ( get_smart_mode() && atv) {
- /* smart "join" mode: drag automation */
- _drags->set (new AutomationRangeDrag (this, atv, selection->time), event, _cursors->up_down);
- } else {
- /* this was debated, but decided the more common action was to
- make a new selection */
- _drags->set (new SelectionDrag (this, item, SelectionDrag::CreateSelection), event);
- }
- }
+ /* this was debated, but decided the more common action was to
+ make a new selection */
+ _drags->set (new SelectionDrag (this, item, SelectionDrag::CreateSelection), event);
}
break;
@@ -1048,45 +1038,6 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
case SelectionItem:
{
- if ( get_smart_mode() ) {
- /* we're in "smart" joined mode, and we've clicked on a Selection */
- double const y = event->button.y;
- pair<TimeAxisView*, int> tvp = trackview_by_y_position (y);
- if (tvp.first) {
- /* if we're over an automation track, start a drag of its data */
- AutomationTimeAxisView* atv = dynamic_cast<AutomationTimeAxisView*> (tvp.first);
- if (atv) {
- _drags->set (new AutomationRangeDrag (this, atv, selection->time), event, _cursors->up_down);
- }
-
- /* if we're over a track and a region, and in the `object' part of a region,
- put a selection around the region and drag both
- */
-/* RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (tvp.first);
- if (rtv && _join_object_range_state == JOIN_OBJECT_RANGE_OBJECT) {
- boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track> (rtv->route ());
- if (t) {
- boost::shared_ptr<Playlist> pl = t->playlist ();
- if (pl) {
-
- boost::shared_ptr<Region> r = pl->top_region_at (canvas_event_sample (event));
- if (r) {
- RegionView* rv = rtv->view()->find_view (r);
- clicked_selection = select_range (rv->region()->position(),
- rv->region()->last_frame()+1);
- _drags->add (new SelectionDrag (this, item, SelectionDrag::SelectionMove));
- list<RegionView*> rvs;
- rvs.push_back (rv);
- _drags->add (new RegionMoveDrag (this, item, rv, rvs, false, false));
- _drags->start_grab (event);
- return true;
- }
- }
- }
- }
-*/
- }
- }
break;
}
@@ -1118,6 +1069,17 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
if (arv) {
_drags->set (new AutomationRangeDrag (this, arv, selection->time), event, _cursors->up_down);
_drags->start_grab (event);
+ } else {
+ double const y = event->button.y;
+ pair<TimeAxisView*, int> tvp = trackview_by_y_position (y);
+ if (tvp.first) {
+ AutomationTimeAxisView* atv = dynamic_cast<AutomationTimeAxisView*> (tvp.first);
+ if ( atv) {
+ /* smart "join" mode: drag automation */
+ _drags->set (new AutomationRangeDrag (this, atv, selection->time), event, _cursors->up_down);
+ _drags->start_grab (event);
+ }
+ }
}
return true;
break;