diff options
author | Robin Gareus <robin@gareus.org> | 2016-07-04 00:18:45 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-07-04 00:20:11 +0200 |
commit | 1f2d1b586e99f2777110298a4ec0e59f411e70a5 (patch) | |
tree | 3793d746f61ba80070f4e353dda3742fed8e7299 /gtk2_ardour/automation_controller.cc | |
parent | 1343f3370601637435ee2e98d7d2e6641ff53ef0 (diff) |
allow AutomatoinContoller to render as Knob instead of Slider.
Diffstat (limited to 'gtk2_ardour/automation_controller.cc')
-rw-r--r-- | gtk2_ardour/automation_controller.cc | 14 |
1 files changed, 11 insertions, 3 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<Automatable> printer, boost::shared_ptr<AutomationControl> ac, - Adjustment* adj) + Adjustment* adj, + bool use_knob) : _widget(NULL) , _printer (printer) , _controllable(ac) @@ -89,6 +91,11 @@ AutomationController::AutomationController(boost::shared_ptr<Automatable> 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> AutomationController::create(boost::shared_ptr<Automatable> printer, const Evoral::Parameter& param, const ParameterDescriptor& desc, - boost::shared_ptr<AutomationControl> ac) + boost::shared_ptr<AutomationControl> 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<Automatable> printer, assert (ac); assert(ac->parameter() == param); - return boost::shared_ptr<AutomationController>(new AutomationController(printer, ac, adjustment)); + return boost::shared_ptr<AutomationController>(new AutomationController(printer, ac, adjustment, use_knob)); } void |