diff options
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{ |
