diff options
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/automation_controller.cc | 21 | ||||
-rw-r--r-- | gtk2_ardour/gain_meter.cc | 4 | ||||
-rw-r--r-- | gtk2_ardour/generic_pluginui.cc | 5 | ||||
-rw-r--r-- | gtk2_ardour/panner_ui.cc | 26 | ||||
-rw-r--r-- | gtk2_ardour/panner_ui.h | 5 |
5 files changed, 52 insertions, 9 deletions
diff --git a/gtk2_ardour/automation_controller.cc b/gtk2_ardour/automation_controller.cc index f63f2ed70c..aa23cb2601 100644 --- a/gtk2_ardour/automation_controller.cc +++ b/gtk2_ardour/automation_controller.cc @@ -19,12 +19,16 @@ */ #include <iomanip> + #include "pbd/error.h" + #include "ardour/automation_list.h" #include "ardour/automation_control.h" #include "ardour/event_type_map.h" #include "ardour/automatable.h" #include "ardour/panner.h" +#include "ardour/session.h" + #include "ardour_ui.h" #include "utils.h" #include "automation_controller.h" @@ -121,13 +125,24 @@ AutomationController::value_adjusted() void AutomationController::start_touch() { - _controllable->start_touch(); + _controllable->start_touch (_controllable->session().transport_frame()); } void -AutomationController::end_touch() +AutomationController::end_touch () { - _controllable->stop_touch(); + if (_controllable->automation_state() == Touch) { + + bool mark = false; + double when = 0; + + if (_controllable->session().transport_rolling()) { + mark = true; + when = _controllable->session().transport_frame(); + } + + _controllable->stop_touch (mark, when); + } } void diff --git a/gtk2_ardour/gain_meter.cc b/gtk2_ardour/gain_meter.cc index b8a6ad2df9..9ae59f63e6 100644 --- a/gtk2_ardour/gain_meter.cc +++ b/gtk2_ardour/gain_meter.cc @@ -593,14 +593,14 @@ GainMeterBase::meter_point_clicked () gint GainMeterBase::start_gain_touch (GdkEventButton*) { - _amp->gain_control()->start_touch (); + _amp->gain_control()->start_touch (_amp->session().transport_frame()); return FALSE; } gint GainMeterBase::end_gain_touch (GdkEventButton*) { - _amp->gain_control()->stop_touch (); + _amp->gain_control()->stop_touch (false, _amp->session().transport_frame()); return FALSE; } diff --git a/gtk2_ardour/generic_pluginui.cc b/gtk2_ardour/generic_pluginui.cc index 40f8e16ef8..5e14ecf034 100644 --- a/gtk2_ardour/generic_pluginui.cc +++ b/gtk2_ardour/generic_pluginui.cc @@ -45,6 +45,7 @@ #ifdef HAVE_SLV2 #include "ardour/lv2_plugin.h" #endif +#include "ardour/session.h" #include <lrdf.h> @@ -603,13 +604,13 @@ GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automat void GenericPluginUI::start_touch (GenericPluginUI::ControlUI* cui) { - cui->control->start_touch (); + cui->control->start_touch (cui->control->session().transport_frame()); } void GenericPluginUI::stop_touch (GenericPluginUI::ControlUI* cui) { - cui->control->stop_touch (); + cui->control->stop_touch (false, cui->control->session().transport_frame()); } void diff --git a/gtk2_ardour/panner_ui.cc b/gtk2_ardour/panner_ui.cc index 69387ad3a2..263a8ec518 100644 --- a/gtk2_ardour/panner_ui.cc +++ b/gtk2_ardour/panner_ui.cc @@ -405,8 +405,10 @@ PannerUI::setup_pan () boost::shared_ptr<AutomationControl> ac = _panner->pan_control (asz); if (asz) { - bc->StartGesture.connect (sigc::mem_fun (*ac, &AutomationControl::start_touch)); - bc->StopGesture.connect (sigc::mem_fun (*ac, &AutomationControl::stop_touch)); + bc->StartGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::start_touch), + boost::weak_ptr<AutomationControl> (ac))); + bc->StopGesture.connect (sigc::bind (sigc::mem_fun (*this, &PannerUI::stop_touch), + boost::weak_ptr<AutomationControl>(ac))); } char buf[64]; @@ -459,6 +461,26 @@ PannerUI::setup_pan () } } +void +PannerUI::start_touch (boost::weak_ptr<AutomationControl> wac) +{ + boost::shared_ptr<AutomationControl> ac = wac.lock(); + if (!ac) { + return; + } + ac->start_touch (ac->session().transport_frame()); +} + +void +PannerUI::stop_touch (boost::weak_ptr<AutomationControl> wac) +{ + boost::shared_ptr<AutomationControl> ac = wac.lock(); + if (!ac) { + return; + } + ac->stop_touch (false, ac->session().transport_frame()); +} + bool PannerUI::pan_button_event (GdkEventButton* ev, uint32_t which) { diff --git a/gtk2_ardour/panner_ui.h b/gtk2_ardour/panner_ui.h index 4ed8767fb1..a1558981f6 100644 --- a/gtk2_ardour/panner_ui.h +++ b/gtk2_ardour/panner_ui.h @@ -45,7 +45,9 @@ namespace ARDOUR { class Session; class Panner; class Delivery; + class AutomationControl; } + namespace Gtkmm2ext { class FastMeter; } @@ -167,6 +169,9 @@ class PannerUI : public Gtk::HBox, public ARDOUR::SessionHandlePtr std::string astyle_string (ARDOUR::AutoStyle); std::string short_astyle_string (ARDOUR::AutoStyle); std::string _astyle_string (ARDOUR::AutoStyle, bool); + + void start_touch (boost::weak_ptr<ARDOUR::AutomationControl>); + void stop_touch (boost::weak_ptr<ARDOUR::AutomationControl>); }; #endif /* __ardour_gtk_panner_ui_h__ */ |