diff options
Diffstat (limited to 'libs/ardour/destructive_filesource.cc')
-rw-r--r-- | libs/ardour/destructive_filesource.cc | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/libs/ardour/destructive_filesource.cc b/libs/ardour/destructive_filesource.cc index e160ffd608..fcd85bfe8f 100644 --- a/libs/ardour/destructive_filesource.cc +++ b/libs/ardour/destructive_filesource.cc @@ -55,8 +55,10 @@ typedef off_t off64_t; #include <fcntl.h> #include <pbd/error.h> +#include <pbd/stacktrace.h> #include <ardour/destructive_filesource.h> #include <ardour/utils.h> +#include <ardour/session.h> #include "i18n.h" @@ -289,7 +291,7 @@ DestructiveFileSource::write_unlocked (Sample* data, nframes_t cnt) _capture_end = false; /* move to the correct location place */ - file_pos = capture_start_frame; + file_pos = capture_start_frame - timeline_position; // split cnt in half nframes_t subcnt = cnt / 2; @@ -343,17 +345,16 @@ DestructiveFileSource::write_unlocked (Sample* data, nframes_t cnt) } else { /* in the middle of recording */ - if (write_float (data, file_pos, cnt) != cnt) { return 0; } } - + old_file_pos = file_pos; update_length (file_pos, cnt); file_pos += cnt; - + if (_build_peakfiles) { PeakBuildRecord *pbr = 0; @@ -409,7 +410,15 @@ DestructiveFileSource::handle_header_position_change () } void -DestructiveFileSource::set_timeline_position (nframes_t pos) +DestructiveFileSource::set_timeline_position (int64_t) { //destructive track timeline postion does not change except at instantion or when header_position_offset (session start) changes } + +int +DestructiveFileSource::read_peaks (PeakData *peaks, nframes_t npeaks, nframes_t start, nframes_t cnt, double samples_per_unit) const +{ + // cerr << _name << " read peaks at " << start << " for " << cnt << " tpos = " << timeline_position << endl; + return AudioFileSource::read_peaks (peaks, npeaks, start, cnt, samples_per_unit); +} + |