Flush processor (re-activate) on route active change
[ardour.git] / libs / ardour / track.cc
index 69d80307762dfca1015138aa4b8768902590bd0d..0fcf831f4688c3494e6392d0a6c9af199855bff4 100644 (file)
@@ -21,6 +21,7 @@
 #include "ardour/debug.h"
 #include "ardour/delivery.h"
 #include "ardour/diskstream.h"
+#include "ardour/event_type_map.h"
 #include "ardour/io_processor.h"
 #include "ardour/meter.h"
 #include "ardour/monitor_control.h"
@@ -66,13 +67,13 @@ Track::init ()
        boost::shared_ptr<Route> rp (shared_from_this());
        boost::shared_ptr<Track> rt = boost::dynamic_pointer_cast<Track> (rp);
 
-       _record_enable_control.reset (new RecordEnableControl (_session, X_("recenable"), *this));
+       _record_enable_control.reset (new RecordEnableControl (_session, EventTypeMap::instance().to_symbol (RecEnableAutomation), *this));
        add_control (_record_enable_control);
 
-       _record_safe_control.reset (new RecordSafeControl (_session, X_("recsafe"), *this));
+       _record_safe_control.reset (new RecordSafeControl (_session, EventTypeMap::instance().to_symbol (RecSafeAutomation), *this));
        add_control (_record_safe_control);
 
-       _monitoring_control.reset (new MonitorControl (_session, X_("monitoring"), *this));
+       _monitoring_control.reset (new MonitorControl (_session, EventTypeMap::instance().to_symbol (MonitoringAutomation), *this));
        add_control (_monitoring_control);
 
        _session.config.ParameterChanged.connect_same_thread (*this, boost::bind (&Track::parameter_changed, this, _1));
@@ -293,8 +294,12 @@ Track::set_name (const string& str)
 {
        bool ret;
 
-       if (_record_enable_control->get_value() && _session.actively_recording()) {
-               /* this messes things up if done while recording */
+       if (str.empty ()) {
+               return false;
+       }
+
+       if (_record_enable_control->get_value()) {
+               /* when re-arm'ed the file (named after the track) is already ready to rolll */
                return false;
        }
 
@@ -955,6 +960,8 @@ Track::monitoring_state () const
         * time, but just to keep the semantics the same as they were before
         * sept 26th 2012, we differentiate between the cases where punch is
         * enabled and those where it is not.
+        *
+        * rg: I suspect this is not the case: monitoring may differ
         */
 
        if (_session.config.get_punch_in() || _session.config.get_punch_out() || _session.preroll_record_punch_enabled ()) {