comparison core/NetworkSend.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 6a23c07d0fbb
children
comparison
equal deleted inserted replaced
300:dbeed520b014 301:e4392164b458
17 if(staticConstructed==true) 17 if(staticConstructed==true)
18 return; 18 return;
19 staticConstructed=true; 19 staticConstructed=true;
20 threadIsExiting=false; 20 threadIsExiting=false;
21 threadRunning=false; 21 threadRunning=false;
22 sendDataTask = BeagleRT_createAuxiliaryTask(::sendData, 95, "sendDataTask"); //TODO: allow variable priority 22 sendDataTask = Bela_createAuxiliaryTask(::sendData, 95, "sendDataTask"); //TODO: allow variable priority
23 } 23 }
24 void NetworkSend::sendAllData(){ 24 void NetworkSend::sendAllData(){
25 for(unsigned int n=0; n<NetworkSend::objAddrs.size(); n++){ 25 for(unsigned int n=0; n<NetworkSend::objAddrs.size(); n++){
26 NetworkSend::objAddrs[n]->sendData(); 26 NetworkSend::objAddrs[n]->sendData();
27 } 27 }
28 } 28 }
29 int NetworkSend::getNumInstances(){ 29 int NetworkSend::getNumInstances(){
30 return objAddrs.size(); 30 return objAddrs.size();
31 } 31 }
32 void NetworkSend::startThread(){ 32 void NetworkSend::startThread(){
33 BeagleRT_scheduleAuxiliaryTask(sendDataTask); 33 Bela_scheduleAuxiliaryTask(sendDataTask);
34 } 34 }
35 void NetworkSend::stopThread(){ 35 void NetworkSend::stopThread(){
36 threadIsExiting=true; 36 threadIsExiting=true;
37 } 37 }
38 bool NetworkSend::threadShouldExit(){ 38 bool NetworkSend::threadShouldExit(){
93 93
94 void NetworkSend::setup(float aSampleRate, int blockSize, int aChannelNumber, int aPort, const char *aServer){ 94 void NetworkSend::setup(float aSampleRate, int blockSize, int aChannelNumber, int aPort, const char *aServer){
95 #ifdef USE_JUCE 95 #ifdef USE_JUCE
96 #else 96 #else
97 staticConstructor(); //FIXME: ideally this should be in the constructor, but this is not currently possible 97 staticConstructor(); //FIXME: ideally this should be in the constructor, but this is not currently possible
98 //because of limitations in BeagleRT_createAuxiliaryTask() 98 //because of limitations in Bela_createAuxiliaryTask()
99 //keep track of added active instances 99 //keep track of added active instances
100 objAddrs.push_back(this);//TODO: this line should be in the constructor, but something weird happens if 100 objAddrs.push_back(this);//TODO: this line should be in the constructor, but something weird happens if
101 // an instance of NetworkSend is then declared globally: the constructor gets called, 101 // an instance of NetworkSend is then declared globally: the constructor gets called,
102 // and objAddrs.size()==1 but when you get to setup, objAddrs.size() has reverted back to 0, without 102 // and objAddrs.size()==1 but when you get to setup, objAddrs.size() has reverted back to 0, without
103 // any destructor being called in between ... Have a look here 103 // any destructor being called in between ... Have a look here