de.po updates
[ardour.git] / libs / ardour / plugin_insert.cc
index baaa632d2b683b4a9ff3ebba96c9f6b2e7f2ace9..23cebf427679ec6938a6c7ea37475a58d67da82f 100644 (file)
@@ -267,7 +267,7 @@ PluginInsert::parameter_changed (uint32_t which, float val)
        boost::shared_ptr<AutomationControl> ac = automation_control (Evoral::Parameter (PluginAutomation, 0, which));
 
        if (ac) {
-               ac->set_double (val);
+               ac->set_value (val);
                 
                 Plugins::iterator i = _plugins.begin();
                 
@@ -552,7 +552,7 @@ PluginInsert::automation_run (BufferSet& bufs, pframes_t nframes)
        framepos_t end = now + nframes;
        framecnt_t offset = 0;
 
-       Glib::Mutex::Lock lm (control_lock(), Glib::TRY_LOCK);
+       Glib::Threads::Mutex::Lock lm (control_lock(), Glib::Threads::TRY_LOCK);
 
        if (!lm.locked()) {
                connect_and_run (bufs, nframes, offset, false);
@@ -1263,7 +1263,12 @@ PluginInsert::add_plugin (boost::shared_ptr<Plugin> plugin)
        plugin->set_insert_info (this);
        
        if (_plugins.empty()) {
+                /* first (and probably only) plugin instance - connect to relevant signals 
+                 */
+
                plugin->ParameterChanged.connect_same_thread (*this, boost::bind (&PluginInsert::parameter_changed, this, _1, _2));
+                plugin->StartTouch.connect_same_thread (*this, boost::bind (&PluginInsert::start_touch, this, _1));
+                plugin->EndTouch.connect_same_thread (*this, boost::bind (&PluginInsert::end_touch, this, _1));
        }
 
        _plugins.push_back (plugin);
@@ -1292,3 +1297,21 @@ PluginInsert::monitoring_changed ()
                (*i)->monitoring_changed ();
        }
 }
+
+void
+PluginInsert::start_touch (uint32_t param_id)
+{
+        boost::shared_ptr<AutomationControl> ac = automation_control (Evoral::Parameter (PluginAutomation, 0, param_id));
+        if (ac) {
+                ac->start_touch (session().audible_frame());
+        }
+}
+
+void
+PluginInsert::end_touch (uint32_t param_id)
+{
+        boost::shared_ptr<AutomationControl> ac = automation_control (Evoral::Parameter (PluginAutomation, 0, param_id));
+        if (ac) {
+                ac->stop_touch (true, session().audible_frame());
+        }
+}