summaryrefslogtreecommitdiff
path: root/src/drumgizmo.cc
diff options
context:
space:
mode:
authorjsc@umbraculum.org <jsc@umbraculum.org>2013-04-26 09:33:03 +0200
committerjsc@umbraculum.org <jsc@umbraculum.org>2013-04-26 09:33:03 +0200
commitb01735c66d7a3aaa9102b9994a50b80db746c8f0 (patch)
tree5e82f11a9c973433226e418c0409c8ce4309ba2e /src/drumgizmo.cc
parent510d7da958153afd3749906e2dd816bc9c41efc6 (diff)
parent3dcc42c508dd798b9034f77e6f83ec75e648936c (diff)
Merge branch 'master' of http://git.drumgizmo.org/drumgizmo
Diffstat (limited to 'src/drumgizmo.cc')
-rw-r--r--src/drumgizmo.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc
index 32ad66e..8ba45f5 100644
--- a/src/drumgizmo.cc
+++ b/src/drumgizmo.cc
@@ -56,6 +56,7 @@ DrumGizmo::~DrumGizmo()
i++;
}
*/
+ loader.stop();
}
/*
@@ -144,6 +145,8 @@ bool DrumGizmo::loadkit(std::string file)
DEBUG(drumgizmo, "loadkit(%s)\n", kitfile.c_str());
+ loader.skip();
+
kit.clear();
DrumKitParser parser(kitfile, kit);
@@ -287,7 +290,6 @@ bool DrumGizmo::run(size_t pos, sample_t *samples, size_t nsamples)
continue;
}
-#if 1
if(i->group() != "") {
// Add event to ramp down all existing events with the same groupname.
Channels::iterator j = kit.channels.begin();
@@ -310,7 +312,6 @@ bool DrumGizmo::run(size_t pos, sample_t *samples, size_t nsamples)
j++;
}
}
-#endif
Sample *s = i->sample(evs[e].velocity, evs[e].offset + pos);
@@ -347,7 +348,6 @@ bool DrumGizmo::run(size_t pos, sample_t *samples, size_t nsamples)
//
// Write audio
//
-
for(size_t c = 0; c < kit.channels.size(); c++) {
sample_t *buf = samples;
bool internal = false;
@@ -355,9 +355,11 @@ bool DrumGizmo::run(size_t pos, sample_t *samples, size_t nsamples)
buf = oe->getBuffer(c);
internal = true;
}
- memset(buf, 0, nsamples * sizeof(sample_t));
- getSamples(c, pos, buf, nsamples);
- if(!internal) oe->run(c, samples, nsamples);
+ if(buf) {
+ memset(buf, 0, nsamples * sizeof(sample_t));
+ getSamples(c, pos, buf, nsamples);
+ if(!internal) oe->run(c, samples, nsamples);
+ }
}
ie->post();