From 63269b306325a2beb1a7112a842cfb8b425f8da3 Mon Sep 17 00:00:00 2001 From: nick_m Date: Sun, 21 Jun 2015 05:27:45 +1000 Subject: [PATCH] Automation selection fixes. - display selected comtrol points in region gain lines - display selected points in internal edit mode - allow dragging of region gain lines in MouseContent mode --- gtk2_ardour/audio_streamview.cc | 12 ++++++++++++ gtk2_ardour/audio_streamview.h | 2 ++ gtk2_ardour/automation_line.cc | 3 ++- gtk2_ardour/editor_mouse.cc | 8 +++++++- gtk2_ardour/route_time_axis.cc | 5 +++++ 5 files changed, 28 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/audio_streamview.cc b/gtk2_ardour/audio_streamview.cc index 7951848c59..ed7bfc238d 100644 --- a/gtk2_ardour/audio_streamview.cc +++ b/gtk2_ardour/audio_streamview.cc @@ -41,6 +41,7 @@ #include "tape_region_view.h" #include "audio_time_axis.h" #include "region_selection.h" +#include "region_gain_line.h" #include "selection.h" #include "public_editor.h" #include "ardour_ui.h" @@ -471,3 +472,14 @@ AudioStreamView::color_handler () } } } + +void +AudioStreamView::set_selected_points (PointSelection& points) +{ + for (list::iterator i = region_views.begin(); i != region_views.end(); ++i) { + AudioRegionView* const arv = dynamic_cast(*i); + if (arv && arv->get_gain_line ()) { + arv->get_gain_line ()->set_selected_points (points); + } + } +} diff --git a/gtk2_ardour/audio_streamview.h b/gtk2_ardour/audio_streamview.h index 8e9b095537..443a39063b 100644 --- a/gtk2_ardour/audio_streamview.h +++ b/gtk2_ardour/audio_streamview.h @@ -26,6 +26,7 @@ #include #include "ardour/location.h" +#include "point_selection.h" #include "editing.h" #include "streamview.h" @@ -61,6 +62,7 @@ class AudioStreamView : public StreamView std::pair, std::list > hide_xfades_with (boost::shared_ptr ar); RegionView* create_region_view (boost::shared_ptr, bool, bool); + void set_selected_points (PointSelection&); private: void setup_rec_box (); diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index e3acc56b3b..d0dc933759 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -948,7 +948,8 @@ AutomationLine::set_selected_points (PointSelection const & points) set_colors (); } -void AutomationLine::set_colors () +void +AutomationLine::set_colors () { set_line_color (ARDOUR_UI::config()->color ("automation line")); for (vector::iterator i = control_points.begin(); i != control_points.end(); ++i) { diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 07931a5479..26e8dd2872 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -446,7 +446,8 @@ Editor::button_selection (ArdourCanvas::Item* /*item*/, GdkEvent* event, ItemTyp if (((mouse_mode != MouseObject) && (mouse_mode != MouseAudition || item_type != RegionItem) && (mouse_mode != MouseTimeFX || item_type != RegionItem) && - (mouse_mode != MouseDraw)) || + (mouse_mode != MouseDraw) && + (mouse_mode != MouseContent || item_type == RegionItem)) || ((event->type != GDK_BUTTON_PRESS && event->type != GDK_BUTTON_RELEASE) || event->button.button > 3)) { return; } @@ -762,6 +763,11 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT } return true; + case GainLineItem: + _drags->set (new LineDrag (this, item), event); + return true; + break; + case ControlPointItem: _drags->set (new ControlPointDrag (this, item), event); return true; diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 7f112b9546..94ed2a86f0 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -59,6 +59,7 @@ #include "ardour_ui.h" #include "ardour_button.h" +#include "audio_streamview.h" #include "debug.h" #include "global_signals.h" #include "route_time_axis.h" @@ -1342,6 +1343,10 @@ RouteTimeAxisView::set_selected_points (PointSelection& points) for (Children::iterator i = children.begin(); i != children.end(); ++i) { (*i)->set_selected_points (points); } + AudioStreamView* asv = dynamic_cast(_view); + if (asv) { + asv->set_selected_points (points); + } } void