summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-11-03 14:25:54 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-11-03 14:25:54 +0000
commit975e44f92480f8ce170637d6b58b48a06e34ca7c (patch)
tree11b00236fe62ab2b93e03382264f2b8c14ea9e11
parentd2d243ad08cb9588411ea85c8d08f1d19f427dc3 (diff)
new tape tracks ended up with non-destructive sources, fixed
git-svn-id: svn://localhost/ardour2/trunk@1067 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--libs/ardour/sndfilesource.cc9
-rw-r--r--libs/ardour/source_factory.cc7
-rw-r--r--libs/ardour/utils.cc2
3 files changed, 10 insertions, 8 deletions
diff --git a/libs/ardour/sndfilesource.cc b/libs/ardour/sndfilesource.cc
index 378b62ea04..2ebd27e637 100644
--- a/libs/ardour/sndfilesource.cc
+++ b/libs/ardour/sndfilesource.cc
@@ -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;
}
diff --git a/libs/ardour/source_factory.cc b/libs/ardour/source_factory.cc
index d83533ca09..cb36d3cc35 100644
--- a/libs/ardour/source_factory.cc
+++ b/libs/ardour/source_factory.cc
@@ -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>();
diff --git a/libs/ardour/utils.cc b/libs/ardour/utils.cc
index 6cbb8e0c44..f346f2a8a6 100644
--- a/libs/ardour/utils.cc
+++ b/libs/ardour/utils.cc
@@ -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);