From 874194d055d0c90a7874a06be95ca2e087616a9d Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Tue, 14 Jan 2014 17:00:14 +0000 Subject: converting settings initiaiers to json --- NT/src/nodes.h | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'NT/src/nodes.h') diff --git a/NT/src/nodes.h b/NT/src/nodes.h index ddb1a3d..ede81eb 100644 --- a/NT/src/nodes.h +++ b/NT/src/nodes.h @@ -12,7 +12,7 @@ namespace Rotor{ }; class Time: public Double_node { public: - Time(){node_type="time";}; + Time(){type="time";}; Time(map &settings):Time() { init(settings); }; @@ -27,21 +27,24 @@ namespace Rotor{ class Multiply: public Double_node { public: Multiply(){ - inlets=create_array("inlet"); - value=create_inlet("value"); - node_type="multiply"; + factors=create_array("factors"); + type="multiply"; + description="multiplies numbers"; + title="Multiply"; + type_id="11c67850-7ce4-11e3-abf6-930ef8613c46"; + ui_type="none"; } Multiply(map &settings):Multiply() { init(settings); }; const double &get_output(const Frame_parameters &frame){ - result=inlets->get(0,frame)*value->get(frame); - return result; + double val=1.0f; + for (auto var:factors->values) val*=var.get(frame); + return val; } Multiply* clone(map &_settings) { return new Multiply(_settings);}; private: - Variable_array_type *inlets; - Variable_type *value; + Variable_array_type *factors; double result; }; class String_node: public Node_type { @@ -52,7 +55,7 @@ namespace Rotor{ public: Print(){ inlet=create_inlet("inlet"); - node_type="print"; + type="print"; } Print(map &settings):Print() { init(settings); -- cgit v1.2.3