diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-11-18 14:40:41 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-11-18 14:40:41 +0000 |
| commit | a36735b4585521218268da5fed2214ba239b4c2a (patch) | |
| tree | 77f951acb62d61c88b0b01d4bcb34367e44abc91 /rotord/src/graph.cpp | |
| parent | 6c5ba0ff0a4301b932c70aee6b4c87b2092d8bff (diff) | |
simple lyrics script
Diffstat (limited to 'rotord/src/graph.cpp')
| -rw-r--r-- | rotord/src/graph.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/rotord/src/graph.cpp b/rotord/src/graph.cpp index ebfcece..cc624a8 100644 --- a/rotord/src/graph.cpp +++ b/rotord/src/graph.cpp @@ -344,6 +344,15 @@ bool Graph::parseJson(string &data,string &media_path){ } attr->init(vals); } + if (attr->type=="lyrics"){ + std::map<float,std::pair<string,float> > lyrics; + for (auto k:jnodes[i]["attributes"][m]["value"]){ + if (k.size()>2&&k[0].isString()&&k[1].isNumeric()&&k[2].isNumeric()) { + lyrics[k[1].asFloat()]=std::make_pair(k[0].asString(),k[2].asFloat()); + } + } + ((Lyrics_attribute*)attr)->init(lyrics); + } node->init_attribute(attribute); //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; |
