summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/sndfilesource.h
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-11-03 02:41:56 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-11-03 02:41:56 +0000
commit45d35d0732e18501762dc7c9bc87b519c2590447 (patch)
tree7d7a9b3ec7b0d06075f5a49bca2667b9266e2d44 /libs/ardour/ardour/sndfilesource.h
parentc6468d181f28654b90a9e5686a662f6696c130f5 (diff)
move all destructive functionality into SndFileSource as a mode, and drop DestructiveFileSource; make ardour save changes to destructive-xfade-msecs
git-svn-id: svn://localhost/ardour2/trunk@1065 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/sndfilesource.h')
-rw-r--r--libs/ardour/ardour/sndfilesource.h33
1 files changed, 29 insertions, 4 deletions
diff --git a/libs/ardour/ardour/sndfilesource.h b/libs/ardour/ardour/sndfilesource.h
index 6302d88967..b810cb538b 100644
--- a/libs/ardour/ardour/sndfilesource.h
+++ b/libs/ardour/ardour/sndfilesource.h
@@ -36,10 +36,7 @@ class SndFileSource : public AudioFileSource {
/* constructor to be called for new in-session files */
SndFileSource (Session&, std::string path, SampleFormat samp_format, HeaderFormat hdr_format, nframes_t rate,
- Flag flags = AudioFileSource::Flag (AudioFileSource::Writable|
- AudioFileSource::Removable|
- AudioFileSource::RemovableIfEmpty|
- AudioFileSource::CanRename));
+ Flag flags = SndFileSource::default_writable_flags);
/* constructor to be called for existing in-session files */
@@ -53,6 +50,16 @@ class SndFileSource : public AudioFileSource {
nframes_t natural_position () const;
+ nframes_t last_capture_start_frame() const;
+ void mark_capture_start (nframes_t);
+ void mark_capture_end ();
+ void clear_capture_marks();
+
+ bool set_destructive (bool yn);
+
+ static void setup_standard_crossfades (nframes_t sample_rate);
+ static const AudioFileSource::Flag default_writable_flags;
+
protected:
void set_header_timeline_position ();
@@ -73,6 +80,24 @@ class SndFileSource : public AudioFileSource {
int open();
void close();
int setup_broadcast_info (nframes_t when, struct tm&, time_t);
+
+ /* destructive */
+
+ static nframes_t xfade_frames;
+ static gain_t* out_coefficient;
+ static gain_t* in_coefficient;
+
+ bool _capture_start;
+ bool _capture_end;
+ nframes_t capture_start_frame;
+ nframes_t file_pos; // unit is frames
+ Sample* xfade_buf;
+
+ nframes_t crossfade (Sample* data, nframes_t cnt, int dir);
+ void set_timeline_position (nframes_t);
+ nframes_t destructive_write_unlocked (Sample *dst, nframes_t cnt);
+ nframes_t nondestructive_write_unlocked (Sample *dst, nframes_t cnt);
+ void handle_header_position_change ();
};
} // namespace ARDOUR