X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fsource.cc;h=c299588f3c84256002b7253e184b51ba94619388;hb=ed72df29b79f9e2dc7482f07c39010b4523c4a8e;hp=6ab907ba169861826872028e0015e23e8f0ff551;hpb=c8e3f32533cc6f4481222781d93e7bf7c32ffe5f;p=ardour.git diff --git a/libs/ardour/source.cc b/libs/ardour/source.cc index 6ab907ba16..c299588f3c 100644 --- a/libs/ardour/source.cc +++ b/libs/ardour/source.cc @@ -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); } }