restore being able to load a 5.12 session with a destructive track.

Not all is working right yet, however
This commit is contained in:
Paul Davis
2020-02-26 21:20:25 -07:00
parent a4d7b45fe0
commit a30ee6950d
5 changed files with 21 additions and 1 deletions

View File

@@ -53,7 +53,8 @@ public:
RemovableIfEmpty = 0x10,
RemoveAtDestroy = 0x20,
NoPeakFile = 0x40,
/* 0x80 was Destructive */
/* No longer in use but kept to allow loading of older sessions */
Destructive = 0x80,
Empty = 0x100, /* used for MIDI only */
RF64_RIFF = 0x200,
Missing = 0x400, /* used for MIDI only */

View File

@@ -227,6 +227,8 @@ enum MeterType {
enum TrackMode {
Normal,
NonLayered,
/* No longer in use but kept to allow loading of older sessions */
Destructive,
};
enum NoteMode {

View File

@@ -143,6 +143,11 @@ AudioTrack::set_state (const XMLNode& node, int version)
_mode = Normal;
}
if (_mode == Destructive) {
/* XXX warn user */
_mode = Normal;
}
if (Track::set_state (node, version)) {
return -1;
}

View File

@@ -248,6 +248,10 @@ setup_enum_writer ()
REGISTER_ENUM (Normal);
REGISTER_ENUM (NonLayered);
/* No longer used but we leave this here so that enumwriter can parse
* strings containing "Destructive"
*/
REGISTER_ENUM (Destructive);
REGISTER (_TrackMode);
REGISTER_ENUM (Sustained);
@@ -519,6 +523,10 @@ setup_enum_writer ()
REGISTER_CLASS_ENUM (Source, RemovableIfEmpty);
REGISTER_CLASS_ENUM (Source, RemoveAtDestroy);
REGISTER_CLASS_ENUM (Source, NoPeakFile);
/* No longer used but we leave this here so that enumwriter can parse
* strings containing "Destructive"
*/
REGISTER_CLASS_ENUM (Source, Destructive);
REGISTER_CLASS_ENUM (Source, Empty);
REGISTER_BITS (_Source_Flag);

View File

@@ -167,6 +167,10 @@ Source::set_state (const XMLNode& node, int version)
_flags = Flag (0);
}
/* Destructive is no longer valid */
_flags = Flag (_flags & ~Destructive);
if (!node.get_property (X_("take-id"), _take_id)) {
_take_id = "";
}