diff core/NetworkSend.cpp @ 116:8341df5e404b scope-refactoring

Refactoring
author Giulio Moro <giuliomoro@yahoo.it>
date Wed, 19 Aug 2015 23:22:39 +0100
parents a0e24514fc97
children c692827083e1
line wrap: on
line diff
--- a/core/NetworkSend.cpp	Wed Aug 19 23:14:37 2015 +0100
+++ b/core/NetworkSend.cpp	Wed Aug 19 23:22:39 2015 +0100
@@ -7,7 +7,7 @@
 //initialize the static members of NetworkSend
 bool NetworkSend::staticConstructed=false;
 std::vector<NetworkSend*> NetworkSend::objAddrs(0);
-AuxiliaryTask NetworkSend::transmitAudioTask=NULL;
+AuxiliaryTask NetworkSend::sendDataTask=NULL;
 
 void transmitAudio(){
 	NetworkSend::sendAllData();
@@ -23,7 +23,7 @@
 	if(staticConstructed==true)
 		return;
 	staticConstructed=true;
-	transmitAudioTask = BeagleRT_createAuxiliaryTask(transmitAudio, 95, "transmitAudioTask"); //TODO: allow variable priority
+	sendDataTask = BeagleRT_createAuxiliaryTask(transmitAudio, 95, "sendDataTask"); //TODO: allow variable priority
 };
 
 NetworkSend::NetworkSend()
@@ -34,6 +34,7 @@
 	channel.activeBuffer=0;
 	channel.readyToBeSent=false;
 }
+
 NetworkSend::~NetworkSend(){
 	for(unsigned int n=0; n<objAddrs.size(); n++){ //keep track of deleted instances;
 		if(objAddrs[n]==this){
@@ -61,7 +62,6 @@
 	printf("Channel %d is sending messages to : %s:%d at %fHz\n", getChannelNumber(), aServer, aPort, aSampleRate);
 }
 
-
 void NetworkSend::log(float value){ //TODO: add a vectorized version of this method
 	if(channel.index==(NETWORK_AUDIO_BUFFER_SIZE)){ // when the buffer is ready ...
 		channel.readyToBeSent=true;
@@ -71,7 +71,7 @@
 		}
 		channel.activeBuffer=!channel.activeBuffer; //switch buffer
 		channel.doneOnTime=false;
-		BeagleRT_scheduleAuxiliaryTask(NetworkSend::transmitAudioTask); //send the buffer
+		BeagleRT_scheduleAuxiliaryTask(NetworkSend::sendDataTask); //send the buffer
 		//TODO: maybe we should have transmitAudioTask running in a loop instead of scheduling it multiple times?
 	}
 	if(channel.index==channel.headerLength){