summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-07-23 19:44:45 +0200
committerRobin Gareus <robin@gareus.org>2017-07-24 01:59:03 +0200
commit25df9f1ba5c65fbe89cafffd1dc02dc44e60ec77 (patch)
tree6f04127c629e95401f2d219fdf68b3bfcec7b3ca /gtk2_ardour
parent183351f33359b0d110dcc12a8121b6fac112bc14 (diff)
Start/end touch for generic-UI knob and proc-box inline ctrls
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/automation_controller.cc2
-rw-r--r--gtk2_ardour/processor_box.cc23
-rw-r--r--gtk2_ardour/processor_box.h3
3 files changed, 28 insertions, 0 deletions
diff --git a/gtk2_ardour/automation_controller.cc b/gtk2_ardour/automation_controller.cc
index fb7a75f4b6..c151b72d14 100644
--- a/gtk2_ardour/automation_controller.cc
+++ b/gtk2_ardour/automation_controller.cc
@@ -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));
diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc
index fa1b300e7b..8b353c040e 100644
--- a/gtk2_ardour/processor_box.cc
+++ b/gtk2_ardour/processor_box.cc
@@ -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 ()) {
@@ -902,6 +905,26 @@ ProcessorEntry::Control::slider_adjusted ()
}
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 ()
{
boost::shared_ptr<AutomationControl> c = _control.lock ();
diff --git a/gtk2_ardour/processor_box.h b/gtk2_ardour/processor_box.h
index 66585c88ec..8bb7b55f9b 100644
--- a/gtk2_ardour/processor_box.h
+++ b/gtk2_ardour/processor_box.h
@@ -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;