comparison src/melodyTriangle.h @ 25:f4ebb87adec1

Added code to keep track of true position of voices in information space; Two voice drawing methods display both true position target position while dragging; string to Voice::status code no longer required; refactored OSC message sending code; added keys to control subdivision ratio for period and shift controls.
author samer
date Sun, 05 Feb 2012 18:13:30 +0000
parents 460c05dd74d0
children 9e8c19c90986
comparison
equal deleted inserted replaced
24:328822cd308c 25:f4ebb87adec1
32 const char *what() const throw(); 32 const char *what() const throw();
33 }; 33 };
34 34
35 // private methods 35 // private methods
36 Voice *get_voice(int id) throw(bad_voice_id); 36 Voice *get_voice(int id) throw(bad_voice_id);
37 void voiceKeypress(Voice *v, int key);
37 38
38 void voiceKeypress(Voice *v, int key);
39 void sendReplyTo(); 39 void sendReplyTo();
40 void sendCalibrate(); 40 void sendCalibrate();
41 void sendDeath(int id);
42 void sendPosition(Voice *v); 41 void sendPosition(Voice *v);
43 void sendPeriod(int id, int num, int den); 42 void sendPeriod(int id, int num, int den);
44 void sendShift(int id, int num, int den); 43 void sendShift(int id, int num, int den);
45 void sendOctave(int id, int oct); 44 void sendOctave(int id, int oct);
46 void sendAmplitude(int id, float amp); 45 void sendAmplitude(int id, float amp);
46 void send(const char *msg);
47 void send(const char *msg, int a);
48 void handleMessage(ofxOscMessage &m);
49
47 bool clipToTriangle(int *cx, int *cy); 50 bool clipToTriangle(int *cx, int *cy);
48 void fitTriangleIn(int w, int h); 51 void fitTriangleIn(int w, int h);
49 void handleMessage(ofxOscMessage &m);
50 void reset(); 52 void reset();
51 53
52 // Immutable after construction and setup 54 // Immutable after construction and setup
53 ofxOscSender sender; 55 ofxOscSender sender;
54 ofxOscReceiver receiver; 56 ofxOscReceiver receiver;
59 int x1,y1,x2,y2,x3,y3; // Triangle Coords 61 int x1,y1,x2,y2,x3,y3; // Triangle Coords
60 int DX13, DY13, SQLEN13; // to optimise clipping 62 int DX13, DY13, SQLEN13; // to optimise clipping
61 63
62 // mutable state 64 // mutable state
63 Voice *voices[MAX_VOICES]; 65 Voice *voices[MAX_VOICES];
64 int voiceGrabbed; 66 Voice *voiceGrabbed;
65 bool constrained; 67 bool constrained;
66 bool enableKeys; 68 bool enableKeys;
67 int display_frames; 69 int display_frames;
70 int ratio;
71 int tempoIndex;
68 string display_msg; 72 string display_msg;
69 ofTrueTypeFont display_font; 73 ofTrueTypeFont display_font;
70 }; 74 };