comparison 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
comparison
equal deleted inserted replaced
13:6adb088196a7 14:06f93bef7dd2
56 // 56 //
57 // userData holds an opaque pointer to a data structure that was passed 57 // userData holds an opaque pointer to a data structure that was passed
58 // in from the call to initAudio(). 58 // in from the call to initAudio().
59 // 59 //
60 // Return true on success; returning false halts the program. 60 // Return true on success; returning false halts the program.
61 61 bool initialise_render(int numMatrixChannels, int numAudioChannels,
62 bool initialise_render(int numChannels, int numMatrixFramesPerPeriod, 62 int numMatrixFramesPerPeriod,
63 int numAudioFramesPerPeriod, float matrixSampleRate, 63 int numAudioFramesPerPeriod,
64 float audioSampleRate, void *userData) 64 float matrixSampleRate, float audioSampleRate,
65 void *userData)
65 { 66 {
66 srandom(time(NULL)); 67 srandom(time(NULL));
68
69 if(numAudioChannels != 2) {
70 rt_printf("Error: this example needs stereo audio enabled\n");
71 return false;
72 }
67 73
68 // Initialise the sine wavetable 74 // Initialise the sine wavetable
69 if(posix_memalign((void **)&gWavetable, 8, (gWavetableLength + 1) * sizeof(float))) { 75 if(posix_memalign((void **)&gWavetable, 8, (gWavetableLength + 1) * sizeof(float))) {
70 rt_printf("Error allocating wavetable\n"); 76 rt_printf("Error allocating wavetable\n");
71 return false; 77 return false;