From 8b9d31ef902b80c27065ab542c4783d6194f420f Mon Sep 17 00:00:00 2001 From: inmarket Date: Thu, 20 Mar 2014 23:33:32 +1000 Subject: Move queued buffer code from gaudio into gqueue --- demos/modules/gaudio/oscilloscope/gwinosc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'demos/modules/gaudio/oscilloscope/gwinosc.c') diff --git a/demos/modules/gaudio/oscilloscope/gwinosc.c b/demos/modules/gaudio/oscilloscope/gwinosc.c index 21a83760..9d095c86 100644 --- a/demos/modules/gaudio/oscilloscope/gwinosc.c +++ b/demos/modules/gaudio/oscilloscope/gwinosc.c @@ -96,7 +96,7 @@ GHandle gwinGScopeCreate(GDisplay *g, GScopeObject *gs, GWindowInit *pInit, uint void gwinScopeWaitForTrace(GHandle gh) { #define gs ((GScopeObject *)(gh)) - GAudioData *paud; + GDataBuffer *paud; int i; coord_t x, y; coord_t yoffset; @@ -216,6 +216,6 @@ void gwinScopeWaitForTrace(GHandle gh) { gs->scopemin = scopemin; #endif - gaudioReleaseBuffer(paud); + gfxBufferRelease(paud); #undef gs } -- cgit v1.2.3 From 9919aeac899e0044549c75be849aaf6b1e2456ab Mon Sep 17 00:00:00 2001 From: inmarket Date: Mon, 24 Mar 2014 10:08:51 +1000 Subject: Bug fixes and comments in audio recording demo --- demos/modules/gaudio/oscilloscope/gwinosc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'demos/modules/gaudio/oscilloscope/gwinosc.c') diff --git a/demos/modules/gaudio/oscilloscope/gwinosc.c b/demos/modules/gaudio/oscilloscope/gwinosc.c index 9d095c86..6b51232b 100644 --- a/demos/modules/gaudio/oscilloscope/gwinosc.c +++ b/demos/modules/gaudio/oscilloscope/gwinosc.c @@ -144,10 +144,10 @@ void gwinScopeWaitForTrace(GHandle gh) { scopemin = 0; #endif - for(i = paud->len/(gfxSampleFormatBits(gs->format)/8); i; i--) { + for(i = paud->len/((gfxSampleFormatBits(gs->format)+7)/8); i; i--) { /* Calculate the new scope value - re-scale using simple shifts for efficiency, re-center and y-invert */ - if (gs->format <= 8) + if (gfxSampleFormatBits(gs->format) <= 8) y = yoffset - (((coord_t)(*pa8++ ) << shr) >> (16-SCOPE_Y_BITS)); else y = yoffset - (((coord_t)(*pa16++) << shr) >> (16-SCOPE_Y_BITS)); -- cgit v1.2.3