Don't mark reloaded MIDI sources as non-writable. Fixes #3483.
authorCarl Hetherington <carl@carlh.net>
Tue, 28 Sep 2010 22:31:24 +0000 (22:31 +0000)
committerCarl Hetherington <carl@carlh.net>
Tue, 28 Sep 2010 22:31:24 +0000 (22:31 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@7853 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/source.cc

index e5aa759670a805a4819d3dc060227ef063c06dd2..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,12 +146,15 @@ Source::set_state (const XMLNode& node, int /*version*/)
                _flags = Flag (_flags | Destructive);
        }
 
-        /* a source with an XML node must necessarily already exist, 
-           and therefore cannot be removable/writable etc. etc.
-        */
-        if (!(_flags & Destructive)) {
-                _flags = Flag (_flags & ~(Writable|Removable|RemovableIfEmpty|RemoveAtDestroy|CanRename));
-        }
+       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;
 }