diff options
author | Robin Gareus <robin@gareus.org> | 2017-10-04 00:35:29 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-10-04 00:54:55 +0200 |
commit | e31f5d999837b0d0d63dc824c50e9da4acca7244 (patch) | |
tree | ef4712ccd25e8cc651ffabcd16e120571c21921d /libs/ardour/session_playlists.cc | |
parent | 5dd9acf9ab39306277652c28fb5ac4af330e0af0 (diff) |
Clean up State API:
* Processor implement get_state(), classes derived from Processor
implement protected ::state() -- as documented in processor.h
* likewise for Route, Track: make ::state() a protected interface
* removal of "full_state", use explicit "template_save"
* use RAII/Unwind to skip saving automation-state
Diffstat (limited to 'libs/ardour/session_playlists.cc')
-rw-r--r-- | libs/ardour/session_playlists.cc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/libs/ardour/session_playlists.cc b/libs/ardour/session_playlists.cc index d7780ea9b5..50bc710347 100644 --- a/libs/ardour/session_playlists.cc +++ b/libs/ardour/session_playlists.cc @@ -325,7 +325,7 @@ get_id_sorted_playlists (const List& playlists, IDSortedList& id_sorted_playlist } // anonymous namespace void -SessionPlaylists::add_state (XMLNode* node, bool full_state) +SessionPlaylists::add_state (XMLNode* node, bool save_template, bool include_unused) { XMLNode* child = node->add_child ("Playlists"); @@ -334,14 +334,18 @@ SessionPlaylists::add_state (XMLNode* node, bool full_state) for (IDSortedList::iterator i = id_sorted_playlists.begin (); i != id_sorted_playlists.end (); ++i) { if (!(*i)->hidden ()) { - if (full_state) { - child->add_child_nocopy ((*i)->get_state ()); - } else { + if (save_template) { child->add_child_nocopy ((*i)->get_template ()); + } else { + child->add_child_nocopy ((*i)->get_state ()); } } } + if (!include_unused) { + return; + } + child = node->add_child ("UnusedPlaylists"); IDSortedList id_sorted_unused_playlists; @@ -351,10 +355,10 @@ SessionPlaylists::add_state (XMLNode* node, bool full_state) i != id_sorted_unused_playlists.end (); ++i) { if (!(*i)->hidden()) { if (!(*i)->empty()) { - if (full_state) { - child->add_child_nocopy ((*i)->get_state()); - } else { + if (save_template) { child->add_child_nocopy ((*i)->get_template()); + } else { + child->add_child_nocopy ((*i)->get_state()); } } } |