mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-27 08:57:41 +01:00
new tape tracks ended up with non-destructive sources, fixed
git-svn-id: svn://localhost/ardour2/trunk@1067 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
d2d243ad08
commit
975e44f924
3 changed files with 10 additions and 8 deletions
|
|
@ -805,7 +805,7 @@ SndFileSource::crossfade (Sample* data, nframes_t cnt, int fade_in)
|
|||
}
|
||||
}
|
||||
|
||||
} else if (xfade) {
|
||||
} else if (xfade < xfade_frames) {
|
||||
|
||||
gain_t in[xfade];
|
||||
gain_t out[xfade];
|
||||
|
|
@ -817,6 +817,11 @@ SndFileSource::crossfade (Sample* data, nframes_t cnt, int fade_in)
|
|||
for (nframes_t n = 0; n < xfade; ++n) {
|
||||
xfade_buf[n] = (xfade_buf[n] * out[n]) + (fade_data[n] * in[n]);
|
||||
}
|
||||
|
||||
} else if (xfade) {
|
||||
|
||||
/* long xfade length, has to be computed across several calls */
|
||||
|
||||
}
|
||||
|
||||
if (xfade) {
|
||||
|
|
@ -865,8 +870,6 @@ SndFileSource::setup_standard_crossfades (nframes_t rate)
|
|||
|
||||
xfade_frames = (nframes_t) floor ((Config->get_destructive_xfade_msecs () / 1000.0) * rate);
|
||||
|
||||
cerr << "based on " << Config->get_destructive_xfade_msecs() << " msecs, xfade_frames = " << xfade_frames << endl;
|
||||
|
||||
if (out_coefficient) {
|
||||
delete [] out_coefficient;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -156,15 +156,14 @@ boost::shared_ptr<Source>
|
|||
SourceFactory::createWritable (Session& s, std::string path, bool destructive, nframes_t rate, bool announce)
|
||||
{
|
||||
/* this might throw failed_constructor(), which is OK */
|
||||
|
||||
|
||||
boost::shared_ptr<Source> ret (new SndFileSource
|
||||
(s, path,
|
||||
Config->get_native_file_data_format(),
|
||||
Config->get_native_file_header_format(),
|
||||
rate,
|
||||
(destructive ? SndFileSource::default_writable_flags :
|
||||
AudioFileSource::Flag
|
||||
(SndFileSource::default_writable_flags | AudioFileSource::Destructive))));
|
||||
(destructive ? AudioFileSource::Flag (SndFileSource::default_writable_flags | AudioFileSource::Destructive) :
|
||||
SndFileSource::default_writable_flags)));
|
||||
|
||||
if (setup_peakfile (ret)) {
|
||||
return boost::shared_ptr<Source>();
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ compute_equal_power_fades (nframes_t nframes, float* in, float* out)
|
|||
const float pan_law_attenuation = -3.0f;
|
||||
const float scale = 2.0f - 4.0f * powf (10.0f,pan_law_attenuation/20.0f);
|
||||
|
||||
for (unsigned long n = 0; n < nframes; ++n) {
|
||||
for (nframes_t n = 0; n < nframes; ++n) {
|
||||
float inVal = in[n];
|
||||
float outVal = 1 - inVal;
|
||||
out[n] = outVal * (scale * outVal + 1.0f - scale);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue