#include <string>
-#include <ardour/filesource.h>
+#include <ardour/sndfilesource.h>
struct tm;
namespace ARDOUR {
-class DestructiveFileSource : public FileSource {
+class DestructiveFileSource : public SndFileSource {
public:
- DestructiveFileSource (std::string path, jack_nframes_t rate, bool repair_first = false, SampleFormat samp_format=FormatInt24);
- DestructiveFileSource (const XMLNode&, jack_nframes_t rate);
+ DestructiveFileSource (Session&, std::string path, SampleFormat samp_format, HeaderFormat hdr_format, nframes_t rate,
+ Flag flags = AudioFileSource::Flag (AudioFileSource::Writable));
+
+ DestructiveFileSource (Session&, std::string path, Flag flags);
+
+ DestructiveFileSource (Session&, const XMLNode&);
~DestructiveFileSource ();
- int seek (jack_nframes_t frame);
- jack_nframes_t last_capture_start_frame() const;
- void mark_capture_start (jack_nframes_t);
+ nframes_t last_capture_start_frame() const;
+ void mark_capture_start (nframes_t);
void mark_capture_end ();
void clear_capture_marks();
- jack_nframes_t write (Sample *src, jack_nframes_t cnt, char * workbuf);
-
XMLNode& get_state ();
- static void setup_standard_crossfades (jack_nframes_t sample_rate);
+ static void setup_standard_crossfades (nframes_t sample_rate);
+
+ int read_peaks (PeakData *peaks, nframes_t npeaks, nframes_t start, nframes_t cnt, double samples_per_unit) const;
+
+ protected:
+ nframes_t write_unlocked (Sample *src, nframes_t cnt);
+
+ virtual void handle_header_position_change ();
private:
- static jack_nframes_t xfade_frames;
+ static nframes_t xfade_frames;
static gain_t* out_coefficient;
static gain_t* in_coefficient;
bool _capture_start;
bool _capture_end;
- jack_nframes_t capture_start_frame;
- jack_nframes_t file_pos; // unit is frames
+ nframes_t capture_start_frame;
+ nframes_t file_pos; // unit is frames
Sample* xfade_buf;
- jack_nframes_t crossfade (Sample* data, jack_nframes_t cnt, int dir, char * workbuf);
-
+ void init ();
+ nframes_t crossfade (Sample* data, nframes_t cnt, int dir);
+ void set_timeline_position (nframes_t);
};
}