From 8fe8572729f186269b02ac2bb149fe9a25671cae Mon Sep 17 00:00:00 2001 From: Comment Date: Wed, 5 Dec 2012 22:10:04 +0000 Subject: asterisk with thread --- ofAsterisk/src/Asterisk.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'ofAsterisk/src/Asterisk.h') diff --git a/ofAsterisk/src/Asterisk.h b/ofAsterisk/src/Asterisk.h index d3e3786..5033a5c 100755 --- a/ofAsterisk/src/Asterisk.h +++ b/ofAsterisk/src/Asterisk.h @@ -10,26 +10,40 @@ #define PLAYING 3 -class Asterisk +class Asterisk: public ofThread { public: - Asterisk(string passcode="1111"); + Asterisk(){ + } + + void start(){ + + } + void stop(){ + stopThread(); + } + + //-------------------------- + + void setup(string passcode="1111",int millis=1000); virtual ~Asterisk(); void startGame(); void endGame(string score); int update(); - void requestStatus(); int state; + bool isPlaying; int queued; protected: - void cmd(string s); + void cmd(string s); + void threadedFunction(); private: int startTime; FILE *file; int filenum; ofxUDPManager udpConnection; string playerCode; + int statusPollMillis; }; -- cgit v1.2.3