From 0b572cdd84151335594965a3f0ed16f1665dfa56 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 13 Aug 2006 03:40:04 +0000 Subject: More signal path cleanup, IO now has one deliver_output function that should do the reasonable thing in all cases. Including deliver MIDI. You can now create a MIDI Track, run some MIDI through it, and toggle the mute button on and off, hearing either silence or a large amount of stuck notes depending on your luck. Woooo. git-svn-id: svn://localhost/ardour2/branches/midi@818 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/buffer.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libs/ardour/ardour/buffer.h') diff --git a/libs/ardour/ardour/buffer.h b/libs/ardour/ardour/buffer.h index accdd9c181..df7f57455b 100644 --- a/libs/ardour/ardour/buffer.h +++ b/libs/ardour/ardour/buffer.h @@ -136,6 +136,14 @@ public: } } + 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; + } + } + /** Set the data contained by this buffer manually (for setting directly to jack buffer). * * Constructor MUST have been passed capacity=0 or this will die (to prevent mem leaks). -- cgit v1.2.3