Mercurial > hg > screen-ui
diff src/melodyTriangle.h @ 37:260cc4f4d70a
Now using OSC bundles to make sure cotemporal messages are received in correct order;
also added randInit state flag (toggle 'i') to control sending of /randinit on birth.
author | samer |
---|---|
date | Wed, 22 Feb 2012 00:30:20 +0000 |
parents | 06a2fdb333ca |
children | 330f2746fedd |
line wrap: on
line diff
--- a/src/melodyTriangle.h Wed Feb 15 12:26:10 2012 +0000 +++ b/src/melodyTriangle.h Wed Feb 22 00:30:20 2012 +0000 @@ -32,29 +32,28 @@ const char *what() const throw(); }; + // static methods + ofxOscMessage msgReplyTo(); + ofxOscMessage msgCalibrate(); + static ofxOscMessage msgPosition(Voice *v); + static ofxOscMessage msgPeriod(int id, int num, int den); + static ofxOscMessage msgShift(int id, int num, int den); + static ofxOscMessage msgOctave(int id, int oct); + static ofxOscMessage msgAmplitude(int id, float amp); + static ofxOscMessage msg(const char *msg); + static ofxOscMessage msg(const char *msg, int a); + static ofxOscMessage msg(const char *msg, int a, int b); + static ofxOscMessage msg(const char *msg, int a, int b, int c); + // private methods + void handleMessage(ofxOscMessage &m); Voice *get_voice(int id) throw(bad_voice_id); void voiceKeypress(Voice *v, int key); - - void sendReplyTo(); - void sendCalibrate(); - 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 send(const char *msg, int a, int b); - void send(const char *msg, int a, int b, int c); - void handleMessage(ofxOscMessage &m); - + void setKeyboardEnable(bool en); bool clipToTriangle(int *cx, int *cy); void fitTriangleIn(int w, int h); void reset(); - void setKeyboardEnable(bool en); - // Immutable after construction and setup ofxOscSender sender; ofxOscReceiver receiver; @@ -72,6 +71,7 @@ bool enableKeys; bool allowExit; bool snapTruePos; + bool randInit; int display_frames; int ratio; int tempoIndex;