allow AutomatoinContoller to render as Knob instead of Slider.
authorRobin Gareus <robin@gareus.org>
Sun, 3 Jul 2016 22:18:45 +0000 (00:18 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 3 Jul 2016 22:20:11 +0000 (00:20 +0200)
gtk2_ardour/automation_controller.cc
gtk2_ardour/automation_controller.h
gtk2_ardour/themes/dark-ardour.colors

index 66c051ee19b45f58aa1c3569de6b00a4c43e686e..f8e14595bae1c49f665123c3bbd4ad49e7879a08 100644 (file)
@@ -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
index d11ade71ef8255b1e55da58f523b668971514621..4d5826023e35d50c5af9f0d34657d78dcc4a4599 100644 (file)
@@ -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();
index eaf04edf616f71a216f84a182c7cbb0de4d62aa7..fe698923b6114a16d735b7d1a81020c06846fd14 100644 (file)
     <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"/>