diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-05-22 16:11:00 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-05-22 16:11:00 +0000 |
commit | 9c733915a0bc4b5274fac749b1adc874da79a6ee (patch) | |
tree | 1db070ef198c7b7890cb98c84a37a1321c810183 /libs/ardour/ardour | |
parent | d40ee9548661f88db1bc1dcda0b463220d59a8d8 (diff) |
basic uncombining (no post-facto region trimming)
git-svn-id: svn://localhost/ardour2/branches/3.0@9566 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/playlist.h | 10 | ||||
-rw-r--r-- | libs/ardour/ardour/playlist_source.h | 3 | ||||
-rw-r--r-- | libs/ardour/ardour/region.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/region_factory.h | 20 | ||||
-rw-r--r-- | libs/ardour/ardour/session.h | 1 |
5 files changed, 34 insertions, 2 deletions
diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h index 6385def785..5d3d5d2504 100644 --- a/libs/ardour/ardour/playlist.h +++ b/libs/ardour/ardour/playlist.h @@ -139,7 +139,8 @@ public: void partition (framepos_t start, framepos_t end, bool cut = false); void duplicate (boost::shared_ptr<Region>, framepos_t position, float times); void nudge_after (framepos_t start, framecnt_t distance, bool forwards); - void join (const RegionList&, const std::string&); + void combine (const RegionList&, const std::string&); + void uncombine (boost::shared_ptr<Region>); void shuffle (boost::shared_ptr<Region>, int dir); void update_after_tempo_map_change (); @@ -382,6 +383,13 @@ public: typedef std::pair<boost::shared_ptr<Region>, boost::shared_ptr<Region> > TwoRegions; virtual void copy_dependents (const std::vector<TwoRegions>&, boost::shared_ptr<Playlist>) { } + + struct RegionInfo { + boost::shared_ptr<Region> region; + framepos_t position; + framecnt_t length; + framepos_t start; + }; }; } /* namespace ARDOUR */ diff --git a/libs/ardour/ardour/playlist_source.h b/libs/ardour/ardour/playlist_source.h index 8732870ec0..ed48fbabd5 100644 --- a/libs/ardour/ardour/playlist_source.h +++ b/libs/ardour/ardour/playlist_source.h @@ -36,7 +36,8 @@ class PlaylistSource : virtual public Source { virtual ~PlaylistSource (); int set_state (const XMLNode&, int version); - + boost::shared_ptr<const Playlist> playlist() const { return _playlist; } + protected: boost::shared_ptr<Playlist> _playlist; frameoffset_t _playlist_offset; diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index 719c00acf8..fdcaeaf249 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -228,6 +228,8 @@ class Region void source_deleted (boost::weak_ptr<Source>); + bool is_compound () const; + boost::shared_ptr<Source> source (uint32_t n=0) const { return _sources[ (n < _sources.size()) ? n : 0 ]; } uint32_t n_channels() const { return _sources.size(); } diff --git a/libs/ardour/ardour/region_factory.h b/libs/ardour/ardour/region_factory.h index 647e1fe7d8..979b499b3a 100644 --- a/libs/ardour/ardour/region_factory.h +++ b/libs/ardour/ardour/region_factory.h @@ -61,6 +61,7 @@ public: /** create a region from a single Source */ static boost::shared_ptr<Region> create (boost::shared_ptr<Source>, const PBD::PropertyList&, bool announce = true); + /** create a region from a multiple sources */ static boost::shared_ptr<Region> create (const SourceList &, const PBD::PropertyList&, bool announce = true); @@ -91,6 +92,24 @@ public: static int region_name (std::string &, std::string, bool new_level = false); static std::string new_region_name (std::string); + /* when we make a compound region, for every region involved there + * are two "instances" - the original, which is removed from this + * playlist, and a copy, which is added to the playlist used as + * the source for the compound. + * + * when we uncombine, we want to put the originals back into this + * playlist after we remove the compound. this map lets us + * look them up easily. note that if the compound was trimmed or + * split, we may have to trim the originals + * and they may not be added back if the compound was trimmed + * or split sufficiently. + */ + + typedef std::map<boost::shared_ptr<Region>, boost::shared_ptr<Region> > CompoundAssociations; + static CompoundAssociations& compound_associations() { return _compound_associations; } + + static void add_compound_association (boost::shared_ptr<Region>, boost::shared_ptr<Region>); + private: static void region_changed (PBD::PropertyChange const &, boost::weak_ptr<Region>); @@ -106,6 +125,7 @@ public: static void update_region_name_map (boost::shared_ptr<Region>); static PBD::ScopedConnectionList region_list_connections; + static CompoundAssociations _compound_associations; }; } diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index dd282e6cf3..f1e73ed1fd 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -1253,6 +1253,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi mutable Glib::Mutex region_lock; int load_regions (const XMLNode& node); + int load_compounds (const XMLNode& node); void route_group_changed (); |