Mercurial > hg > beaglert
diff projects/oscillator_bank/render.cpp @ 14:06f93bef7dd2
Updated remaining examples to new API
author | andrewm |
---|---|
date | Fri, 23 Jan 2015 15:35:10 +0000 |
parents | 8a575ba3ab52 |
children | 579c86316008 |
line wrap: on
line diff
--- a/projects/oscillator_bank/render.cpp Fri Jan 23 15:17:09 2015 +0000 +++ b/projects/oscillator_bank/render.cpp Fri Jan 23 15:35:10 2015 +0000 @@ -58,13 +58,19 @@ // in from the call to initAudio(). // // 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) { srandom(time(NULL)); + if(numAudioChannels != 2) { + rt_printf("Error: this example needs stereo audio enabled\n"); + return false; + } + // Initialise the sine wavetable if(posix_memalign((void **)&gWavetable, 8, (gWavetableLength + 1) * sizeof(float))) { rt_printf("Error allocating wavetable\n");