Mercurial > hg > beaglert
comparison projects/basic/render.cpp @ 12:a6beeba3a648
Initial support for higher matrix sample rates by reducing the number of channels. Input not tested yet, and not all examples updated to new format.
author | andrewm |
---|---|
date | Thu, 22 Jan 2015 19:00:22 +0000 |
parents | 8a575ba3ab52 |
children | 6adb088196a7 |
comparison
equal
deleted
inserted
replaced
11:517715b23df0 | 12:a6beeba3a648 |
---|---|
21 // userData holds an opaque pointer to a data structure that was passed | 21 // userData holds an opaque pointer to a data structure that was passed |
22 // in from the call to initAudio(). | 22 // in from the call to initAudio(). |
23 // | 23 // |
24 // Return true on success; returning false halts the program. | 24 // Return true on success; returning false halts the program. |
25 | 25 |
26 bool initialise_render(int numChannels, int numMatrixFramesPerPeriod, | 26 bool initialise_render(int numMatrixChannels, int numAudioChannels, |
27 int numAudioFramesPerPeriod, float matrixSampleRate, | 27 int numMatrixFramesPerPeriod, |
28 float audioSampleRate, void *userData) | 28 int numAudioFramesPerPeriod, |
29 float matrixSampleRate, float audioSampleRate, | |
30 void *userData) | |
29 { | 31 { |
30 // Retrieve a parameter passed in from the initAudio() call | 32 // Retrieve a parameter passed in from the initAudio() call |
31 gFrequency = *(float *)userData; | 33 gFrequency = *(float *)userData; |
32 | 34 |
33 gNumChannels = numChannels; | 35 gNumChannels = numAudioChannels; |
34 gInverseSampleRate = 1.0 / audioSampleRate; | 36 gInverseSampleRate = 1.0 / audioSampleRate; |
35 gPhase = 0.0; | 37 gPhase = 0.0; |
36 | 38 |
37 return true; | 39 return true; |
38 } | 40 } |