Mercurial > hg > beaglert
diff projects/filter_FIR/render.cpp @ 14:06f93bef7dd2
Updated remaining examples to new API
author | andrewm |
---|---|
date | Fri, 23 Jan 2015 15:35:10 +0000 |
parents | 09f03ac40fcc |
children | a6d223473ea2 |
line wrap: on
line diff
--- a/projects/filter_FIR/render.cpp Fri Jan 23 15:17:09 2015 +0000 +++ b/projects/filter_FIR/render.cpp Fri Jan 23 15:35:10 2015 +0000 @@ -17,8 +17,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 ne10_fir_instance_f32_t gFIRfilter; @@ -48,16 +46,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; gPeriodSize = numMatrixFramesPerPeriod; initialise_filter(); @@ -93,8 +92,8 @@ ne10_fir_float_neon(&gFIRfilter, gFIRfilterIn, gFIRfilterOut, blockSize); for(int n = 0; n < numAudioFrames; n++) { - for(int channel = 0; channel < gNumChannels; channel++) - audioOut[n * gNumChannels + channel] = gFIRfilterOut[n]; // ...and put it in both left and right channel + for(int channel = 0; channel < gNumAudioChannels; channel++) + audioOut[n * gNumAudioChannels + channel] = gFIRfilterOut[n]; // ...and put it in both left and right channel }