X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=libs%2Fardour%2Faudio_playlist.cc;h=6e8b35a07238e8661058cef8f5453f42ab9fa85d;hb=7720d0d109ca47c2a0a23883d5831de1ff32005d;hp=eb4913e72778ab2f4e05991d93b0bc7b3ebf6642;hpb=8713667ec1a6cc9ba56c07f763e5a422cc47fbef;p=ardour.git diff --git a/libs/ardour/audio_playlist.cc b/libs/ardour/audio_playlist.cc index eb4913e727..6e8b35a072 100644 --- a/libs/ardour/audio_playlist.cc +++ b/libs/ardour/audio_playlist.cc @@ -21,7 +21,6 @@ #include -#include #include "ardour/types.h" #include "ardour/configuration.h" @@ -35,7 +34,6 @@ #include "i18n.h" using namespace ARDOUR; -using namespace sigc; using namespace std; using namespace PBD; @@ -104,12 +102,6 @@ AudioPlaylist::AudioPlaylist (boost::shared_ptr other, nfra AudioPlaylist::~AudioPlaylist () { - GoingAway (); /* EMIT SIGNAL */ - - /* drop connections to signals */ - - notify_callbacks (); - _crossfades.clear (); } @@ -351,7 +343,7 @@ AudioPlaylist::check_dependents (boost::shared_ptr r, bool norefresh) boost::shared_ptr top; boost::shared_ptr bottom; boost::shared_ptr xfade; - RegionList* touched_regions; + RegionList* touched_regions = 0; if (in_set_state || in_partition) { return; @@ -401,6 +393,9 @@ AudioPlaylist::check_dependents (boost::shared_ptr r, bool norefresh) OverlapType c = top->coverage (bottom->position(), bottom->last_frame()); + delete touched_regions; + touched_regions = 0; + try { switch (c) { case OverlapNone: @@ -425,7 +420,7 @@ AudioPlaylist::check_dependents (boost::shared_ptr r, bool norefresh) audio engineering. */ - xfade_length = min ((nframes_t) 720, top->length()); + xfade_length = min ((framecnt_t) 720, top->length()); if (top_region_at (top->first_frame()) == top) { @@ -459,7 +454,7 @@ AudioPlaylist::check_dependents (boost::shared_ptr r, bool norefresh) } else { touched_regions = regions_touched (top->first_frame(), - top->first_frame() + min ((nframes_t)_session.config.get_short_xfade_seconds() * _session.frame_rate(), + top->first_frame() + min ((framecnt_t) _session.config.get_short_xfade_seconds() * _session.frame_rate(), top->length())); if (touched_regions->size() <= 2) { xfade = boost::shared_ptr (new Crossfade (region, other, _session.config.get_xfade_model(), _session.config.get_xfades_active())); @@ -485,7 +480,7 @@ AudioPlaylist::check_dependents (boost::shared_ptr r, bool norefresh) } else { touched_regions = regions_touched (bottom->first_frame(), - bottom->first_frame() + min ((nframes_t)_session.config.get_short_xfade_seconds() * _session.frame_rate(), + bottom->first_frame() + min ((framecnt_t)_session.config.get_short_xfade_seconds() * _session.frame_rate(), bottom->length())); if (touched_regions->size() <= 2) { xfade = boost::shared_ptr (new Crossfade (region, other, _session.config.get_xfade_model(), _session.config.get_xfades_active())); @@ -509,6 +504,8 @@ AudioPlaylist::check_dependents (boost::shared_ptr r, bool norefresh) } } + + delete touched_regions; } void @@ -527,8 +524,8 @@ AudioPlaylist::add_crossfade (boost::shared_ptr xfade) } else { _crossfades.push_back (xfade); - xfade->Invalidated.connect (mem_fun (*this, &AudioPlaylist::crossfade_invalidated)); - xfade->StateChanged.connect (mem_fun (*this, &AudioPlaylist::crossfade_changed)); + xfade->Invalidated.connect_same_thread (*this, boost::bind (&AudioPlaylist::crossfade_invalidated, this, _1)); + xfade->PropertyChanged.connect_same_thread (*this, boost::bind (&AudioPlaylist::crossfade_changed, this, _1)); notify_crossfade_added (xfade); } @@ -583,8 +580,8 @@ AudioPlaylist::set_state (const XMLNode& node, int version) try { boost::shared_ptr xfade = boost::shared_ptr (new Crossfade (*((const Playlist *)this), *child)); _crossfades.push_back (xfade); - xfade->Invalidated.connect (mem_fun (*this, &AudioPlaylist::crossfade_invalidated)); - xfade->StateChanged.connect (mem_fun (*this, &AudioPlaylist::crossfade_changed)); + xfade->Invalidated.connect_same_thread (*this, boost::bind (&AudioPlaylist::crossfade_invalidated, this, _1)); + xfade->PropertyChanged.connect_same_thread (*this, boost::bind (&AudioPlaylist::crossfade_changed, this, _1)); NewCrossfade(xfade); } @@ -729,7 +726,7 @@ AudioPlaylist::destroy_region (boost::shared_ptr region) } void -AudioPlaylist::crossfade_changed (Change) +AudioPlaylist::crossfade_changed (const PropertyChange&) { if (in_flush || in_set_state) { return; @@ -741,29 +738,32 @@ AudioPlaylist::crossfade_changed (Change) that occured. */ - notify_modified (); + notify_contents_changed (); } bool -AudioPlaylist::region_changed (Change what_changed, boost::shared_ptr region) +AudioPlaylist::region_changed (const PropertyChange& what_changed, boost::shared_ptr region) { if (in_flush || in_set_state) { return false; } - Change our_interests = Change (AudioRegion::FadeInChanged| - AudioRegion::FadeOutChanged| - AudioRegion::FadeInActiveChanged| - AudioRegion::FadeOutActiveChanged| - AudioRegion::EnvelopeActiveChanged| - AudioRegion::ScaleAmplitudeChanged| - AudioRegion::EnvelopeChanged); + PropertyChange our_interests; + + our_interests.add (Properties::fade_in_active); + our_interests.add (Properties::fade_out_active); + our_interests.add (Properties::scale_amplitude); + our_interests.add (Properties::envelope_active); + our_interests.add (Properties::envelope); + our_interests.add (Properties::fade_in); + our_interests.add (Properties::fade_out); + bool parent_wants_notify; parent_wants_notify = Playlist::region_changed (what_changed, region); - if ((parent_wants_notify || (what_changed & our_interests))) { - notify_modified (); + if (parent_wants_notify || (what_changed.contains (our_interests))) { + notify_contents_changed (); } return true; @@ -787,7 +787,7 @@ AudioPlaylist::crossfades_at (nframes_t frame, Crossfades& clist) } void -AudioPlaylist::foreach_crossfade (sigc::slot > s) +AudioPlaylist::foreach_crossfade (boost::function)> s) { RegionLock rl (this, false); for (Crossfades::iterator i = _crossfades.begin(); i != _crossfades.end(); ++i) {