Mercurial > hg > beaglert
comparison examples/basic_passthru/render.cpp @ 308:1feb9c23ac57 prerelease
Renamed read/write functions to remove the Frame --> e.g. analogWriteFrameOnce -> analogWriteOnce, digitalReadFrame -> digitalRead
author | andrewm |
---|---|
date | Fri, 27 May 2016 18:21:21 +0100 |
parents | e4392164b458 |
children | db2fe4e1b88e |
comparison
equal
deleted
inserted
replaced
307:ff5f346a293e | 308:1feb9c23ac57 |
---|---|
40 // The long way, using the buffers directly: | 40 // The long way, using the buffers directly: |
41 // context->audioOut[n * context->audioChannels + ch] = | 41 // context->audioOut[n * context->audioChannels + ch] = |
42 // context->audioIn[n * context->audioChannels + ch]; | 42 // context->audioIn[n * context->audioChannels + ch]; |
43 | 43 |
44 // Or using the macros: | 44 // Or using the macros: |
45 audioWriteFrame(context, n, ch, audioReadFrame(context, n, ch)); | 45 audioWrite(context, n, ch, audioRead(context, n, ch)); |
46 } | 46 } |
47 } | 47 } |
48 | 48 |
49 // Same with analog channelss | 49 // Same with analog channelss |
50 for(unsigned int n = 0; n < context->analogFrames; n++) { | 50 for(unsigned int n = 0; n < context->analogFrames; n++) { |
53 | 53 |
54 // The long way, using the buffers directly: | 54 // The long way, using the buffers directly: |
55 // context->analogOut[n * context->analogChannels + ch] = context->analogIn[n * context->analogChannels + ch]; | 55 // context->analogOut[n * context->analogChannels + ch] = context->analogIn[n * context->analogChannels + ch]; |
56 | 56 |
57 // Or using the macros: | 57 // Or using the macros: |
58 analogWriteFrame(context, n, ch, analogReadFrame(context, n, ch)); | 58 analogWrite(context, n, ch, analogRead(context, n, ch)); |
59 } | 59 } |
60 } | 60 } |
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. |