diff include/ReceiveAudioThread.h @ 128:2696a7f00053 scope-refactoring

ReceiveAudioThread is now the same with/without JUCE
author Giulio Moro <giuliomoro@yahoo.it>
date Mon, 24 Aug 2015 18:55:19 +0100
parents 850a4a9bd832
children ff28e56e5b7e
line wrap: on
line diff
--- a/include/ReceiveAudioThread.h	Mon Aug 24 15:36:09 2015 +0100
+++ b/include/ReceiveAudioThread.h	Mon Aug 24 18:55:19 2015 +0100
@@ -1,30 +1,32 @@
 #ifndef RECEIVEAUDIOTHREAD_H_INCLUDED
 #define RECEIVEAUDIOTHREAD_H_INCLUDED
-#ifdef JUCE
+
+#ifdef USE_JUCE
+#include <JuceHeader.h>
 #else
 #include <vector>
 #include <iostream>
 #include <UdpServer.h>
 #include <BeagleRT.h>
 #include <native/task.h>
-#endif /*JUCE*/
+#endif /*USE_JUCE*/
 
-#ifdef JUCE
+#ifdef USE_JUCE
 class ReceiveAudioThread : public Thread {
 #else
 class ReceiveAudioThread{
-#endif /* JUCE */
+#endif /* USE_JUCE */
 private:
     //  FILE *fd; //DEBUG
     //  FILE *fd2; //DEBUG
-#ifdef JUCE
+#ifdef USE_JUCE
 	DatagramSocket socket;
 #else
     UdpServer socket;
-#endif /* JUCE */
+#endif /* USE_JUCE */
     bool listening;
     bool bufferReady;
-#ifdef JUCE
+#ifdef USE_JUCE
     bool threadRunning; //do we really need this ?
 #else
     static bool threadRunning;
@@ -36,7 +38,7 @@
     float readPointer;
     int writePointer;
     int lastValidPointer;
-#ifdef JUCE
+#ifdef USE_JUCE
     int sleepTime;
 #else
     static int sleepTime;
@@ -52,7 +54,7 @@
     void pushPayload(int startIndex);
     void popPayload(int startIndex);
     int readUdpToBuffer();
-#ifdef JUCE
+#ifdef USE_JUCE
 #else
     static bool threadShouldExit();
 	static bool staticConstructed;
@@ -61,7 +63,7 @@
     static std::vector<ReceiveAudioThread *> objAddrs;
 #endif
 public:
-#ifdef JUCE
+#ifdef USE_JUCE
     ReceiveAudioThread(const String &threadName);
 #else
     ReceiveAudioThread();
@@ -82,7 +84,7 @@
     		float samplingRateRatio, int numChannelsInDestination,
     		int channelToWriteTo);
     bool isBufferReady();
-#ifdef JUCE // if we are in Juce, then we run a separate thread for each receiver
+#ifdef USE_JUCE // if we are in Juce, then we run a separate thread for each receiver
     		// (as each of them are typically receiving on a mono or stereo track)
     void run();
 #else
@@ -91,6 +93,6 @@
     static void startThread();
     static void stopThread();
     static int getNumInstances();
-#endif // JUCE
+#endif // USE_JUCE
 };
 #endif  // RECEIVEAUDIOTHREAD_H_INCLUDED