Mercurial > hg > beaglert
comparison include/ClockSyncThread.h @ 135:e77e2e712fbc ClockSync
To work with the ClockSync plugin
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Sat, 12 Sep 2015 20:05:55 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
133:04b1678614c9 | 135:e77e2e712fbc |
---|---|
1 #ifndef CLOCK_SYNC_THREAD_H_INCLUDED | |
2 #define CLOCK_SYNC_THREAD_H_INCLUDED | |
3 | |
4 #ifdef USE_JUCE | |
5 #include <JuceHeader.h> | |
6 #define IS_STATIC | |
7 #else | |
8 #define IS_STATIC static | |
9 #include <BeagleRT.h> | |
10 #endif /*USE_JUCE*/ | |
11 | |
12 #include "ClockSync.h" | |
13 | |
14 #ifdef USE_JUCE | |
15 class ClockSyncThread : public Thread { | |
16 #else | |
17 class ClockSyncThread { | |
18 #endif /* USE_JUCE */ | |
19 private: | |
20 IS_STATIC myClock_t lastTime; // Used for clock synchronization | |
21 IS_STATIC bool listening; | |
22 IS_STATIC ClockSync clockSync; | |
23 IS_STATIC VirtualClock *virtualClock; | |
24 #ifdef USE_JUCE | |
25 #else | |
26 IS_STATIC bool threadIsExiting; | |
27 IS_STATIC AuxiliaryTask clockSyncTask; | |
28 #endif /* USE_JUCE */ | |
29 | |
30 public: | |
31 #ifdef USE_JUCE | |
32 ClockSyncThread(const String &threadName); | |
33 #else | |
34 ClockSyncThread(); | |
35 #endif /* USE_JUCE */ | |
36 ~ClockSyncThread(); | |
37 IS_STATIC void init(bool isSlave, int aPort, VirtualClock &aVirtualClock); | |
38 IS_STATIC void setVirtualClock(VirtualClock &aVirtualClock); | |
39 | |
40 IS_STATIC void run(); | |
41 #ifdef USE_JUCE | |
42 #else | |
43 IS_STATIC void startThread(); | |
44 IS_STATIC void stopThread(); | |
45 IS_STATIC bool threadShouldExit(); | |
46 #endif // USE_JUCE | |
47 }; | |
48 #endif // CLOCK_SYNC_THREAD_H_INCLUDED |