void
DestructiveFileSource::setup_standard_crossfades (jack_nframes_t rate)
{
- xfade_frames = (jack_nframes_t) floor ((/*Config->get_destructive_crossfade_msecs()*/ 64 / 1000.0) * rate);
+ xfade_frames = (jack_nframes_t) floor ((Config->get_destructive_xfade_msecs () / 1000.0) * rate);
+
+ if (out_coefficient) {
+ delete [] out_coefficient;
+ }
+
+ if (in_coefficient) {
+ delete [] in_coefficient;
+ }
out_coefficient = new gain_t[xfade_frames];
in_coefficient = new gain_t[xfade_frames];
jack_nframes_t
DestructiveFileSource::write (Sample* data, jack_nframes_t cnt, char * workbuf)
{
- cerr << _name << ": write " << cnt << " to " << file_pos << " start ? " << _capture_start << " end ? " << _capture_end << endl;
-
{
- LockMonitor lm (_lock, __LINE__, __FILE__);
+ Glib::Mutex::Lock lm (_lock);
jack_nframes_t old_file_pos;
/* move to the correct location place */
file_pos = capture_start_frame;
- cerr << "First frame of capture will be at " << file_pos << " and last at: " << file_pos + cnt << endl;
-
// split cnt in half
jack_nframes_t subcnt = cnt / 2;
jack_nframes_t ofilepos = file_pos;
/* move to the correct location place */
file_pos = capture_start_frame;
- cerr << "First frame of capture will be at " << file_pos << endl;
-
if (crossfade (data, cnt, 1, workbuf) != cnt) {
return 0;
}
}
file_pos += cnt;
- //cerr << this << ' ' << _name << " at end of write, file_pos = " << file_pos << " length = " << ((int) &_length - (int) this) << ' ' << &_length << ' ' << _length << endl;
-
if (_build_peakfiles) {
PeakBuildRecord *pbr = 0;