Respond to MMC even when synced to JACK. Fixes #3700.
[ardour.git] / libs / ardour / source.cc
index 6ab907ba169861826872028e0015e23e8f0ff551..c299588f3c84256002b7253e184b51ba94619388 100644 (file)
@@ -110,7 +110,7 @@ Source::get_state ()
 }
 
 int
-Source::set_state (const XMLNode& node, int /*version*/)
+Source::set_state (const XMLNode& node, int version)
 {
        const XMLProperty* prop;
 
@@ -146,6 +146,16 @@ Source::set_state (const XMLNode& node, int /*version*/)
                _flags = Flag (_flags | Destructive);
        }
 
+       if (version < 3000) {
+               /* a source with an XML node must necessarily already exist, 
+                  and therefore cannot be removable/writable etc. etc.; 2.X
+                  sometimes marks sources as removable which shouldn't be.
+               */
+               if (!(_flags & Destructive)) {
+                       _flags = Flag (_flags & ~(Writable|Removable|RemovableIfEmpty|RemoveAtDestroy|CanRename));
+               }
+       }
+
        return 0;
 }
 
@@ -188,7 +198,7 @@ Source::load_transients (const string& path)
                file >> val;
 
                if (!file.fail()) {
-                       nframes64_t frame = (nframes64_t) floor (val * _session.frame_rate());
+                       framepos_t frame = (framepos_t) floor (val * _session.frame_rate());
                        transients.push_back (frame);
                }
        }