- delete touched_regions;
-}
-
-void
-AudioPlaylist::add_crossfade (boost::shared_ptr<Crossfade> xfade)
-{
- Crossfades::iterator ci;
-
- for (ci = _crossfades.begin(); ci != _crossfades.end(); ++ci) {
- if (*(*ci) == *xfade) { // Crossfade::operator==()
- break;
- }
- }
-
- if (ci != _crossfades.end()) {
- // it will just go away
- } else {
- _crossfades.push_back (xfade);
-
- 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);
- }
-}
-
-void AudioPlaylist::notify_crossfade_added (boost::shared_ptr<Crossfade> x)
-{
- if (g_atomic_int_get(&block_notifications)) {
- _pending_xfade_adds.insert (_pending_xfade_adds.end(), x);
- } else {
- NewCrossfade (x); /* EMIT SIGNAL */
- }
-}
-
-void
-AudioPlaylist::crossfade_invalidated (boost::shared_ptr<Region> r)
-{
- Crossfades::iterator i;
- boost::shared_ptr<Crossfade> xfade = boost::dynamic_pointer_cast<Crossfade> (r);
-
- xfade->in()->resume_fade_in ();
- xfade->out()->resume_fade_out ();
-
- if ((i = find (_crossfades.begin(), _crossfades.end(), xfade)) != _crossfades.end()) {
- _crossfades.erase (i);
- }
-}
-
-int
-AudioPlaylist::set_state (const XMLNode& node, int version)
-{
- XMLNode *child;
- XMLNodeList nlist;
- XMLNodeConstIterator niter;
-
- in_set_state++;
-
- Playlist::set_state (node, version);
-
- freeze ();
-
- nlist = node.children();
-
- for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
-
- child = *niter;
-
- if (child->name() != "Crossfade") {
- continue;
- }
-
- try {
- boost::shared_ptr<Crossfade> xfade = boost::shared_ptr<Crossfade> (new Crossfade (*((const Playlist *)this), *child));
- _crossfades.push_back (xfade);
- 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);
- }
-
- catch (failed_constructor& err) {
- // cout << string_compose (_("could not create crossfade object in playlist %1"),
- // _name)
- // << endl;
- continue;