diff options
author | André Nusser <andre.nusser@googlemail.com> | 2016-07-13 17:26:10 +0200 |
---|---|---|
committer | André Nusser <andre.nusser@googlemail.com> | 2016-07-13 17:28:11 +0200 |
commit | d71485534d3a683cae4993815f59ff68263a6751 (patch) | |
tree | cf1b487fc405cde4e2c1c391d6edc57fa529fea7 /drumgizmo/drumgizmoc.cc | |
parent | 633bac9e82aef192a803666aaf3d3dcff920ac0c (diff) |
Remove the run(int endpos) method from drumgizmo.
Insert the code directly instead.
Diffstat (limited to 'drumgizmo/drumgizmoc.cc')
-rw-r--r-- | drumgizmo/drumgizmoc.cc | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/drumgizmo/drumgizmoc.cc b/drumgizmo/drumgizmoc.cc index 4f3123b..1ba9516 100644 --- a/drumgizmo/drumgizmoc.cc +++ b/drumgizmo/drumgizmoc.cc @@ -391,7 +391,30 @@ int main(int argc, char* argv[]) return 1; } - gizmo.run(endpos); + // former drumgizmo run call + size_t pos = 0; + size_t nsamples = oe->getBufferSize(); + sample_t *samples = (sample_t *)malloc(nsamples * sizeof(sample_t)); + + gizmo.setFrameSize(oe->getBufferSize()); + + ie->start(); + oe->start(); + + while(gizmo.run(pos, samples, nsamples) == true) + { + pos += nsamples; + if((endpos != -1) && (pos >= (size_t)endpos)) + { + break; + } + } + + ie->stop(); + oe->stop(); + + free(samples); + // end former drumgizmo run call printf("Quit.\n"); fflush(stdout); |