diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-03-01 21:54:54 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-03-01 21:54:54 +0000 |
commit | b37b23af97fbffbf789222f03247439324648ffb (patch) | |
tree | 743af65391e70da63e39f9e810be17c0db176d4c /libs/ardour/playlist.cc | |
parent | 3553ba71fa8c50c05c04e5e067e153e10e386456 (diff) |
improve, cleanup, rationalize Session::cleanup_sources() and supporting infrastructure
git-svn-id: svn://localhost/ardour2/branches/3.0@9015 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/playlist.cc')
-rw-r--r-- | libs/ardour/playlist.cc | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index cb764e7f40..393cc284fb 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -827,12 +827,8 @@ Playlist::add_region_internal (boost::shared_ptr<Region> region, framepos_t posi regions.insert (upper_bound (regions.begin(), regions.end(), region, cmp), region); all_regions.insert (region); - cerr << "Playlist: region added at " << position << endl; - possibly_splice_unlocked (position, region->length(), region); - cerr << "Playlist: post-splice, region @ " << region->position() << endl; - if (!holding_state ()) { /* layers get assigned from XML state, and are not reset during undo/redo */ relayer (); @@ -1309,7 +1305,6 @@ Playlist::paste (boost::shared_ptr<Playlist> other, framepos_t position, float t */ copy_of_region->set_layer (copy_of_region->layer() + top_layer); - cerr << "DEBUG: add new region at " << pos << endl; add_region_internal (copy_of_region, (*i)->position() + pos); } pos += shift; @@ -1704,6 +1699,18 @@ Playlist::drop_regions () } void +Playlist::sync_all_regions_with_regions () +{ + RegionLock rl (this); + + all_regions.clear (); + + for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) { + all_regions.insert (*i); + } +} + +void Playlist::clear (bool with_signals) { { @@ -2757,6 +2764,20 @@ Playlist::nudge_after (framepos_t start, framecnt_t distance, bool forwards) } +bool +Playlist::uses_source (boost::shared_ptr<const Source> src) const +{ + RegionLock rlock (const_cast<Playlist*> (this)); + + for (set<boost::shared_ptr<Region> >::iterator r = all_regions.begin(); r != all_regions.end(); ++r) { + if ((*r)->uses_source (src)) { + return true; + } + } + + return false; +} + boost::shared_ptr<Region> Playlist::find_region (const ID& id) const { |