Mercurial > hg > beaglert
diff examples/cape_test/render.cpp @ 311:493a07f6ec09 prerelease
Renamed BelaContext->audioSampleCount to BelaContext->audioFramesElapsed for consistency of terminology
author | andrewm |
---|---|
date | Fri, 27 May 2016 18:37:51 +0100 |
parents | e4392164b458 |
children |
line wrap: on
line diff
--- a/examples/cape_test/render.cpp Fri May 27 18:29:20 2016 +0100 +++ b/examples/cape_test/render.cpp Fri May 27 18:37:51 2016 +0100 @@ -110,7 +110,7 @@ } else { - if(!((context->audioSampleCount + n) % 22050)) { + if(!((context->audioFramesElapsed + n) % 22050)) { // Debugging print messages if((gPositivePeakLevels[0] - gNegativePeakLevels[0]) < gPeakLevelHighThreshold) rt_printf("Left Audio In FAIL: insufficient signal: %f\n", @@ -155,7 +155,7 @@ } } else { - if(!((context->audioSampleCount + n) % 22050)) { + if(!((context->audioFramesElapsed + n) % 22050)) { // Debugging print messages if((gPositivePeakLevels[1] - gNegativePeakLevels[1]) < gPeakLevelHighThreshold) rt_printf("Right Audio In FAIL: insufficient signal: %f\n", @@ -182,7 +182,7 @@ // If one second has gone by with no error, play one sound, else // play another - if(context->audioSampleCount + n - gLastErrorFrame > 44100) { + if(context->audioFramesElapsed + n - gLastErrorFrame > 44100) { gEnvelopeValueL *= gEnvelopeDecayRate; gEnvelopeValueR *= gEnvelopeDecayRate; gEnvelopeSampleCount++; @@ -233,13 +233,13 @@ if(k == invertChannel) { if(context->analogIn[n*8 + k] < ANALOG_HIGH) { rt_printf("FAIL [output %d, input %d] -- output HIGH input %f (inverted)\n", gDACPinOrder[k], k, context->analogIn[n*8 + k]); - gLastErrorFrame = context->audioSampleCount + n; + gLastErrorFrame = context->audioFramesElapsed + n; } } else { if(context->analogIn[n*8 + k] > ANALOG_LOW) { rt_printf("FAIL [output %d, input %d] -- output LOW --> input %f\n", gDACPinOrder[k], k, context->analogIn[n*8 + k]); - gLastErrorFrame = context->audioSampleCount + n; + gLastErrorFrame = context->audioFramesElapsed + n; } } } @@ -249,13 +249,13 @@ if(k == invertChannel) { if(context->analogIn[n*8 + k] > ANALOG_LOW) { rt_printf("FAIL [output %d, input %d] -- output LOW input %f (inverted)\n", gDACPinOrder[k], k, context->analogIn[n*8 + k]); - gLastErrorFrame = context->audioSampleCount + n; + gLastErrorFrame = context->audioFramesElapsed + n; } } else { if(context->analogIn[n*8 + k] < ANALOG_HIGH) { rt_printf("FAIL [output %d, input %d] -- output HIGH input %f\n", gDACPinOrder[k], k, context->analogIn[n*8 + k]); - gLastErrorFrame = context->audioSampleCount + n; + gLastErrorFrame = context->audioFramesElapsed + n; } } }