diff options
Diffstat (limited to 'liveengine/src/playlist.cpp')
| -rw-r--r-- | liveengine/src/playlist.cpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/liveengine/src/playlist.cpp b/liveengine/src/playlist.cpp new file mode 100644 index 0000000..896c788 --- /dev/null +++ b/liveengine/src/playlist.cpp @@ -0,0 +1,58 @@ +#include "playlist.h"
+
+playlist::playlist()
+{
+} + +void playlist::load(string _name){ + printf("loading %s\n",_name.c_str()); + + + if( !XML.loadFile(_name) ){
+ printf("unable to load %s check data/ folder\n",_name.c_str());
+ }else { + printf("starting loader thread\n"); + startThread(false, false); //blocking, verbose + } + + + +} + +void playlist::threadedFunction(){ + + if( lock() ){ + + int numLayers=0; + layers.clear(); + if(XML.pushTag("playlist")) {
+ numLayers=XML.getNumTags("svglayer");
+ if(numLayers) {
+ for (int i=0;i<numLayers;i++) {
+ string s=XML.getAttribute("svglayer", "file", "",i);
+ printf("loading %s: ",s.c_str());
+ layers[XML.getAttribute("svglayer", "note", 0,i)]=new svglayer(XML.getAttribute("svglayer", "file", "",i));
+ }
+ }
+ else printf("no SVG layers loaded!\n");
+ numLayers=XML.getNumTags("imglayer");
+ if(numLayers) {
+ for (int i=0;i<numLayers;i++) {
+ string s=XML.getAttribute("imglayer", "file", "",i);
+ printf("%s: ",s.c_str());
+ //int i=XML.getAttribute("imglayer", "note", 0,i);
+ //ofImage i =
+ layers[XML.getAttribute("imglayer", "note", 0,i)]=new imglayer(XML.getAttribute("imglayer", "file", "",i));
+ }
+ }
+ else printf("no IMG layers loaded!\n");
+ } + unlock(); + } + +}
+
+playlist::~playlist()
+{
+ //dtor
+}
|
