Mercurial > hg > beaglert
comparison examples/basic_passthru/render.cpp @ 301:e4392164b458 prerelease
RENAMED BeagleRT to Bela AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, scripts probably not working
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Fri, 27 May 2016 14:34:41 +0100 |
parents | dbeed520b014 |
children | 1feb9c23ac57 |
comparison
equal
deleted
inserted
replaced
300:dbeed520b014 | 301:e4392164b458 |
---|---|
4 * Created on: Oct 24, 2014 | 4 * Created on: Oct 24, 2014 |
5 * Author: parallels | 5 * Author: parallels |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 #include <BeagleRT.h> | 9 #include <Bela.h> |
10 #include <Utilities.h> | 10 #include <Utilities.h> |
11 #include <rtdk.h> | 11 #include <rtdk.h> |
12 | 12 |
13 // setup() is called once before the audio rendering starts. | 13 // setup() is called once before the audio rendering starts. |
14 // Use it to perform any initialisation and allocation which is dependent | 14 // Use it to perform any initialisation and allocation which is dependent |
17 // userData holds an opaque pointer to a data structure that was passed | 17 // userData holds an opaque pointer to a data structure that was passed |
18 // in from the call to initAudio(). | 18 // in from the call to initAudio(). |
19 // | 19 // |
20 // Return true on success; returning false halts the program. | 20 // Return true on success; returning false halts the program. |
21 | 21 |
22 bool setup(BeagleRTContext *context, void *userData) | 22 bool setup(BelaContext *context, void *userData) |
23 { | 23 { |
24 // Nothing to do here... | 24 // Nothing to do here... |
25 return true; | 25 return true; |
26 } | 26 } |
27 | 27 |
28 // render() is called regularly at the highest priority by the audio engine. | 28 // render() is called regularly at the highest priority by the audio engine. |
29 // Input and output are given from the audio hardware and the other | 29 // Input and output are given from the audio hardware and the other |
30 // ADCs and DACs (if available). If only audio is available, numMatrixFrames | 30 // ADCs and DACs (if available). If only audio is available, numMatrixFrames |
31 // will be 0. | 31 // will be 0. |
32 | 32 |
33 void render(BeagleRTContext *context, void *userData) | 33 void render(BelaContext *context, void *userData) |
34 { | 34 { |
35 // Simplest possible case: pass inputs through to outputs | 35 // Simplest possible case: pass inputs through to outputs |
36 for(unsigned int n = 0; n < context->audioFrames; n++) { | 36 for(unsigned int n = 0; n < context->audioFrames; n++) { |
37 for(unsigned int ch = 0; ch < context->audioChannels; ch++){ | 37 for(unsigned int ch = 0; ch < context->audioChannels; ch++){ |
38 // Two equivalent ways to write this code | 38 // Two equivalent ways to write this code |
61 } | 61 } |
62 | 62 |
63 // cleanup() is called once at the end, after the audio has stopped. | 63 // cleanup() is called once at the end, after the audio has stopped. |
64 // Release any resources that were allocated in setup(). | 64 // Release any resources that were allocated in setup(). |
65 | 65 |
66 void cleanup(BeagleRTContext *context, void *userData) | 66 void cleanup(BelaContext *context, void *userData) |
67 { | 67 { |
68 | 68 |
69 } | 69 } |