giuliomoro@112: #include giuliomoro@111: giuliomoro@129: #ifdef USE_JUCE giuliomoro@129: #else giuliomoro@111: //initialize the static members of NetworkSend giuliomoro@111: bool NetworkSend::staticConstructed=false; giuliomoro@111: std::vector NetworkSend::objAddrs(0); giuliomoro@116: AuxiliaryTask NetworkSend::sendDataTask=NULL; giuliomoro@111: giuliomoro@129: void sendData(){ giuliomoro@111: NetworkSend::sendAllData(); giuliomoro@111: } giuliomoro@129: void NetworkSend::staticConstructor(){ giuliomoro@129: if(staticConstructed==true) giuliomoro@129: return; giuliomoro@129: staticConstructed=true; giuliomoro@129: sendDataTask = BeagleRT_createAuxiliaryTask(::sendData, 95, "sendDataTask"); //TODO: allow variable priority giuliomoro@129: } giuliomoro@111: void NetworkSend::sendAllData(){ giuliomoro@111: for(unsigned int n=0; nsendData(); giuliomoro@111: } giuliomoro@111: } giuliomoro@129: int NetworkSend::getNumInstances(){ giuliomoro@129: return objAddrs.size(); giuliomoro@129: } giuliomoro@129: #endif /* USE_JUCE */ giuliomoro@111: giuliomoro@111: NetworkSend::NetworkSend() giuliomoro@111: { giuliomoro@111: sampleCount = 0; giuliomoro@111: channel.doneOnTime=true; giuliomoro@111: channel.index=channel.headerLength; //leave space for the heading message (channel, timestamp) giuliomoro@111: channel.activeBuffer=0; giuliomoro@111: channel.readyToBeSent=false; giuliomoro@111: } giuliomoro@116: giuliomoro@111: NetworkSend::~NetworkSend(){ giuliomoro@111: for(unsigned int n=0; n=getNumChannels()) //TODO: assert this giuliomoro@111: return; giuliomoro@111: channels[channel].log(value); giuliomoro@111: } giuliomoro@111: giuliomoro@111: void Scope::setup(){ giuliomoro@111: setup(44100, 9999, "127.0.0.1"); giuliomoro@111: } giuliomoro@111: giuliomoro@111: void Scope::setup(float sampleRate, int aPort, const char* aServer){ giuliomoro@111: for(int n=0; n