diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-06-23 20:14:07 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-06-23 20:14:07 +0000 |
commit | f4401c59284258c6aa56707da64e3da32756329f (patch) | |
tree | 73679199ae43516347d607adad212c10612f7eb9 /libs/ardour/session_playlists.cc | |
parent | cac03dbeb6ebdcd406385dd14a746cb8c51dd5f8 (diff) |
midway snapshot of work done on managing Region & Source lifetimes correctly. may fix missing MIDI file bug ; save empty playlists because they may be referred to by the history file ; undo commands auto-delete when objects they refer to die (currently not commands built from XML deserialization); Sources now know how many regions are using them for something, meaning that we know if we can delete the files holding any data for the source
git-svn-id: svn://localhost/ardour2/branches/3.0@7291 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_playlists.cc')
-rw-r--r-- | libs/ardour/session_playlists.cc | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/libs/ardour/session_playlists.cc b/libs/ardour/session_playlists.cc index 2f8ae9a8f0..38c6744d06 100644 --- a/libs/ardour/session_playlists.cc +++ b/libs/ardour/session_playlists.cc @@ -220,6 +220,21 @@ SessionPlaylists::get (vector<boost::shared_ptr<Playlist> >& s) } void +SessionPlaylists::destroy_region (boost::shared_ptr<Region> r) +{ + Glib::Mutex::Lock lm (lock); + + for (List::iterator i = playlists.begin(); i != playlists.end(); ++i) { + (*i)->destroy_region (r); + } + + for (List::iterator i = unused_playlists.begin(); i != unused_playlists.end(); ++i) { + (*i)->destroy_region (r); + } +} + + +void SessionPlaylists::find_equivalent_playlist_regions (boost::shared_ptr<Region> region, vector<boost::shared_ptr<Region> >& result) { for (List::iterator i = playlists.begin(); i != playlists.end(); ++i) @@ -262,14 +277,12 @@ SessionPlaylists::add_state (XMLNode* node, bool full_state) XMLNode* child = node->add_child ("Playlists"); for (List::iterator i = playlists.begin(); i != playlists.end(); ++i) { if (!(*i)->hidden()) { - if (!(*i)->empty()) { - if (full_state) { - child->add_child_nocopy ((*i)->get_state()); - } else { - child->add_child_nocopy ((*i)->get_template()); - } - } - } + if (full_state) { + child->add_child_nocopy ((*i)->get_state()); + } else { + child->add_child_nocopy ((*i)->get_template()); + } + } } child = node->add_child ("UnusedPlaylists"); |