From dba01ce870165fd8d8a5fea921cb31f7c4e8c25f Mon Sep 17 00:00:00 2001 From: Comment Date: Mon, 10 Dec 2012 19:30:27 +0000 Subject: fixed race condition in asterisk driver --- ofAsterisk/src/Asterisk.h | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'ofAsterisk/src/Asterisk.h') diff --git a/ofAsterisk/src/Asterisk.h b/ofAsterisk/src/Asterisk.h index 5033a5c..fb6097c 100755 --- a/ofAsterisk/src/Asterisk.h +++ b/ofAsterisk/src/Asterisk.h @@ -4,10 +4,12 @@ #include "ofMain.h" #include "ofxNetwork.h" -#define IDLE 0 -#define WAITING 1 -#define STARTING 2 -#define PLAYING 3 +#define ASTERISK_IDLE 0 +#define ASTERISK_WAITING 1 +#define ASTERISK_STARTING 2 +#define ASTERISK_PLAYING 3 +#define ASTERISK_GAMESTARTED 1000 +#define ASTERISK_GAMEOVER 1001 class Asterisk: public ofThread @@ -15,27 +17,27 @@ class Asterisk: public ofThread public: Asterisk(){ } - + void start(){ - + } void stop(){ stopThread(); } //-------------------------- - + void setup(string passcode="1111",int millis=1000); virtual ~Asterisk(); void startGame(); void endGame(string score); int update(); int state; - bool isPlaying; int queued; protected: - void cmd(string s); + void cmd(string s); + void scmd(string s); void threadedFunction(); private: int startTime; @@ -43,8 +45,9 @@ class Asterisk: public ofThread int filenum; ofxUDPManager udpConnection; string playerCode; - int statusPollMillis; - + int statusPollMillis; + + }; #endif // ASTERISK_H -- cgit v1.2.3