summaryrefslogtreecommitdiff
path: root/NT/src/nodes.h
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2014-01-19 19:54:38 +0000
committerTim Redfern <tim@eclectronics.org>2014-01-19 19:54:38 +0000
commitce528aa299501ecab63018f91b937766ffbc95be (patch)
tree34972d49d69c5cf926a3974a020e945ff4576a8c /NT/src/nodes.h
parent1e01ca3e89beca6870a3112c4513df66dd07dbb1 (diff)
variables writing json
Diffstat (limited to 'NT/src/nodes.h')
-rw-r--r--NT/src/nodes.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/NT/src/nodes.h b/NT/src/nodes.h
index ede81eb..64d14a2 100644
--- a/NT/src/nodes.h
+++ b/NT/src/nodes.h
@@ -13,14 +13,14 @@ namespace Rotor{
class Time: public Double_node {
public:
Time(){type="time";};
- Time(map<string,string> &settings):Time() {
+ Time(Json::Value &settings):Time() {
init(settings);
};
const double &get_output(const Frame_parameters &frame){
value=frame.time;
return value;
}
- Time* clone(map<string,string> &_settings) { return new Time(_settings);};
+ Time* clone(Json::Value &_settings) { return new Time(_settings);};
private:
double value;
};
@@ -34,15 +34,15 @@ namespace Rotor{
type_id="11c67850-7ce4-11e3-abf6-930ef8613c46";
ui_type="none";
}
- Multiply(map<string,string> &settings):Multiply() {
+ Multiply(Json::Value &settings):Multiply() {
init(settings);
};
const double &get_output(const Frame_parameters &frame){
- double val=1.0f;
- for (auto var:factors->values) val*=var.get(frame);
- return val;
+ result=1.0f;
+ for (auto var:factors->values) result*=var.get(frame);
+ return result;
}
- Multiply* clone(map<string,string> &_settings) { return new Multiply(_settings);};
+ Multiply* clone(Json::Value &_settings) { return new Multiply(_settings);};
private:
Variable_array_type<double> *factors;
double result;
@@ -57,7 +57,7 @@ namespace Rotor{
inlet=create_inlet<double>("inlet");
type="print";
}
- Print(map<string,string> &settings):Print() {
+ Print(Json::Value &settings):Print() {
init(settings);
};
const std::string &get_output(const Frame_parameters &frame){
@@ -66,7 +66,7 @@ namespace Rotor{
result=out.str();
return result;
}
- Print* clone(map<string,string> &_settings) { return new Print(_settings);};
+ Print* clone(Json::Value &_settings) { return new Print(_settings);};
private:
Variable_type<double> *inlet;
std::string result;