summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/buffer.h
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-05-02 15:21:51 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-05-02 15:21:51 +0000
commitc3e666867cfd44768c9aa605abefde78274ace24 (patch)
tree547fb2300f0b384387647936c13d6672385aa0e7 /libs/ardour/ardour/buffer.h
parenta612857eb6024f75f11094d09def4ccbe621b7b4 (diff)
reintroduce use of optimized functions for gain into buffer code, and cleanup the way they are declared to avoid depending on Session
git-svn-id: svn://localhost/ardour2/branches/midi@1775 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/buffer.h')
-rw-r--r--libs/ardour/ardour/buffer.h15
1 files changed, 4 insertions, 11 deletions
diff --git a/libs/ardour/ardour/buffer.h b/libs/ardour/ardour/buffer.h
index 828eac4d64..6000872bdd 100644
--- a/libs/ardour/ardour/buffer.h
+++ b/libs/ardour/ardour/buffer.h
@@ -24,6 +24,7 @@
#include <iostream>
#include <ardour/types.h>
#include <ardour/data_type.h>
+#include <ardour/runtime_functions.h>
namespace ARDOUR {
@@ -142,21 +143,13 @@ public:
Sample* const dst_raw = _data + offset;
const Sample* const src_raw = src.data(len);
- for (jack_nframes_t n = 0; n < len; ++n) {
- dst_raw[n] += src_raw[n] * gain_coeff;
- }
-
+ mix_buffers_with_gain (dst_raw, src_raw, len, gain_coeff);
+
_silent = ( (src.silent() && _silent) || (_silent && gain_coeff == 0) );
}
void apply_gain(gain_t gain, jack_nframes_t len, jack_nframes_t offset=0) {
- Sample* const buf = _data + offset;
-
- for (jack_nframes_t n = 0; n < len; ++n) {
- buf[n] *= gain;
- }
-
- _silent = (_silent || gain == 0);
+ apply_gain_to_buffer (_data + offset, len, gain);
}
/** Set the data contained by this buffer manually (for setting directly to jack buffer).