summaryrefslogtreecommitdiff
path: root/test/dgreftest/dgreftest.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2018-08-03 20:02:04 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2018-08-05 16:19:57 +0200
commita0e2b9398a06ca2ea164c2ffd6fd89f713b93598 (patch)
treef070de47673f32903eae30ddbc57232e2b13db4e /test/dgreftest/dgreftest.cc
parentea743668192e0921ab46d5e863df5b754ce82656 (diff)
Add support for partial buffers in cache and rendering engine - fixes dropouts on framesize changes for example when looping.
Diffstat (limited to 'test/dgreftest/dgreftest.cc')
-rw-r--r--test/dgreftest/dgreftest.cc24
1 files changed, 21 insertions, 3 deletions
diff --git a/test/dgreftest/dgreftest.cc b/test/dgreftest/dgreftest.cc
index ea38091..a4eb897 100644
--- a/test/dgreftest/dgreftest.cc
+++ b/test/dgreftest/dgreftest.cc
@@ -135,14 +135,32 @@ int main(int argc, char* argv[])
size_t nsamples = oe->getBufferSize();
sample_t *samples = (sample_t *)malloc(nsamples * sizeof(sample_t));
- drumgizmo.setFrameSize(oe->getBufferSize());
+ drumgizmo.setFrameSize(nsamples);
ie.start();
oe->start();
- while(drumgizmo.run(pos, samples, nsamples) == true)
+ size_t framesize = nsamples;
+ int dir = -1;
+ while(drumgizmo.run(pos, samples, framesize) == true)
{
- pos += nsamples;
+ pos += framesize;
+
+ framesize += dir;
+
+ if(framesize < 1)
+ {
+ framesize = 1;
+ dir = 1;
+ }
+
+ if(framesize >= nsamples)
+ {
+ framesize = nsamples;
+ dir = -1;
+ }
+
+ drumgizmo.setFrameSize(framesize);
}
ie.stop();