summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2013-11-08 10:13:05 +0000
committerTim Redfern <tim@eclectronics.org>2013-11-08 10:13:05 +0000
commita22751cac56d143e41f1336b962d83032e06dd61 (patch)
tree88763a0442612a31c0307a11cb8309e3cc6b6d94
parentab6e18cbb962c4ecc5a5099b1e3f1fff8d227ff6 (diff)
parent6d5ef1f8ed4c97814718dead6e6949704217a66d (diff)
fix media path with json loader
-rw-r--r--rotord/src/graph.cpp1
-rw-r--r--rotord/src/rotor.h6
2 files changed, 4 insertions, 3 deletions
diff --git a/rotord/src/graph.cpp b/rotord/src/graph.cpp
index 9622c04..ebfcece 100644
--- a/rotord/src/graph.cpp
+++ b/rotord/src/graph.cpp
@@ -333,7 +333,6 @@ bool Graph::parseJson(string &data,string &media_path){
}
if (attr->type=="string") {
val=jnodes[i]["attributes"][m]["value"].asString();
- //attr->value=val;
attr->init(val);
}
if (attr->type=="array"){
diff --git a/rotord/src/rotor.h b/rotord/src/rotor.h
index b0d10c6..a54fedd 100644
--- a/rotord/src/rotor.h
+++ b/rotord/src/rotor.h
@@ -260,7 +260,8 @@ namespace Rotor {
create_attribute(_attr,_desc,_title,_value,_vals,_type);
alias=&(attributes[_attr]->intVal);
};
- virtual void init_attribute(const string &attr){};
+ virtual void init_attribute(const string &attr){
+ };
string description;
string type;
string ID;
@@ -567,6 +568,7 @@ namespace Rotor {
};
Video_loader(map<string,string> &settings): Video_loader() {
base_settings(settings);
+ for (auto a:attributes) cerr<<"Video loader: "<<a.first<<" set to "<<a.second->value<<endl;
if (attributes["filename"]->value!="") {
isLoaded=load(find_setting(settings,"media_path","")+attributes["filename"]->value);
}
@@ -575,7 +577,7 @@ namespace Rotor {
~Video_loader(){};
void init_attribute(const string &attr){
if (attr=="filename") {
- load(attributes["media_path"]->value+attributes[attr]->value);
+ isLoaded=load(attributes["media_path"]->value+attributes[attr]->value);
}
};
Video_loader* clone(map<string,string> &_settings) { return new Video_loader(_settings);};