diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-12-12 14:43:24 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-12-12 14:43:24 +0000 |
commit | bc89fe0147c04b67141936d109c00dfd4d69cc4b (patch) | |
tree | 544ff450c40fe1f43853a8420228a26f27f1eafb /libs/ardour/ardour/audio_buffer.h | |
parent | 30daaebaa2d90d6b0e8673143ccc3cacd7bd1753 (diff) |
most of the 2.X->3.0 commit (up to rev 4299) except for gtk2_ardour/editor_canvas.cc; builds and runs and does a few specific things but expect it to be buggy for a while yet
git-svn-id: svn://localhost/ardour2/branches/3.0@4313 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/audio_buffer.h')
-rw-r--r-- | libs/ardour/ardour/audio_buffer.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/ardour/ardour/audio_buffer.h b/libs/ardour/ardour/audio_buffer.h index 71eaf60ade..9a41e8e093 100644 --- a/libs/ardour/ardour/audio_buffer.h +++ b/libs/ardour/ardour/audio_buffer.h @@ -78,6 +78,19 @@ public: _silent = ( (src.silent() && _silent) || (_silent && gain_coeff == 0) ); } + + /** Accumulate (add) @a len frames FROM THE START OF @a src into self at @a offset + * scaling by @a gain_coeff */ + void accumulate_with_gain_from(const Sample* src_raw, nframes_t len, nframes_t offset, gain_t gain_coeff) { + assert(_capacity > 0); + assert(offset + len <= _capacity); + + Sample* const dst_raw = _data + offset; + + mix_buffers_with_gain (dst_raw, src_raw, len, gain_coeff); + + _silent = (_silent && gain_coeff == 0); + } void apply_gain(gain_t gain, nframes_t len, nframes_t offset=0) { apply_gain_to_buffer (_data + offset, len, gain); |