Mercurial > hg > beaglert
diff projects/filter_IIR/render.cpp @ 14:06f93bef7dd2
Updated remaining examples to new API
author | andrewm |
---|---|
date | Fri, 23 Jan 2015 15:35:10 +0000 |
parents | 6810f166482f |
children | a6d223473ea2 |
line wrap: on
line diff
--- a/projects/filter_IIR/render.cpp Fri Jan 23 15:17:09 2015 +0000 +++ b/projects/filter_IIR/render.cpp Fri Jan 23 15:35:10 2015 +0000 @@ -15,7 +15,6 @@ SampleData gSampleData; // User defined structure to get complex data from main int gReadPtr; // Position of last read sample from file -int gNumChannels; // filter vars float gLastX[2]; @@ -55,16 +54,17 @@ // // Return true on success; returning false halts the program. -bool initialise_render(int numChannels, int numMatrixFramesPerPeriod, - int numAudioFramesPerPeriod, float matrixSampleRate, - float audioSampleRate, void *userData) +bool initialise_render(int numMatrixChannels, int numAudioChannels, + int numMatrixFramesPerPeriod, + int numAudioFramesPerPeriod, + float matrixSampleRate, float audioSampleRate, + void *userData) { // Retrieve a parameter passed in from the initAudio() call gSampleData = *(SampleData *)userData; gReadPtr = -1; - gNumChannels = numChannels; initialise_filter(200); @@ -101,8 +101,8 @@ gLastY[1] = gLastY[0]; gLastY[0] = out; - for(int channel = 0; channel < gNumChannels; channel++) - audioOut[n * gNumChannels + channel] = out; // ...and put it in both left and right channel + for(int channel = 0; channel < gNumAudioChannels; channel++) + audioOut[n * gNumAudioChannels + channel] = out; // ...and put it in both left and right channel }