view of/testApp.h @ 50:f4c6999ecfe9 tip

added the files on my computer that aren't aiff s> these shoudl be everything for the big bang fair 2011 - heresy, and tim's file's also here
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Sat, 08 Oct 2011 22:12:49 +0100
parents 0eeda0223db3
children
line wrap: on
line source
#ifndef _TEST_APP
#define _TEST_APP

// uncomment this for OF 007 compatibility
//#define OFX_OPENNI_BETA

#include "ofMain.h"
#include "ofxOpenNI.h"
#include "ofxOsc.h"
#define NUMBER_OF_USERS 3

#define STOPPORT 12343
#define STOPHOST "localhost"

#define HERESY_PORT 12346
#define HERESY_HOST "localhost"//JOE's address??

#define MOPHO_PORT 12342

//#define HOST "169.254.51.147"//Was Tim's ADDRESS - not used any more - use Joe's heresy_host below 
//#define PORT 12344

class testApp : public ofBaseApp{

	public:
		void setup();
		void update();
		void draw();

	void getCoordinates(int userID);
	void sendDataViaOSC(int userID);

		void keyPressed  (int key);
		void keyReleased(int key);
		void mouseMoved(int x, int y );
		void mouseDragged(int x, int y, int button);
		void mousePressed(int x, int y, int button);
		void mouseReleased(int x, int y, int button);
		void windowResized(int w, int h);
		void bezierFunctionStuff(int i);
	void drawAcidSmiley(int userID);
		ofxOpenNIContext context;
		ofxDepthGenerator depth;
		ofxUserGenerator user;
		ofxImageGenerator image;
		//ofImage Davy;
	void sendStopMessageForUser(int userID);
	void sendInformationToHeresy(int userID);
	void sendNoteMessageToHeresy(int noteNumber, int onOrOff, int velocity, int channel);
	
		ofImage anubis;
	ofImage secondUserImage, thirdUserImage;
		bool drawIt;
	
	float maxTorsoValues[3];
	float leftMaximum[3];
	float rightMaximum[3];
	
	int ControlChangeData[NUMBER_OF_USERS][4];//userId, leftX, leftR, rightX, right Y
	void sendControlChangeDataToMax(int userID);
	void sendControlChangeDataToAbleton(int userID);
	
	void checkTorsoMaxima(int id);
	int typeOfFaceToUse[NUMBER_OF_USERS];
	double lastRecordedTime[NUMBER_OF_USERS];//x,y,and z of the head
	float torso[6][3];//x,y,and z of the head
	bool userPresent[6];
	bool notePlayingArray[NUMBER_OF_USERS][16];
	int pitchPlaying[NUMBER_OF_USERS];
	
	bool nowPlaying[NUMBER_OF_USERS][16];
	bool lastPlaying[NUMBER_OF_USERS][16];
	
	float rightHandPosition[NUMBER_OF_USERS][3]; 	
	float leftHandPosition[NUMBER_OF_USERS][3]; 
	double minMaxValues[NUMBER_OF_USERS][2];
	ofTrueTypeFont franklinBook;
	string outputString;
	ofxOscSender sender, stopSender, heresySender, mophoSender;
	
	string userInfoString[3];
	
	bool checkSameUserAs(int userID, int checkID);
	bool checkingSameUser[NUMBER_OF_USERS];
	
};
#endif