}
int
-Source::set_state (const XMLNode& node, int /*version*/)
+Source::set_state (const XMLNode& node, int version)
{
const XMLProperty* prop;
_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;
}
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);
}
}
}
}
+void
+Source::inc_use_count ()
+{
+ g_atomic_int_inc (&_use_count);
+}
+
void
Source::dec_use_count ()
{
#ifndef NDEBUG
gint oldval = g_atomic_int_exchange_and_add (&_use_count, -1);
- cerr << "Bad use dec for " << name() << endl;
if (oldval <= 0) {
+ cerr << "Bad use dec for " << name() << endl;
abort ();
}
assert (oldval > 0);