Mercurial > hg > tweakathon2ios
annotate SynthParam.h @ 52:89944ab3e129 tip
fix oF linker errors ios8
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Tue, 03 Feb 2015 13:18:23 +0000 |
parents | d5e928887f51 |
children |
rev | line source |
---|---|
rt300@0 | 1 // |
rt300@0 | 2 // SynthParam.h |
rt300@0 | 3 // tweakathlon |
rt300@0 | 4 // |
rt300@0 | 5 // Created by Robert Tubb on 10/10/2014. |
rt300@0 | 6 // |
rt300@0 | 7 // |
rt300@0 | 8 |
rt300@0 | 9 #ifndef tweakathlon_SynthParam_h |
rt300@0 | 10 #define tweakathlon_SynthParam_h |
rt300@0 | 11 |
rt300@0 | 12 // class that handles what a synth param "is" , a wrapper for the pd control |
rt300@0 | 13 class SynthParam { |
rt300@0 | 14 public: |
rt300@0 | 15 static int mappingUID; |
rt300@0 | 16 |
rt300@0 | 17 |
rt300@0 | 18 AppCore* core; |
rt300@0 | 19 SynthParam(int aVal , AppCore* aCore, string aName, string aSynthPrefix){ |
rt300@0 | 20 mappingID = mappingUID++; |
rt300@0 | 21 value = aVal; |
rt300@0 | 22 core = aCore; |
rt300@0 | 23 name = aName; |
rt300@0 | 24 synthPrefix = aSynthPrefix; |
rt300@0 | 25 // log the fact that this id is mapped to a certain param? |
rt300@0 | 26 }; |
rt300@0 | 27 void setValue(int i){ |
rt300@0 | 28 value = i; |
rt300@0 | 29 sendToPD(); |
rt300@0 | 30 }; |
rt300@9 | 31 void setValueWithoutSend(int i){ |
rt300@9 | 32 value = i; |
rt300@9 | 33 } |
rt300@0 | 34 int getValue() const{ |
rt300@0 | 35 return value; |
rt300@0 | 36 } |
rt300@0 | 37 int getID() const {return mappingID;}; |
rt300@0 | 38 string getName() const {return name;}; |
rt300@0 | 39 void sendToPD() const |
rt300@0 | 40 { |
rt300@0 | 41 // sends this parameter to pd synth |
rt300@0 | 42 List toPD; |
rt300@0 | 43 toPD.addSymbol(synthPrefix); |
rt300@0 | 44 toPD.addSymbol(name); |
rt300@0 | 45 toPD.addFloat(value); // rounding here?? |
rt300@0 | 46 |
rt300@0 | 47 core->pd.sendList("fromOF", toPD); |
rt300@0 | 48 //cout << "sending" << synthPrefix << ":" << name << " : " << value << "\n"; |
rt300@0 | 49 }; |
rt300@0 | 50 |
rt300@0 | 51 private: |
rt300@0 | 52 int value; // 0 to 127 |
rt300@0 | 53 int mappingID; // should be globally unique |
rt300@0 | 54 string name; // the string that gets routed in PD, and also the display label (?) |
rt300@0 | 55 string synthPrefix; |
rt300@0 | 56 |
rt300@0 | 57 }; |
rt300@0 | 58 |
rt300@0 | 59 #endif |