This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-#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"
- : AudioRegion (in->session(), position, length, "foobar"),
+ : AudioRegion (in->session(), position, length, in->name() + string ("<>") + out->name()),
_fade_in (Evoral::Parameter(FadeInAutomation)), // linear (gain coefficient) => -inf..+6dB
_fade_out (Evoral::Parameter(FadeOutAutomation)) // linear (gain coefficient) => -inf..+6dB
_fade_in (Evoral::Parameter(FadeInAutomation)), // linear (gain coefficient) => -inf..+6dB
_fade_out (Evoral::Parameter(FadeOutAutomation)) // linear (gain coefficient) => -inf..+6dB
_fixed = true;
initialize ();
}
Crossfade::Crossfade (boost::shared_ptr<AudioRegion> a, boost::shared_ptr<AudioRegion> b, CrossfadeModel model, bool act)
_fixed = true;
initialize ();
}
Crossfade::Crossfade (boost::shared_ptr<AudioRegion> a, boost::shared_ptr<AudioRegion> b, CrossfadeModel model, bool act)
- : AudioRegion (a->session(), 0, 0, "foobar"),
+ : AudioRegion (a->session(), 0, 0, a->name() + string ("<>") + b->name()),
_fade_in (Evoral::Parameter(FadeInAutomation)), // linear (gain coefficient) => -inf..+6dB
_fade_out (Evoral::Parameter(FadeOutAutomation)) // linear (gain coefficient) => -inf..+6dB
{
_in_update = false;
_fixed = false;
_fade_in (Evoral::Parameter(FadeInAutomation)), // linear (gain coefficient) => -inf..+6dB
_fade_out (Evoral::Parameter(FadeOutAutomation)) // linear (gain coefficient) => -inf..+6dB
{
_in_update = false;
_fixed = false;
if (compute (a, b, model)) {
throw failed_constructor();
if (compute (a, b, model)) {
throw failed_constructor();
- : AudioRegion (playlist.session(), 0, 0, "foobar"),
+ : AudioRegion (playlist.session(), 0, 0, "unnamed crossfade"),
_fade_in (Evoral::Parameter(FadeInAutomation)), // linear (gain coefficient) => -inf..+6dB
_fade_out (Evoral::Parameter(FadeOutAutomation)) // linear (gain coefficient) => -inf..+6dB
_fade_in (Evoral::Parameter(FadeInAutomation)), // linear (gain coefficient) => -inf..+6dB
_fade_out (Evoral::Parameter(FadeOutAutomation)) // linear (gain coefficient) => -inf..+6dB
layer_relation = (int32_t) (_in->layer() - _out->layer());
// Let's make sure the fade isn't too long
layer_relation = (int32_t) (_in->layer() - _out->layer());
// Let's make sure the fade isn't too long
_sources.insert (_sources.end(), _out->sources().begin(), _out->sources().end());
_master_sources = _in->master_sources();
_master_sources.insert(_master_sources.end(), _out->master_sources().begin(), _out->master_sources().end());
_sources.insert (_sources.end(), _out->sources().begin(), _out->sources().end());
_master_sources = _in->master_sources();
_master_sources.insert(_master_sources.end(), _out->master_sources().begin(), _out->master_sources().end());
overlap_type = _in->coverage (_out->position(), _out->last_frame());
layer_relation = (int32_t) (_in->layer() - _out->layer());
overlap_type = _in->coverage (_out->position(), _out->last_frame());
layer_relation = (int32_t) (_in->layer() - _out->layer());
-nframes_t
-Crossfade::read_raw_internal (Sample* buf, sframes_t start, nframes_t cnt) const
+nframes_t
+Crossfade::read_raw_internal (Sample* /*buf*/, sframes_t /*start*/, nframes_t cnt, int /*channel*/) const
float *gain_buffer, sframes_t start, nframes_t cnt, uint32_t chan_n,
nframes_t read_frames, nframes_t skip_frames) const
{
float *gain_buffer, sframes_t start, nframes_t cnt, uint32_t chan_n,
nframes_t read_frames, nframes_t skip_frames) const
{
/* note: although we have not explicitly taken into account the return values
from _out->read_at() or _in->read_at(), the length() function does this
implicitly. why? because it computes a value based on the in+out regions'
/* note: although we have not explicitly taken into account the return values
from _out->read_at() or _in->read_at(), the length() function does this
implicitly. why? because it computes a value based on the in+out regions'
Crossfade::coverage (nframes_t start, nframes_t end) const
{
nframes_t my_end = _position + _length;
Crossfade::coverage (nframes_t start, nframes_t end) const
{
nframes_t my_end = _position + _length;
if (_out->muted() || _in->muted()) {
Invalidated (shared_from_this ());
return false;
}
/* Top layer shouldn't be transparent */
if (_out->muted() || _in->muted()) {
Invalidated (shared_from_this ());
return false;
}
/* Top layer shouldn't be transparent */
/* OK, time to do more regular overlapping */
OverlapType ot = top->coverage (bottom->first_frame(), bottom->last_frame());
/* OK, time to do more regular overlapping */
OverlapType ot = top->coverage (bottom->first_frame(), bottom->last_frame());
prop = (*i)->property ("x");
sscanf (prop->value().c_str(), "%" PRIu32, &x);
prop = (*i)->property ("x");
sscanf (prop->value().c_str(), "%" PRIu32, &x);
prop = (*i)->property ("y");
sscanf (prop->value().c_str(), "%f", &y);
prop = (*i)->property ("y");
sscanf (prop->value().c_str(), "%f", &y);
prop = (*i)->property ("y");
sscanf (prop->value().c_str(), "%f", &y);
prop = (*i)->property ("y");
sscanf (prop->value().c_str(), "%f", &y);