Mercurial > hg > screen-ui
diff 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 |
line wrap: on
line diff
--- a/src/melodyTriangle.h Sat Feb 04 23:15:02 2012 +0000 +++ b/src/melodyTriangle.h Sun Feb 05 18:13:30 2012 +0000 @@ -34,19 +34,21 @@ // private methods Voice *get_voice(int id) throw(bad_voice_id); + void voiceKeypress(Voice *v, int key); - void voiceKeypress(Voice *v, int key); void sendReplyTo(); void sendCalibrate(); - void sendDeath(int id); void sendPosition(Voice *v); void sendPeriod(int id, int num, int den); void sendShift(int id, int num, int den); void sendOctave(int id, int oct); void sendAmplitude(int id, float amp); + void send(const char *msg); + void send(const char *msg, int a); + void handleMessage(ofxOscMessage &m); + bool clipToTriangle(int *cx, int *cy); void fitTriangleIn(int w, int h); - void handleMessage(ofxOscMessage &m); void reset(); // Immutable after construction and setup @@ -61,10 +63,12 @@ // mutable state Voice *voices[MAX_VOICES]; - int voiceGrabbed; + Voice *voiceGrabbed; bool constrained; bool enableKeys; int display_frames; + int ratio; + int tempoIndex; string display_msg; ofTrueTypeFont display_font; };