summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-04-21 21:07:31 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2013-04-21 21:07:31 +0200
commit9be3da42a71d99ba23db575c6a70c1486b253366 (patch)
treee02a5ab4b99969afec25b28606bd67e65baedbfa
parentf2f14d1aa60a9b724a45b0854cee3143f1da80cf (diff)
Fixed accumulating events in the acitve events queue.
-rw-r--r--src/drumgizmo.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc
index 49ea787..c6259d4 100644
--- a/src/drumgizmo.cc
+++ b/src/drumgizmo.cc
@@ -252,6 +252,8 @@ bool DrumGizmo::run(size_t pos, sample_t *samples, size_t nsamples)
// Read new events
//
+ //DEBUG(engine, "Number of active events: %d\n", activeevents[0].size());
+
size_t nev;
event_t *evs = ie->run(pos, nsamples, &nev);
@@ -315,7 +317,7 @@ bool DrumGizmo::run(size_t pos, sample_t *samples, size_t nsamples)
if(af == NULL || !af->isValid()) {
//printf("Missing AudioFile.\n");
} else {
- DEBUG(drumgizmo, "Adding event %d.\n", evs[e].offset);
+ //DEBUG(drumgizmo, "Adding event %d.\n", evs[e].offset);
Event *evt = new EventSample(ch.num, 1.0, af, i->group(), i);
evt->offset = evs[e].offset + pos;
activeevents[ch.num].push_back(evt);
@@ -427,7 +429,7 @@ void DrumGizmo::getSamples(int ch, int pos, sample_t *s, size_t sz)
}
- if(evt->t > af->size) removeevent = true;
+ if(evt->t >= af->size) removeevent = true;
}
break;
}