From b32ca9e9d94affba4cb194d57267e185cc6d5553 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 13 Sep 2016 13:31:58 -0500 Subject: change offset arguments to various Buffer::read/merge methods from framecnt_t to frameoffset_t --- libs/ardour/ardour/audio_buffer.h | 18 +++++++++--------- libs/ardour/ardour/midi_buffer.h | 4 ++-- libs/ardour/midi_buffer.cc | 5 ++--- 3 files changed, 13 insertions(+), 14 deletions(-) (limited to 'libs/ardour') diff --git a/libs/ardour/ardour/audio_buffer.h b/libs/ardour/ardour/audio_buffer.h index 9a9653b2c9..7d255c5c50 100644 --- a/libs/ardour/ardour/audio_buffer.h +++ b/libs/ardour/ardour/audio_buffer.h @@ -45,7 +45,7 @@ public: * @param dst_offset offset in destination buffer * @param src_offset start offset in src buffer */ - void read_from (const Sample* src, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) { + void read_from (const Sample* src, framecnt_t len, frameoffset_t dst_offset = 0, frameoffset_t src_offset = 0) { assert(src != 0); assert(_capacity > 0); assert(len <= _capacity); @@ -54,7 +54,7 @@ public: _written = true; } - void read_from_with_gain (const Sample* src, framecnt_t len, gain_t gain, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) { + void read_from_with_gain (const Sample* src, framecnt_t len, gain_t gain, frameoffset_t dst_offset = 0, frameoffset_t src_offset = 0) { assert(src != 0); assert(_capacity > 0); assert(len <= _capacity); @@ -72,7 +72,7 @@ public: * @param dst_offset offset in destination buffer * @param src_offset start offset in src buffer */ - void read_from (const Buffer& src, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) { + void read_from (const Buffer& src, framecnt_t len, frameoffset_t dst_offset = 0, frameoffset_t src_offset = 0) { assert(&src != this); assert(_capacity > 0); assert(src.type() == DataType::AUDIO); @@ -88,14 +88,14 @@ public: } /** Accumulate (add) @a len frames @a src starting at @a src_offset into self starting at @a dst_offset */ - void merge_from (const Buffer& src, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) { + void merge_from (const Buffer& src, framecnt_t len, frameoffset_t dst_offset = 0, frameoffset_t src_offset = 0) { const AudioBuffer* ab = dynamic_cast(&src); assert (ab); accumulate_from (*ab, len, dst_offset, src_offset); } /** Accumulate (add) @a len frames @a src starting at @a src_offset into self starting at @a dst_offset */ - void accumulate_from (const AudioBuffer& src, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) { + void accumulate_from (const AudioBuffer& src, framecnt_t len, frameoffset_t dst_offset = 0, frameoffset_t src_offset = 0) { assert(_capacity > 0); assert(len <= _capacity); @@ -109,7 +109,7 @@ public: } /** Accumulate (add) @a len frames @a src starting at @a src_offset into self starting at @a dst_offset */ - void accumulate_from (const Sample* src, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) { + void accumulate_from (const Sample* src, framecnt_t len, frameoffset_t dst_offset = 0, frameoffset_t src_offset = 0) { assert(_capacity > 0); assert(len <= _capacity); @@ -124,7 +124,7 @@ public: /** Accumulate (add) @a len frames @a src starting at @a src_offset into self starting at @dst_offset * scaling by @a gain_coeff */ - void accumulate_with_gain_from (const AudioBuffer& src, framecnt_t len, gain_t gain_coeff, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) { + void accumulate_with_gain_from (const AudioBuffer& src, framecnt_t len, gain_t gain_coeff, frameoffset_t dst_offset = 0, frameoffset_t src_offset = 0) { assert(_capacity > 0); assert(len <= _capacity); @@ -144,7 +144,7 @@ public: /** Accumulate (add) @a len frames FROM THE START OF @a src into self * scaling by @a gain_coeff */ - void accumulate_with_gain_from (const Sample* src_raw, framecnt_t len, gain_t gain_coeff, framecnt_t dst_offset = 0) { + void accumulate_with_gain_from (const Sample* src_raw, framecnt_t len, gain_t gain_coeff, frameoffset_t dst_offset = 0) { assert(_capacity > 0); assert(len <= _capacity); @@ -159,7 +159,7 @@ public: /** Accumulate (add) @a len frames FROM THE START OF @a src into self * scaling by @a gain_coeff */ - void accumulate_with_ramped_gain_from (const Sample* src, framecnt_t len, gain_t initial, gain_t target, framecnt_t dst_offset = 0) { + void accumulate_with_ramped_gain_from (const Sample* src, framecnt_t len, gain_t initial, gain_t target, frameoffset_t dst_offset = 0) { assert(_capacity > 0); assert(len <= _capacity); diff --git a/libs/ardour/ardour/midi_buffer.h b/libs/ardour/ardour/midi_buffer.h index 2a472e1783..e4a1a3f02c 100644 --- a/libs/ardour/ardour/midi_buffer.h +++ b/libs/ardour/ardour/midi_buffer.h @@ -41,8 +41,8 @@ public: ~MidiBuffer(); void silence (framecnt_t nframes, framecnt_t offset = 0); - void read_from (const Buffer& src, framecnt_t nframes, framecnt_t dst_offset = 0, framecnt_t src_offset = 0); - void merge_from (const Buffer& src, framecnt_t nframes, framecnt_t dst_offset = 0, framecnt_t src_offset = 0); + void read_from (const Buffer& src, framecnt_t nframes, frameoffset_t dst_offset = 0, frameoffset_t src_offset = 0); + void merge_from (const Buffer& src, framecnt_t nframes, frameoffset_t dst_offset = 0, frameoffset_t src_offset = 0); void copy(const MidiBuffer& copy); void copy(MidiBuffer const * const); diff --git a/libs/ardour/midi_buffer.cc b/libs/ardour/midi_buffer.cc index 41d638dc78..87b0274068 100644 --- a/libs/ardour/midi_buffer.cc +++ b/libs/ardour/midi_buffer.cc @@ -95,7 +95,7 @@ MidiBuffer::copy(MidiBuffer const * const copy) * Note that offset and nframes refer to sample time, NOT buffer offsets or event counts. */ void -MidiBuffer::read_from (const Buffer& src, framecnt_t nframes, framecnt_t dst_offset, framecnt_t /* src_offset*/) +MidiBuffer::read_from (const Buffer& src, framecnt_t nframes, frameoffset_t dst_offset, frameoffset_t /* src_offset*/) { assert (src.type() == DataType::MIDI); assert (&src != this); @@ -129,7 +129,7 @@ MidiBuffer::read_from (const Buffer& src, framecnt_t nframes, framecnt_t dst_off } void -MidiBuffer::merge_from (const Buffer& src, framecnt_t /*nframes*/, framecnt_t /*dst_offset*/, framecnt_t /*src_offset*/) +MidiBuffer::merge_from (const Buffer& src, framecnt_t /*nframes*/, frameoffset_t /*dst_offset*/, frameoffset_t /*src_offset*/) { const MidiBuffer* mbuf = dynamic_cast(&src); assert (mbuf); @@ -580,4 +580,3 @@ MidiBuffer::merge_in_place (const MidiBuffer &other) return true; } - -- cgit v1.2.3