Add track playlist-state function for undo/redo

This commit is contained in:
Robin Gareus
2023-06-09 16:41:40 +02:00
parent 322e7c328e
commit 3a60de5d54
2 changed files with 19 additions and 0 deletions

View File

@@ -66,6 +66,8 @@ public:
bool set_processor_state (XMLNode const& node, int version, XMLProperty const* prop, ProcessorList& new_order, bool& must_configure);
XMLNode& playlist_state () const;
bool declick_in_progress () const;
bool can_record();

View File

@@ -162,6 +162,23 @@ Track::chan_count_changed ()
ChanCountChanged (); /* EMIT SIGNAL */
}
XMLNode&
Track::playlist_state () const
{
XMLNode* node = new XMLNode("Route");
node->set_property("version", CURRENT_SESSION_FILE_VERSION);
if (_playlists[DataType::AUDIO]) {
node->set_property (X_("audio-playlist"), _playlists[DataType::AUDIO]->id().to_s());
}
if (_playlists[DataType::MIDI]) {
node->set_property (X_("midi-playlist"), _playlists[DataType::MIDI]->id().to_s());
}
return *node;
}
XMLNode&
Track::state (bool save_template) const
{