summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/disk_reader.h
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-02-05 20:51:33 +0100
committerRobin Gareus <robin@gareus.org>2019-02-05 23:29:31 +0100
commit007c4ffdc0bb8a6de967e499885284b2d3b3d0c2 (patch)
treece6815467083ef1a6e672700aa6079dc370432ab /libs/ardour/ardour/disk_reader.h
parent3cc3074dc7e964275db7184cc0ff4213fb84d272 (diff)
Towards a new disk-reader ringbuffer
This is mainly a NO-OP, introducing a new PlaybackBuffer type and preparing for its use. At this point in time, the buffer is just a power-of-two sized ringbuffer and the disk-reader's read-logic is still unchanged. Eventually the read and write sample position that are currently private to the disk-reader can be migrated to be owned by the buffer. Also Diskreader::read() positions can be matched to read-position .. +/- buffer reservation and de-click can read w/o committing the read.
Diffstat (limited to 'libs/ardour/ardour/disk_reader.h')
-rw-r--r--libs/ardour/ardour/disk_reader.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/libs/ardour/ardour/disk_reader.h b/libs/ardour/ardour/disk_reader.h
index 47139efd5b..7ccfa0b3d9 100644
--- a/libs/ardour/ardour/disk_reader.h
+++ b/libs/ardour/ardour/disk_reader.h
@@ -63,7 +63,7 @@ public:
/* called by the Butler in a non-realtime context */
int do_refill () {
- return refill (_mixdown_buffer, _gain_buffer, 0);
+ return refill (_sum_buffer, _mixdown_buffer, _gain_buffer, 0);
}
/** For non-butler contexts (allocates temporary working buffers)
@@ -130,7 +130,6 @@ private:
with respect to the transport sample. This is used for latency compensation.
*/
samplepos_t overwrite_sample;
- off_t overwrite_offset;
bool _pending_overwrite;
bool overwrite_queued;
IOChange input_change_pending;
@@ -144,16 +143,20 @@ private:
static samplecnt_t midi_readahead;
static bool _no_disk_output;
- int audio_read (Sample* buf, Sample* mixdown_buffer, float* gain_buffer,
+ int audio_read (PBD::PlaybackBuffer<Sample>*,
+ Sample* sum_buffer,
+ Sample* mixdown_buffer,
+ float* gain_buffer,
samplepos_t& start, samplecnt_t cnt,
int channel, bool reversed);
int midi_read (samplepos_t& start, samplecnt_t cnt, bool reversed);
+ static Sample* _sum_buffer;
static Sample* _mixdown_buffer;
static gain_t* _gain_buffer;
- int refill (Sample* mixdown_buffer, float* gain_buffer, samplecnt_t fill_level);
- int refill_audio (Sample *mixdown_buffer, float *gain_buffer, samplecnt_t fill_level);
+ int refill (Sample* sum_buffer, Sample* mixdown_buffer, float* gain_buffer, samplecnt_t fill_level);
+ int refill_audio (Sample* sum_buffer, Sample *mixdown_buffer, float *gain_buffer, samplecnt_t fill_level);
int refill_midi ();
sampleoffset_t calculate_playback_distance (pframes_t);