diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-01-10 16:19:13 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-01-10 16:19:13 +0000 |
commit | 1c167454eb2d498ed0ed453136ad3042aee0b556 (patch) | |
tree | 56b889a392cd0f9295359116d03c973a91ef881a /libs/ardour/ardour | |
parent | c9fd6da8b184831565fc74dd6a828596f5d77840 (diff) |
fix xfade logic and use shared_ptr for xfades
git-svn-id: svn://localhost/ardour2/trunk@1297 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/audioplaylist.h | 14 | ||||
-rw-r--r-- | libs/ardour/ardour/crossfade.h | 5 | ||||
-rw-r--r-- | libs/ardour/ardour/playlist_templates.h | 2 |
3 files changed, 11 insertions, 10 deletions
diff --git a/libs/ardour/ardour/audioplaylist.h b/libs/ardour/ardour/audioplaylist.h index 2f1b127c5a..586bf6ccc6 100644 --- a/libs/ardour/ardour/audioplaylist.h +++ b/libs/ardour/ardour/audioplaylist.h @@ -37,7 +37,7 @@ class Source; class AudioPlaylist : public ARDOUR::Playlist { public: - typedef std::list<Crossfade*> Crossfades; + typedef std::list<boost::shared_ptr<Crossfade> > Crossfades; public: AudioPlaylist (Session&, const XMLNode&, bool hidden = false); @@ -53,9 +53,9 @@ class AudioPlaylist : public ARDOUR::Playlist int set_state (const XMLNode&); - sigc::signal<void,Crossfade *> NewCrossfade; + sigc::signal<void,boost::shared_ptr<Crossfade> > NewCrossfade; - template<class T> void foreach_crossfade (T *t, void (T::*func)(Crossfade *)); + template<class T> void foreach_crossfade (T *t, void (T::*func)(boost::shared_ptr<Crossfade>)); void crossfades_at (nframes_t frame, Crossfades&); bool destroy_region (boost::shared_ptr<Region>); @@ -63,7 +63,7 @@ class AudioPlaylist : public ARDOUR::Playlist protected: /* playlist "callbacks" */ - void notify_crossfade_added (Crossfade *); + void notify_crossfade_added (boost::shared_ptr<Crossfade>); void flush_notifications (); void finalize_split_region (boost::shared_ptr<Region> orig, boost::shared_ptr<Region> left, boost::shared_ptr<Region> right); @@ -73,16 +73,16 @@ class AudioPlaylist : public ARDOUR::Playlist void remove_dependents (boost::shared_ptr<Region> region); private: - Crossfades _crossfades; /* xfades currently in use */ + Crossfades _crossfades; Crossfades _pending_xfade_adds; - void crossfade_invalidated (Crossfade*); + void crossfade_invalidated (boost::shared_ptr<Crossfade>); XMLNode& state (bool full_state); void dump () const; bool region_changed (Change, boost::shared_ptr<Region>); void crossfade_changed (Change); - void add_crossfade (Crossfade&); + void add_crossfade (boost::shared_ptr<Crossfade>); void source_offset_changed (boost::shared_ptr<AudioRegion> region); }; diff --git a/libs/ardour/ardour/crossfade.h b/libs/ardour/ardour/crossfade.h index 0422698c5e..946d35b8e0 100644 --- a/libs/ardour/ardour/crossfade.h +++ b/libs/ardour/ardour/crossfade.h @@ -24,6 +24,7 @@ #include <vector> #include <algorithm> #include <boost/shared_ptr.hpp> +#include <boost/enable_shared_from_this.hpp> #include <sigc++/signal.h> @@ -40,7 +41,7 @@ namespace ARDOUR { class AudioRegion; class Playlist; -class Crossfade : public PBD::StatefulDestructible +class Crossfade : public PBD::StatefulDestructible, public boost::enable_shared_from_this<ARDOUR::Crossfade> { public: @@ -111,7 +112,7 @@ class Crossfade : public PBD::StatefulDestructible void invalidate(); - sigc::signal<void,Crossfade*> Invalidated; + sigc::signal<void,boost::shared_ptr<Crossfade> > Invalidated; sigc::signal<void,Change> StateChanged; bool covers (nframes_t frame) const { diff --git a/libs/ardour/ardour/playlist_templates.h b/libs/ardour/ardour/playlist_templates.h index 7ce6c1818c..603e0bef37 100644 --- a/libs/ardour/ardour/playlist_templates.h +++ b/libs/ardour/ardour/playlist_templates.h @@ -23,7 +23,7 @@ namespace ARDOUR { -template<class T> void AudioPlaylist::foreach_crossfade (T *t, void (T::*func)(Crossfade *)) { +template<class T> void AudioPlaylist::foreach_crossfade (T *t, void (T::*func)(boost::shared_ptr<Crossfade>)) { RegionLock rlock (this, false); for (Crossfades::iterator i = _crossfades.begin(); i != _crossfades.end(); i++) { (t->*func) (*i); |