-
- void apply_gain(gain_t gain, nframes_t len, nframes_t offset=0) {
- apply_gain_to_buffer (_data + offset, len, gain);
+
+ /** 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, nframes_t len, gain_t gain_coeff, nframes_t dst_offset = 0) {
+
+ assert(_capacity > 0);
+ assert(len <= _capacity);
+
+ Sample* const dst_raw = _data + dst_offset;
+
+ mix_buffers_with_gain (dst_raw, src_raw, len, gain_coeff);
+
+ _silent = (_silent && gain_coeff == 0);
+ _written = true;
+ }
+
+ void apply_gain (gain_t gain, nframes_t len) {
+ apply_gain_to_buffer (_data, len, gain);