Mercurial > hg > beaglert
comparison core/RTAudio.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 | be427da6fb9c |
children | f944d0b60fa8 |
comparison
equal
deleted
inserted
replaced
55:41d24dba6b74 | 56:3c3a1357657d |
---|---|
80 // periodSize indicates the number of _sensor_ frames per period: the audio period size | 80 // periodSize indicates the number of _sensor_ frames per period: the audio period size |
81 // is twice this value. In total, the audio latency in frames will be 4*periodSize, | 81 // is twice this value. In total, the audio latency in frames will be 4*periodSize, |
82 // plus any latency inherent in the ADCs and DACs themselves. | 82 // plus any latency inherent in the ADCs and DACs themselves. |
83 // useAnalog indicates whether to enable the ADC and DAC or just use the audio codec. | 83 // useAnalog indicates whether to enable the ADC and DAC or just use the audio codec. |
84 // numAnalogChannels indicates how many ADC and DAC channels to use. | 84 // numAnalogChannels indicates how many ADC and DAC channels to use. |
85 // userData is an opaque pointer which will be passed through to the initialise_render() | 85 // userData is an opaque pointer which will be passed through to the setup() |
86 // function for application-specific use | 86 // function for application-specific use |
87 // | 87 // |
88 // Returns 0 on success. | 88 // Returns 0 on success. |
89 | 89 |
90 int BeagleRT_initAudio(BeagleRTInitSettings *settings, void *userData) | 90 int BeagleRT_initAudio(BeagleRTInitSettings *settings, void *userData) |
216 BeagleRT_setDACLevel(settings->dacLevel); | 216 BeagleRT_setDACLevel(settings->dacLevel); |
217 BeagleRT_setADCLevel(settings->adcLevel); | 217 BeagleRT_setADCLevel(settings->adcLevel); |
218 BeagleRT_setHeadphoneLevel(settings->headphoneLevel); | 218 BeagleRT_setHeadphoneLevel(settings->headphoneLevel); |
219 | 219 |
220 // Call the user-defined initialisation function | 220 // Call the user-defined initialisation function |
221 if(!initialise_render(&gContext, userData)) { | 221 if(!setup(&gContext, userData)) { |
222 cout << "Couldn't initialise audio rendering\n"; | 222 cout << "Couldn't initialise audio rendering\n"; |
223 return 1; | 223 return 1; |
224 } | 224 } |
225 | 225 |
226 return 0; | 226 return 0; |
401 } | 401 } |
402 | 402 |
403 // Free any resources associated with PRU real-time audio | 403 // Free any resources associated with PRU real-time audio |
404 void BeagleRT_cleanupAudio() | 404 void BeagleRT_cleanupAudio() |
405 { | 405 { |
406 cleanup_render(&gContext, gUserData); | 406 cleanup(&gContext, gUserData); |
407 | 407 |
408 // Clean up the auxiliary tasks | 408 // Clean up the auxiliary tasks |
409 vector<InternalAuxiliaryTask*>::iterator it; | 409 vector<InternalAuxiliaryTask*>::iterator it; |
410 for(it = gAuxTasks.begin(); it != gAuxTasks.end(); it++) { | 410 for(it = gAuxTasks.begin(); it != gAuxTasks.end(); it++) { |
411 InternalAuxiliaryTask *taskStruct = *it; | 411 InternalAuxiliaryTask *taskStruct = *it; |