From 1f2d1b586e99f2777110298a4ec0e59f411e70a5 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 4 Jul 2016 00:18:45 +0200 Subject: allow AutomatoinContoller to render as Knob instead of Slider. --- gtk2_ardour/automation_controller.cc | 14 +++++++++++--- gtk2_ardour/automation_controller.h | 6 ++++-- gtk2_ardour/themes/dark-ardour.colors | 3 +++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/gtk2_ardour/automation_controller.cc b/gtk2_ardour/automation_controller.cc index 66c051ee19..f8e14595ba 100644 --- a/gtk2_ardour/automation_controller.cc +++ b/gtk2_ardour/automation_controller.cc @@ -30,6 +30,7 @@ #include "ardour/tempo.h" #include "ardour_button.h" +#include "ardour_knob.h" #include "automation_controller.h" #include "gui_thread.h" #include "note_select_dialog.h" @@ -65,7 +66,8 @@ AutomationBarController::~AutomationBarController() AutomationController::AutomationController(boost::shared_ptr printer, boost::shared_ptr ac, - Adjustment* adj) + Adjustment* adj, + bool use_knob) : _widget(NULL) , _printer (printer) , _controllable(ac) @@ -89,6 +91,11 @@ AutomationController::AutomationController(boost::shared_ptr but->signal_clicked.connect( sigc::mem_fun(*this, &AutomationController::toggled)); _widget = but; + } else if (use_knob) { + ArdourKnob* knob = manage (new ArdourKnob (ArdourKnob::default_elements, ArdourKnob::Detent)); + knob->set_controllable (ac); + knob->set_name("processor control knob"); + _widget = knob; } else { AutomationBarController* bar = manage(new AutomationBarController(_printer, ac, adj)); @@ -123,7 +130,8 @@ boost::shared_ptr AutomationController::create(boost::shared_ptr printer, const Evoral::Parameter& param, const ParameterDescriptor& desc, - boost::shared_ptr ac) + boost::shared_ptr ac, + bool use_knob) { const double lo = ac->internal_to_interface(desc.lower); const double up = ac->internal_to_interface(desc.upper); @@ -136,7 +144,7 @@ AutomationController::create(boost::shared_ptr printer, assert (ac); assert(ac->parameter() == param); - return boost::shared_ptr(new AutomationController(printer, ac, adjustment)); + return boost::shared_ptr(new AutomationController(printer, ac, adjustment, use_knob)); } void diff --git a/gtk2_ardour/automation_controller.h b/gtk2_ardour/automation_controller.h index d11ade71ef..4d5826023e 100644 --- a/gtk2_ardour/automation_controller.h +++ b/gtk2_ardour/automation_controller.h @@ -61,7 +61,8 @@ public: boost::shared_ptr parent, const Evoral::Parameter& param, const ARDOUR::ParameterDescriptor& desc, - boost::shared_ptr ac); + boost::shared_ptr ac, + bool use_knob = false); ~AutomationController(); @@ -80,7 +81,8 @@ public: private: AutomationController (boost::shared_ptr printer, boost::shared_ptr ac, - Gtk::Adjustment* adj); + Gtk::Adjustment* adj, + bool use_knob); void start_touch(); void end_touch(); diff --git a/gtk2_ardour/themes/dark-ardour.colors b/gtk2_ardour/themes/dark-ardour.colors index eaf04edf61..fe698923b6 100644 --- a/gtk2_ardour/themes/dark-ardour.colors +++ b/gtk2_ardour/themes/dark-ardour.colors @@ -341,6 +341,9 @@ + + + -- cgit v1.2.3