summaryrefslogtreecommitdiff
path: root/rotord/src/graph.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rotord/src/graph.cpp')
-rw-r--r--rotord/src/graph.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/rotord/src/graph.cpp b/rotord/src/graph.cpp
index e34ddec..9544446 100644
--- a/rotord/src/graph.cpp
+++ b/rotord/src/graph.cpp
@@ -324,13 +324,18 @@ bool Graph::parseJson(string &data,string &media_path){
Node* node=factory.create(settings);
for (uint32_t m=0;m<jnodes[i]["attributes"].size();m++){
string attribute=jnodes[i]["attributes"][m]["name"].asString();
+ string val="";
if (node->attributes.find(attribute)!=node->attributes.end()){
Attribute *attr=node->attributes.find(attribute)->second;
if (attr->type=="enum"){
- string val=jnodes[i]["attributes"][m]["value"].asString();
- attr->init(val);
+ val=jnodes[i]["attributes"][m]["value"].asString();
+ attr->init(val);
}
- else if (attr->type=="array"){
+ if (attr->type=="string") {
+ val=jnodes[i]["attributes"][m]["value"].asString();
+ attr->value=val;
+ }
+ if (attr->type=="array"){
std::vector<std::string> vals;
for (uint32_t i5 = 0; i5 < jnodes[i]["attributes"][m]["value"].size(); i5++ )
@@ -338,15 +343,12 @@ bool Graph::parseJson(string &data,string &media_path){
vals.push_back(jnodes[i]["attributes"][m]["value"][i5].asString());
}
attr->init(vals);
-
- }
- else {
- string val=jnodes[i]["attributes"][m]["value"].asString();
- attr->value=val;
}
+ //cerr << "Rotor: setting attribute '"<<attribute<<"' of "<<nodeID<<" type "<<attr->type<<" to "<<val<<endl;
+ cerr << "Rotor: setting attribute '"<<attribute<<"' of "<<nodeID<<" type "<<attr->type<<" to "<<val<<endl;
+
}
//settings[attribute]=val;
- //cerr << "Rotor: setting attribute '"<<attribute<<"' of "<<nodeID<<" to "<<val<<endl;
}
if (node) {
if (nodes.find(nodeID)==nodes.end()){