summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-07-04 00:18:45 +0200
committerRobin Gareus <robin@gareus.org>2016-07-04 00:20:11 +0200
commit1f2d1b586e99f2777110298a4ec0e59f411e70a5 (patch)
tree3793d746f61ba80070f4e353dda3742fed8e7299
parent1343f3370601637435ee2e98d7d2e6641ff53ef0 (diff)
allow AutomatoinContoller to render as Knob instead of Slider.
-rw-r--r--gtk2_ardour/automation_controller.cc14
-rw-r--r--gtk2_ardour/automation_controller.h6
-rw-r--r--gtk2_ardour/themes/dark-ardour.colors3
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<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
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<ARDOUR::Automatable> parent,
const Evoral::Parameter& param,
const ARDOUR::ParameterDescriptor& desc,
- boost::shared_ptr<ARDOUR::AutomationControl> ac);
+ boost::shared_ptr<ARDOUR::AutomationControl> ac,
+ bool use_knob = false);
~AutomationController();
@@ -80,7 +81,8 @@ public:
private:
AutomationController (boost::shared_ptr<ARDOUR::Automatable> printer,
boost::shared_ptr<ARDOUR::AutomationControl> 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 @@
<ColorAlias name="processor control button: fill" alias="color 29"/>
<ColorAlias name="processor control button: fill active" alias="color 46"/>
<ColorAlias name="processor control button: led active" alias="color 62"/>
+ <ColorAlias name="processor control knob" alias="color 60"/>
+ <ColorAlias name="processor control knob: arc end" alias="color 70"/>
+ <ColorAlias name="processor control knob: arc start" alias="color 16"/>
<ColorAlias name="processor fader: fill" alias="color 16"/>
<ColorAlias name="processor fader: fill active" alias="color 78"/>
<ColorAlias name="processor fader: led active" alias="color 37"/>