diff --git a/ardour.rc.in b/ardour.rc.in
index 6488d0ed82..735b19c233 100644
--- a/ardour.rc.in
+++ b/ardour.rc.in
@@ -21,6 +21,9 @@
+
+
+
diff --git a/gtk2_ardour/audio_streamview.cc b/gtk2_ardour/audio_streamview.cc
index 3cca792523..0e6997b59c 100644
--- a/gtk2_ardour/audio_streamview.cc
+++ b/gtk2_ardour/audio_streamview.cc
@@ -288,7 +288,7 @@ AudioStreamView::add_crossfade (Crossfade *crossfade)
crossfade->Invalidated.connect (mem_fun (*this, &AudioStreamView::remove_crossfade));
crossfade_views.push_back (cv);
- if (!crossfades_visible) {
+ if (!Config->get_crossfades_visible() || !crossfades_visible) {
cv->hide ();
}
}
diff --git a/gtk2_ardour/crossfade_view.cc b/gtk2_ardour/crossfade_view.cc
index baf0f2a346..42a1a47227 100644
--- a/gtk2_ardour/crossfade_view.cc
+++ b/gtk2_ardour/crossfade_view.cc
@@ -127,6 +127,10 @@ CrossfadeView::crossfade_changed (Change what_changed)
set_duration (crossfade.overlap_length(), this);
need_redraw_curves = true;
}
+
+ if (what_changed & Crossfade::FollowOverlapChanged) {
+ need_redraw_curves = true;
+ }
if (what_changed & Crossfade::ActiveChanged) {
/* calls redraw_curves */
@@ -142,9 +146,15 @@ CrossfadeView::redraw_curves ()
Points* points;
int32_t npoints;
float* vec;
-
double h;
+ if (!crossfade.following_overlap()) {
+ /* curves should not be visible */
+ fade_in->hide ();
+ fade_out->hide ();
+ return;
+ }
+
/*
At "height - 3.0" the bottom of the crossfade touches the name highlight or the bottom of the track (if the
track is either Small or Smaller.
diff --git a/libs/ardour/ardour/audioplaylist.h b/libs/ardour/ardour/audioplaylist.h
index 6d67e0f793..383ec73531 100644
--- a/libs/ardour/ardour/audioplaylist.h
+++ b/libs/ardour/ardour/audioplaylist.h
@@ -45,7 +45,7 @@ class AudioPlaylist : public ARDOUR::Playlist
AudioPlaylist (const AudioPlaylist&, string name, bool hidden = false);
AudioPlaylist (const AudioPlaylist&, nframes_t start, nframes_t cnt, string name, bool hidden = false);
- void clear ();
+ void clear (bool with_signals=true);
nframes_t read (Sample *dst, Sample *mixdown, float *gain_buffer, nframes_t start, nframes_t cnt, uint32_t chan_n=0);
diff --git a/libs/ardour/ardour/crossfade.h b/libs/ardour/ardour/crossfade.h
index d1b2e8f1e1..d29ba47056 100644
--- a/libs/ardour/ardour/crossfade.h
+++ b/libs/ardour/ardour/crossfade.h
@@ -108,6 +108,8 @@ class Crossfade : public PBD::StatefulDestructible
nframes_t overlap_length() const;
nframes_t position() const { return _position; }
+ void invalidate();
+
sigc::signal Invalidated;
sigc::signal StateChanged;
@@ -135,6 +137,7 @@ class Crossfade : public PBD::StatefulDestructible
static void set_short_xfade_length (nframes_t n);
static Change ActiveChanged;
+ static Change FollowOverlapChanged;
private:
friend struct CrossfadeComparePtr;
diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h
index 8f08c58466..2d19f661c4 100644
--- a/libs/ardour/ardour/playlist.h
+++ b/libs/ardour/ardour/playlist.h
@@ -55,7 +55,7 @@ class Playlist : public PBD::StatefulDestructible {
Playlist (const Playlist&, string name, bool hidden = false);
Playlist (const Playlist&, nframes_t start, nframes_t cnt, string name, bool hidden = false);
- virtual void clear ();
+ virtual void clear (bool with_signals=true);
virtual void dump () const;
void ref();
@@ -171,6 +171,8 @@ class Playlist : public PBD::StatefulDestructible {
mutable gint block_notifications;
mutable gint ignore_state_changes;
mutable Glib::Mutex region_lock;
+ std::set > pending_adds;
+ std::set > pending_removes;
RegionList pending_bounds;
bool pending_modified;
bool pending_length;
diff --git a/libs/ardour/audio_playlist.cc b/libs/ardour/audio_playlist.cc
index e39be5d402..00c3038d25 100644
--- a/libs/ardour/audio_playlist.cc
+++ b/libs/ardour/audio_playlist.cc
@@ -237,9 +237,9 @@ AudioPlaylist::remove_dependents (boost::shared_ptr region)
tmp = i;
tmp++;
+
if ((*i)->involves (r)) {
- /* do not delete crossfades */
- _crossfades.erase (i);
+ delete *i;
}
i = tmp;
@@ -488,9 +488,7 @@ AudioPlaylist::set_state (const XMLNode& node)
XMLNodeList nlist;
XMLNodeConstIterator niter;
- if (!in_set_state) {
- Playlist::set_state (node);
- }
+ Playlist::set_state (node);
nlist = node.children();
@@ -502,10 +500,12 @@ AudioPlaylist::set_state (const XMLNode& node)
continue;
}
- Crossfade *xfade;
-
try {
- xfade = new Crossfade (*((const Playlist *)this), *child);
+ Crossfade* xfade = 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));
+ NewCrossfade(xfade);
}
catch (failed_constructor& err) {
@@ -514,44 +514,28 @@ AudioPlaylist::set_state (const XMLNode& node)
// << endl;
continue;
}
-
- Crossfades::iterator ci;
-
- for (ci = _crossfades.begin(); ci != _crossfades.end(); ++ci) {
- if (*(*ci) == *xfade) {
- break;
- }
- }
-
- if (ci == _crossfades.end()) {
- _crossfades.push_back (xfade);
- xfade->Invalidated.connect (mem_fun (*this, &AudioPlaylist::crossfade_invalidated));
- xfade->StateChanged.connect (mem_fun (*this, &AudioPlaylist::crossfade_changed));
- NewCrossfade(xfade);
- } else {
-
- /* adjust the current state of the existing crossfade */
-
- (*ci)->set_state (*child);
-
- /* drop the new one */
- delete xfade;
- }
}
return 0;
}
void
-AudioPlaylist::clear ()
+AudioPlaylist::clear (bool with_signals)
{
- for (Crossfades::iterator i = _crossfades.begin(); i != _crossfades.end(); ++i) {
+ for (Crossfades::iterator i = _crossfades.begin(); i != _crossfades.end(); ) {
+
+ Crossfades::iterator tmp;
+ tmp = i;
+ ++tmp;
+
delete *i;
+
+ i = tmp;
}
_crossfades.clear ();
- Playlist::clear ();
+ Playlist::clear (with_signals);
}
XMLNode&
diff --git a/libs/ardour/crossfade.cc b/libs/ardour/crossfade.cc
index a197459971..1c4bdb6cad 100644
--- a/libs/ardour/crossfade.cc
+++ b/libs/ardour/crossfade.cc
@@ -37,6 +37,7 @@ using namespace PBD;
nframes_t Crossfade::_short_xfade_length = 0;
Change Crossfade::ActiveChanged = new_change();
+Change Crossfade::FollowOverlapChanged = new_change();
/* XXX if and when we ever implement parallel processing of the process()
callback, these will need to be handled on a per-thread basis.
@@ -82,8 +83,16 @@ Crossfade::Crossfade (boost::shared_ptr in, boost::shared_ptr