Mercurial > hg > beaglert
diff projects/samples/render.cpp @ 14:06f93bef7dd2
Updated remaining examples to new API
author | andrewm |
---|---|
date | Fri, 23 Jan 2015 15:35:10 +0000 |
parents | 24fc8026ae8e |
children | a6d223473ea2 |
line wrap: on
line diff
--- a/projects/samples/render.cpp Fri Jan 23 15:17:09 2015 +0000 +++ b/projects/samples/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; // Task for handling the update of the frequencies using the matrix AuxiliaryTask gTriggerSamplesTask; @@ -32,16 +31,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 auxiliary tasks if(!initialise_trigger()) @@ -68,8 +68,8 @@ if(gReadPtr >= gSampleData.sampleLen) gReadPtr = -1; - 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 } // Request that the lower-priority task run at next opportunity