diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-07-24 10:06:27 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-07-24 10:28:43 +0200 |
commit | e5efc3656090d39de1d8854aa495c8c16218c2f6 (patch) | |
tree | c3126c789fd37b43218371bf7c16fa2066a7007d /src/drumgizmo.cc | |
parent | 973d411598958d968226ed878d9426f23e8f7cbf (diff) |
Clear output buffers in LV2 and jack modes before each process iteration to eliminte noise when drumkit has not yet been loaded.
Diffstat (limited to 'src/drumgizmo.cc')
-rw-r--r-- | src/drumgizmo.cc | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc index fa601e6..18cbbb7 100644 --- a/src/drumgizmo.cc +++ b/src/drumgizmo.cc @@ -26,21 +26,16 @@ */ #include "drumgizmo.h" -#include <math.h> -#include <stdio.h> -#include <assert.h> +#include <cmath> +#include <cstdio> +#include <cassert> +#include <cstring> #include <event.h> #include <audiotypes.h> - -#include <string.h> - -#include <hugin.hpp> - -#include <memory> #include <config.h> -#include <iostream> +#include <hugin.hpp> #include "drumkitparser.h" #include "audioinputenginemidi.h" @@ -122,7 +117,8 @@ bool DrumGizmo::run(size_t pos, sample_t *samples, size_t nsamples) setFreeWheel(ie.isFreewheeling() && oe.isFreewheeling()); ie.pre(); - oe.pre(nsamples); + oe.pre(nsamples); // Clears all output buffers + std::memset(samples, 0, nsamples * sizeof(sample_t)); // // Read new events @@ -161,7 +157,7 @@ bool DrumGizmo::run(size_t pos, sample_t *samples, size_t nsamples) if(buf) { - memset(buf, 0, nsamples * sizeof(sample_t)); + std::memset(buf, 0, nsamples * sizeof(sample_t)); getSamples(c, pos, buf, nsamples); |