summaryrefslogtreecommitdiff
path: root/ofAsterisk/src/Asterisk.h
blob: 5033a5cfc622ac15de8ae3eae1e2ac085ddb6805 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef ASTERISK_H
#define ASTERISK_H

#include "ofMain.h"
#include "ofxNetwork.h"

#define IDLE 0
#define WAITING 1
#define STARTING 2
#define PLAYING 3


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 threadedFunction();
    private:
	int startTime;
	FILE *file;
	int filenum;
	ofxUDPManager udpConnection;
	string playerCode;
	int statusPollMillis;
	
};

#endif // ASTERISK_H