Mercurial > hg > screen-ui
changeset 2:8c4903923021
added voiceIdOffset command param
author | Henrik Ekeus <hekeus@eecs.qmul.ac.uk> |
---|---|
date | Tue, 24 Jan 2012 14:41:27 +0000 |
parents | 3b6ab3b28808 |
children | 3314e795adea |
files | main.cpp melodyTriangle.cpp melodyTriangle.h |
diffstat | 3 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/main.cpp Tue Jan 24 13:48:54 2012 +0000 +++ b/main.cpp Tue Jan 24 14:41:27 2012 +0000 @@ -22,6 +22,7 @@ ofRunApp( new melodyTriangle(argc>1 ? argv[1] : HOST, argc>2 ? atoi(argv[2]) : PORT, argc>3 ? atoi(argv[3]) : NUMVOICES, - argc>5 ? atoi(argv[5]) : true)); + argc>5 ? atoi(argv[5]) : true, + argc>6 ? atoi(argv[6]) : 0)); }
--- a/melodyTriangle.cpp Tue Jan 24 13:48:54 2012 +0000 +++ b/melodyTriangle.cpp Tue Jan 24 14:41:27 2012 +0000 @@ -11,10 +11,11 @@ */ -melodyTriangle::melodyTriangle(const char *host, int port, int numVoices, bool enableKeys){ +melodyTriangle::melodyTriangle(const char *host, int port, int numVoices, bool enableKeys,int voiceIdOffset){ printf("in constructor: %s %i %i %i\n",host,port,numVoices,enableKeys); this->numVoices=numVoices; this->enableKeys=enableKeys; + this->voiceIdOffset=voiceIdOffset; //voices=*Voice[numVoices]; sender.setup( host,port ); } @@ -49,7 +50,7 @@ for (int i=0;i<numVoices;i++){ - voices[i]=new Voice(i+1,x2+15,y1+20+i*30); + voices[i]=new Voice(i+1+voiceIdOffset,x2+15,y1+20+i*30); } voiceGrabbed=-1; }
--- a/melodyTriangle.h Tue Jan 24 13:48:54 2012 +0000 +++ b/melodyTriangle.h Tue Jan 24 14:41:27 2012 +0000 @@ -12,7 +12,7 @@ class melodyTriangle : public ofBaseApp{ public: - melodyTriangle(const char *host, int port, int numVoices, bool enableKeys); + melodyTriangle(const char *host, int port, int numVoices, bool enableKeys, int voiceIdOffset); void setup(); void update(); @@ -26,6 +26,7 @@ void mouseReleased(int x, int y, int button); void windowResized(int w, int h); int numVoices; + int voiceIdOffset; bool enableKeys; float counter; bool bSmooth;