diff options
| author | Comment <tim@gray.(none)> | 2013-03-11 15:28:10 +0000 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2013-03-11 15:28:10 +0000 |
| commit | e0b956174a509b2fb3698383017a264e92665347 (patch) | |
| tree | 8f73ca05cf500a935390fcc33a9fe22e6a1f54f0 /rotord/rotor.h | |
| parent | d1ad9a5c002aa4fafceb8f9740e37238e404177d (diff) | |
manual sID PUT
Diffstat (limited to 'rotord/rotor.h')
| -rwxr-xr-x | rotord/rotor.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/rotord/rotor.h b/rotord/rotor.h index 605ae67..96db4f7 100755 --- a/rotord/rotor.h +++ b/rotord/rotor.h @@ -140,13 +140,16 @@ namespace Rotor { }; class Signal_node: public Node{ public: - float get_output(const float &time) { //default is to pass through first input, if disconnected returns 0 + virtual float get_output(const float &time) {}; + + /*{ //default is to pass through first input, if disconnected returns 0 cerr << "getting output for " << type << "," << ID << endl; if (inputs.size()) { if (inputs[0]->connection) return ((Signal_node*)(inputs[0]->connection))->get_output(time); } return 0.0f; } + */ }; class Image_node: public Node{ public: @@ -188,7 +191,8 @@ namespace Rotor { Is_new_integer* clone(map<string,string> &_settings) { return new Is_new_integer(_settings);}; float get_output(const float &time) { if (inputs[0]->connection) { - if (((int)((Signal_node*)(inputs[0]->connection))->get_output(time))>((int)((Signal_node*)(inputs[0]->connection))->get_output(time-.04))) return 1.0f; + //cerr << "== checking: " << ((int)(((Signal_node*)(inputs[0]->connection))->get_output(time))) << ">" <<((int)(((Signal_node*)(inputs[0]->connection))->get_output(time-.04))) << " ?" << endl; + if (((int)(((Signal_node*)(inputs[0]->connection))->get_output(time)))>((int)(((Signal_node*)(inputs[0]->connection)))->get_output(time-.04))) return 1.0f; } else return 0.0f; } @@ -201,6 +205,12 @@ namespace Rotor { }; Signal_output* clone(map<string,string> &_settings) { return new Signal_output(_settings);}; bool render(const float duration, const float framerate,string &xml_out); + float get_output(const float &time) { + if (inputs[0]->connection) { + return ((Signal_node*)(inputs[0]->connection))->get_output(time); + } + else return 0.0f; + } }; //------------------------------------------------------------------- class Node_factory{ |
