comparison projects/d-box/render.cpp @ 56:3c3a1357657d newapi

Further API update to name three primary functions setup(), render() and cleanup(). Changed include paths so now can #include <BeagleRT.h>. Removed stale pru_rtaudio.bin file as this is now done as pru_rtaudio_bin.h. Updated examples to new API and fixed minor compiler warnings along the way. Network example needs further attention to compile.
author andrewm
date Wed, 15 Jul 2015 12:10:51 +0100
parents 4f8db16f17b5
children
comparison
equal deleted inserted replaced
55:41d24dba6b74 56:3c3a1357657d
3 * 3 *
4 * Created on: May 28, 2014 4 * Created on: May 28, 2014
5 * Author: Victor Zappi 5 * Author: Victor Zappi
6 */ 6 */
7 7
8 #include "../../include/BeagleRT.h" 8 #include <BeagleRT.h>
9 #include "../../include/PRU.h" 9 #include <PRU.h>
10
10 #include "StatusLED.h" 11 #include "StatusLED.h"
11 #include "config.h" 12 #include "config.h"
12 #include "OscillatorBank.h" 13 #include "OscillatorBank.h"
13 #include "FeedbackOscillator.h" 14 #include "FeedbackOscillator.h"
14 #include "ADSR.h" 15 #include "ADSR.h"
150 #ifdef DBOX_CAPE_TEST 151 #ifdef DBOX_CAPE_TEST
151 void render_capetest(int numMatrixFrames, int numAudioFrames, float *audioIn, float *audioOut, 152 void render_capetest(int numMatrixFrames, int numAudioFrames, float *audioIn, float *audioOut,
152 uint16_t *matrixIn, uint16_t *matrixOut); 153 uint16_t *matrixIn, uint16_t *matrixOut);
153 #endif 154 #endif
154 155
155 bool initialise_render(BeagleRTContext *context, void *userData) { 156 bool setup(BeagleRTContext *context, void *userData) {
156 int oscBankHopSize = *(int *)userData; 157 int oscBankHopSize = *(int *)userData;
157 158
158 if(context->analogChannels != 8) { 159 if(context->analogChannels != 8) {
159 printf("Error: D-Box needs matrix enabled with 8 channels.\n"); 160 printf("Error: D-Box needs matrix enabled with 8 channels.\n");
160 return false; 161 return false;
728 729
729 //dbox_printf("min %d max %d\n", gLoopPointMin, gLoopPointMax); 730 //dbox_printf("min %d max %d\n", gLoopPointMin, gLoopPointMax);
730 } 731 }
731 732
732 // Clean up at the end of render 733 // Clean up at the end of render
733 void cleanup_render(BeagleRTContext *context, void *userData) 734 void cleanup(BeagleRTContext *context, void *userData)
734 { 735 {
735 free(gOscillatorBuffer1); 736 free(gOscillatorBuffer1);
736 free(gOscillatorBuffer2); 737 free(gOscillatorBuffer2);
737 free(gDynamicWavetable); 738 free(gDynamicWavetable);
738 } 739 }