#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);
- DestructiveFileSource (const XMLNode&, jack_nframes_t rate);
+ DestructiveFileSource (std::string path, SampleFormat samp_format, HeaderFormat hdr_format, jack_nframes_t rate,
+ Flag flags = AudioFileSource::Flag (AudioFileSource::Writable));
+
+ DestructiveFileSource (std::string path, Flag flags);
+
+ DestructiveFileSource (const XMLNode&);
~DestructiveFileSource ();
- int seek (jack_nframes_t frame);
- void mark_capture_start ();
+ jack_nframes_t last_capture_start_frame() const;
+ void mark_capture_start (jack_nframes_t);
void mark_capture_end ();
void clear_capture_marks();
- jack_nframes_t write (Sample *src, jack_nframes_t cnt);
+ XMLNode& get_state ();
+
+ static void setup_standard_crossfades (jack_nframes_t sample_rate);
+
+ protected:
+ jack_nframes_t write_unlocked (Sample *src, jack_nframes_t cnt, char * workbuf);
+
+ virtual void handle_header_position_change ();
private:
static jack_nframes_t xfade_frames;
static gain_t* out_coefficient;
static gain_t* in_coefficient;
- static void setup_standard_crossfades (jack_nframes_t sample_rate);
bool _capture_start;
bool _capture_end;
- jack_nframes_t file_pos;
+ jack_nframes_t capture_start_frame;
+ jack_nframes_t file_pos; // unit is frames
Sample* xfade_buf;
- jack_nframes_t crossfade (Sample* data, jack_nframes_t cnt, int dir);
-
+ void init ();
+ jack_nframes_t crossfade (Sample* data, jack_nframes_t cnt, int dir, char * workbuf);
+ void set_timeline_position (jack_nframes_t);
};
}