diff include/client.h @ 70:f3251851c718

Brought UdpClient files over from ultra-staging branch (with include fix), and updated Makefile accordingly
author andrewm
date Fri, 17 Jul 2015 17:50:54 +0100
parents ad5cd8dd99b3
children
line wrap: on
line diff
--- a/include/client.h	Fri Jul 17 17:41:35 2015 +0100
+++ b/include/client.h	Fri Jul 17 17:50:54 2015 +0100
@@ -8,15 +8,27 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
+#include "UdpClient.h"
 
 struct networkData{
 	int *counter;
 	float *variables[16];
 	int numVariables;
 };
+#define NETWORK_AUDIO_BUFFER_SIZE 100 //1400/4 //maximum payload for a UDP datagram over ethernet is 1472 bytes, I leave some headroom and divide by 4 to get the number of floats
+struct networkAudio{
+	int timestamp;
+	int currentBuffer;
+	int index;
+	float buffers[2][NETWORK_AUDIO_BUFFER_SIZE];
+	int doneOnTime;
+	bool toBeSent;
+	UdpClient udpClient;
+};
 
 void error(const char *);
 int setupSockets(int receivePort, int transmitPort, char const*serverName);
 int sendMessage(networkData message);
+int sendAudio(networkAudio *audio);
 int receiveMessage(networkData message);
 void closeSockets();