#include <sigc++/bind.h>
-#include <pbd/stacktrace.h>
+#include "pbd/stacktrace.h"
-#include <ardour/types.h>
-#include <ardour/crossfade.h>
-#include <ardour/crossfade_compare.h>
-#include <ardour/audioregion.h>
-#include <ardour/playlist.h>
-#include <ardour/utils.h>
-#include <ardour/session.h>
-#include <ardour/source.h>
+#include "ardour/types.h"
+#include "ardour/crossfade.h"
+#include "ardour/crossfade_compare.h"
+#include "ardour/audioregion.h"
+#include "ardour/playlist.h"
+#include "ardour/utils.h"
+#include "ardour/session.h"
+#include "ardour/source.h"
#include "i18n.h"
#include <locale.h>
_anchor_point = ap;
_follow_overlap = false;
- _active = Config->get_xfades_active ();
+ _active = _session.config.get_xfades_active ();
_fixed = true;
initialize ();
{
_in_update = false;
_fixed = false;
+ _follow_overlap = false;
if (compute (a, b, model)) {
throw failed_constructor();
_active = act;
initialize ();
-
-
}
Crossfade::Crossfade (const Playlist& playlist, XMLNode& node)
layer_relation = (int32_t) (_in->layer() - _out->layer());
// Let's make sure the fade isn't too long
- set_length(_length);
+ set_xfade_length(_length);
}
}
nframes_t
-Crossfade::read_raw_internal (Sample* buf, nframes_t start, nframes_t cnt) const
+Crossfade::read_raw_internal (Sample* /*buf*/, sframes_t /*start*/, nframes_t cnt, int /*channel*/) const
{
+ // FIXME: Why is this disabled?
#if 0
Sample* mixdown = new Sample[cnt];
float* gain = new float[cnt];
nframes_t
Crossfade::read_at (Sample *buf, Sample *mixdown_buffer,
- float *gain_buffer, nframes_t start, nframes_t cnt, uint32_t chan_n,
+ float *gain_buffer, sframes_t start, nframes_t cnt, uint32_t chan_n,
nframes_t read_frames, nframes_t skip_frames) const
{
nframes_t offset;
} else {
- to_write = min (_length - (start - _position), cnt);
+ to_write = min (nframes_t(_length - (start - _position)), cnt);
}
int32_t new_layer_relation = (int32_t) (_in->layer() - _out->layer());
- if (new_layer_relation * layer_relation < 0) { // different sign, layers rotated
+ if (new_layer_relation * layer_relation < 0) { // different sign, layers rotated
Invalidated (shared_from_this ());
return false;
}
if (_follow_overlap) {
try {
- compute (_in, _out, Config->get_xfade_model());
+ compute (_in, _out, _session.config.get_xfade_model());
}
catch (NoCrossfadeHere& err) {
send_signal = true;
} else {
-
Invalidated (shared_from_this ());
return false;
}
_follow_overlap = yn;
if (!yn) {
- set_length (_short_xfade_length);
+ set_xfade_length (_short_xfade_length);
} else {
- set_length (_out->first_frame() + _out->length() - _in->first_frame());
+ set_xfade_length (_out->first_frame() + _out->length() - _in->first_frame());
}
StateChanged (FollowOverlapChanged);
}
nframes_t
-Crossfade::set_length (nframes_t len)
+Crossfade::set_xfade_length (nframes_t len)
{
nframes_t limit = 0;
{
_short_xfade_length = n;
}
-
-void
-Crossfade::invalidate ()
-{
- Invalidated (shared_from_this ()); /* EMIT SIGNAL */
-}