diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-09-04 15:30:03 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-09-04 15:30:03 +0100 |
| commit | be19f5a21dc1fe717711d76f500f6bfe0c4d166b (patch) | |
| tree | 8cffe4ea47bd5cd66f8fe5fd1fb537c40a52e8f4 /rotord/src/rotor.h | |
| parent | bb4e23344b03c4f0947852530e13885035a6c3fb (diff) | |
adding final audio feature
Diffstat (limited to 'rotord/src/rotor.h')
| -rwxr-xr-x | rotord/src/rotor.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/rotord/src/rotor.h b/rotord/src/rotor.h index a769430..d6426f5 100755 --- a/rotord/src/rotor.h +++ b/rotord/src/rotor.h @@ -159,9 +159,9 @@ namespace Rotor { }; class Node{ public: + Node(){duplicate_inputs=false;}; virtual Node* clone(map<string,string> &_settings)=0; //pure virtual virtual ~Node(){ - duplicate_inputs=false; }; vector<Signal_input*> inputs; //simple node can have signal inputs, output depends on node type unordered_map<string,Parameter*> parameters; //linked parameters can convert from settings to inputs @@ -199,12 +199,13 @@ namespace Rotor { for (auto a: attributes){ if (find_setting(settings,a.first,"")!="") { attributes[a.first]->init(find_setting(settings,a.first,"")); + cerr<<"setting attribute '"<<a.first<<"'' to "<<find_setting(settings,a.first,"")<<" (index: "<<attributes[a.first]->intVal<<")"<<endl; } } for (auto p: parameters){ if (find_setting(settings,p.first,"")!="") { parameters[p.first]->init(find_setting(settings,p.first,0.0f)); - cerr<<"setting parameter "<<p.first<<" to "<<find_setting(settings,p.first,0.0f)<<endl; + cerr<<"setting parameter '"<<p.first<<"'' to "<<find_setting(settings,p.first,0.0f)<<endl; } } } @@ -778,7 +779,7 @@ namespace Rotor { float weights[3] = {parameters["weight_h"]->value,parameters["weight_s"]->value,parameters["weight_v"]->value}; float weight_total=255.0f/pow(pow(weights[0]*255,2)+pow(weights[1]*255,2)+pow(weights[2]*255,2),0.5); - + for (int i=0;i<frame.w*frame.h;i++){ dist=0; for (int j=0;j<3;j++){ @@ -788,8 +789,8 @@ namespace Rotor { uint8_t id=(uint8_t)(sqrt((float)dist)*weight_total); mask.data[i]=id; } - - /* + + /* for (int i=0;i<frame.w*frame.h;i++){ dist=0; @@ -1142,7 +1143,7 @@ namespace Rotor { private: Node_factory factory; int outW,outH; - + }; class Audio_thumbnailer: public Audio_processor { public: |
