restore source segment descriptors

This commit is contained in:
Paul Davis 2022-01-13 17:41:15 -07:00
parent b9a798ebb8
commit c159614902

View File

@ -160,6 +160,7 @@ Source::set_state (const XMLNode& node, int version)
XMLNodeList nlist = node.children(); XMLNodeList nlist = node.children();
int64_t t; int64_t t;
samplepos_t ts; samplepos_t ts;
XMLNode* sd_node;
if (node.name() == X_("Cues")) { if (node.name() == X_("Cues")) {
/* partial state */ /* partial state */
@ -251,6 +252,20 @@ Source::set_state (const XMLNode& node, int version)
_flags = Flag (_flags & ~(Writable|Removable|RemovableIfEmpty|RemoveAtDestroy|CanRename)); _flags = Flag (_flags & ~(Writable|Removable|RemovableIfEmpty|RemoveAtDestroy|CanRename));
} }
sd_node = node.child (X_("SegmentDescriptors"));
if (sd_node) {
segment_descriptors.clear ();
try {
XMLNodeList nlist = sd_node->children();
for (XMLNodeIterator niter = nlist.begin(); niter != nlist.end(); ++niter) {
segment_descriptors.push_back (SegmentDescriptor (**niter, version));
}
} catch (...) {
error << string_compose (_("Segment descriptors not loaded for source %1"), name()) << endmsg;
}
}
/* support to make undo/redo actually function. Very few things about /* support to make undo/redo actually function. Very few things about
* Sources are ever part of undo/redo history, but this can * Sources are ever part of undo/redo history, but this can
* be. Undo/Redo uses a MementoCommand<> pattern, which will not in * be. Undo/Redo uses a MementoCommand<> pattern, which will not in