From e0b956174a509b2fb3698383017a264e92665347 Mon Sep 17 00:00:00 2001 From: Comment Date: Mon, 11 Mar 2013 15:28:10 +0000 Subject: manual sID PUT --- rotord/rotor.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'rotord/rotor.h') 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 &_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 &_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{ -- cgit v1.2.3