Start/end touch for generic-UI knob and proc-box inline ctrls
authorRobin Gareus <robin@gareus.org>
Sun, 23 Jul 2017 17:44:45 +0000 (19:44 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 23 Jul 2017 23:59:03 +0000 (01:59 +0200)
gtk2_ardour/automation_controller.cc
gtk2_ardour/processor_box.cc
gtk2_ardour/processor_box.h

index fb7a75f4b69c08f1b2cc58a5d2955d6c7d3ccfc9..c151b72d14d431c716644af5f4a43d7f19748372 100644 (file)
@@ -98,6 +98,8 @@ AutomationController::AutomationController(boost::shared_ptr<AutomationControl>
                knob->set_controllable (ac);
                knob->set_name("processor control knob");
                _widget = knob;
+               knob->StartGesture.connect(sigc::mem_fun(*this, &AutomationController::start_touch));
+               knob->StopGesture.connect(sigc::mem_fun(*this, &AutomationController::end_touch));
        } else {
                AutomationBarController* bar = manage(new AutomationBarController(ac, adj));
 
index fa1b300e7b1241fdda4eb3dad0502f7d1f675684..8b353c040ee2677c561e40e9ea6c2e7faeb5c029 100644 (file)
@@ -851,6 +851,9 @@ ProcessorEntry::Control::Control (boost::shared_ptr<AutomationControl> c, string
                _adjustment.set_page_increment (largestep);
                _slider.set_default_value (normal);
 
+               _slider.StartGesture.connect(sigc::mem_fun(*this, &Control::start_touch));
+               _slider.StopGesture.connect(sigc::mem_fun(*this, &Control::end_touch));
+
                _adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &Control::slider_adjusted));
                c->Changed.connect (_connections, invalidator (*this), boost::bind (&Control::control_changed, this), gui_context ());
                if (c->alist ()) {
@@ -901,6 +904,26 @@ ProcessorEntry::Control::slider_adjusted ()
        set_tooltip ();
 }
 
+void
+ProcessorEntry::Control::start_touch ()
+{
+       boost::shared_ptr<AutomationControl> c = _control.lock ();
+       if (!c) {
+               return;
+       }
+       c->start_touch (c->session().transport_frame());
+}
+
+void
+ProcessorEntry::Control::end_touch ()
+{
+       boost::shared_ptr<AutomationControl> c = _control.lock ();
+       if (!c) {
+               return;
+       }
+       c->stop_touch (true, c->session().transport_frame());
+}
+
 void
 ProcessorEntry::Control::button_clicked ()
 {
index 66585c88ec957cd7d1bb65a02eccd760e5a9f802..8bb7b55f9b027168284cbce9b12587dadeb7c28a 100644 (file)
@@ -223,6 +223,9 @@ private:
                std::string state_id () const;
                void set_tooltip ();
 
+               void start_touch ();
+               void end_touch ();
+
                boost::weak_ptr<ARDOUR::AutomationControl> _control;
                /* things for a slider */
                Gtk::Adjustment _adjustment;