55 assert (_capacity > 0);
56 assert (len <= _capacity);
57 copy_vector (_data + dst_offset, src + src_offset, len);
70 assert (&src !=
this);
71 assert (_capacity > 0);
73 assert (dst_offset + len <= _capacity);
82 if (dst_offset == 0 && src_offset == 0 && len == _capacity) {
85 _silent = _silent && src.
silent ();
95 accumulate_from (*ab, len, dst_offset, src_offset);
101 assert (_capacity > 0);
102 assert (len <= _capacity);
106 Sample*
const dst_raw = _data + dst_offset;
107 const Sample*
const src_raw = src.
data () + src_offset;
111 _silent = (src.
silent () && _silent);
120 assert (_capacity > 0);
121 assert (len <= _capacity);
123 Sample*
const dst_raw = _data + dst_offset;
124 const Sample*
const src_raw = src + src_offset;
137 assert (_capacity > 0);
138 assert (len <= _capacity);
140 if (src.
silent () || gain_coeff == 0) {
144 Sample*
const dst_raw = _data + dst_offset;
145 const Sample*
const src_raw = src.
data () + src_offset;
149 _silent = ((src.
silent () && _silent) || (_silent && gain_coeff == 0));
158 assert (_capacity > 0);
159 assert (len <= _capacity);
161 Sample*
const dst_raw = _data + dst_offset;
165 _silent = (_silent && gain_coeff == 0);
174 assert (_capacity > 0);
175 assert (len <= _capacity);
177 if (initial == 0 && target == 0) {
181 Sample* dst = _data + dst_offset;
182 gain_t gain_delta = (target - initial) / len;
185 *dst++ += (*src++ * initial);
186 initial += gain_delta;
189 _silent = (_silent && initial == 0 && target == 0);
202 if (len == _capacity) {
216 assert (!_owns_data);
231 assert (offset <= _capacity);
232 return _data + offset;
237 assert (offset <= _capacity);
239 return _data + offset;
Sample * _data
Actual buffer contents.
Sample * data(samplecnt_t offset=0)
bool check_silence(pframes_t nframes, pframes_t &n) const
void read_from(const Buffer &src, samplecnt_t len, sampleoffset_t dst_offset=0, sampleoffset_t src_offset=0)
AudioBuffer(size_t capacity)
void set_data(Sample *data, size_t size)
void apply_gain(gain_t gain, samplecnt_t len)
void accumulate_with_gain_from(const AudioBuffer &src, samplecnt_t len, gain_t gain_coeff, sampleoffset_t dst_offset=0, sampleoffset_t src_offset=0)
void merge_from(const Buffer &src, samplecnt_t len, sampleoffset_t dst_offset=0, sampleoffset_t src_offset=0)
const Sample * data(samplecnt_t offset=0) const
void accumulate_from(const Sample *src, samplecnt_t len, sampleoffset_t dst_offset=0, sampleoffset_t src_offset=0)
void accumulate_with_gain_from(const Sample *src_raw, samplecnt_t len, gain_t gain_coeff, sampleoffset_t dst_offset=0)
void silence(samplecnt_t len, samplecnt_t offset=0)
void accumulate_from(const AudioBuffer &src, samplecnt_t len, sampleoffset_t dst_offset=0, sampleoffset_t src_offset=0)
void accumulate_with_ramped_gain_from(const Sample *src, samplecnt_t len, gain_t initial, gain_t target, sampleoffset_t dst_offset=0)
void read_from(const Sample *src, samplecnt_t len, sampleoffset_t dst_offset=0, sampleoffset_t src_offset=0)
void resize(size_t nframes)
void memset(float *data, const float val, const uint32_t n_samples)
PBD::PropertyDescriptor< gain_t > gain
Temporal::samplecnt_t samplecnt_t
apply_gain_to_buffer_t apply_gain_to_buffer
mix_buffers_with_gain_t mix_buffers_with_gain
Temporal::sampleoffset_t sampleoffset_t
mix_buffers_no_gain_t mix_buffers_no_gain
copy_vector_t copy_vector