diff options
| author | tim <tim@gray.(none)> | 2014-04-18 03:15:31 +0100 |
|---|---|---|
| committer | tim <tim@gray.(none)> | 2014-04-18 03:15:31 +0100 |
| commit | ee9819390008b29ee2cfc1bc45fac3e3b1530529 (patch) | |
| tree | f412cd6c0a498f720eea816ba8334b33a3d82896 /liveengineUnmapped/src/playlist.cpp | |
| parent | 36474b672e0380e0ff513d5727775afe36dbdc1c (diff) | |
phew
Diffstat (limited to 'liveengineUnmapped/src/playlist.cpp')
| -rwxr-xr-x | liveengineUnmapped/src/playlist.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/liveengineUnmapped/src/playlist.cpp b/liveengineUnmapped/src/playlist.cpp index 61987d1..ce3beba 100755 --- a/liveengineUnmapped/src/playlist.cpp +++ b/liveengineUnmapped/src/playlist.cpp @@ -1,18 +1,18 @@ -#include "playlist.h"
-
-playlist::playlist()
+#include "playlist.h" + +playlist::playlist() { name=""; thumbnail.allocate(128,128,GL_RGB); - thumbnailed=false;
+ thumbnailed=false; } 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());
+ if( !XML.loadFile(_name) ){ + printf("unable to load %s check data/ folder\n",_name.c_str()); }else { //printf("starting loader thread\n"); loadimg(); //how to do this from the worker thread??? @@ -29,38 +29,38 @@ void playlist::threadedFunction(){ unlock(); printf("unlocking thread\n"); } -}
+} void playlist::loadLayers(){ int numLayers=0; layers.clear(); name=XML.getAttribute("playlist", "name", ""); float speed=XML.getAttribute("playlist", "speed", 0); - 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: \n",s.c_str());
- layers[XML.getAttribute("svglayer", "note", 0,i)]=new svglayer(XML.getAttribute("svglayer", "file", "",i));
+ 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: \n",s.c_str()); + layers[XML.getAttribute("svglayer", "note", 0,i)]=new svglayer(XML.getAttribute("svglayer", "file", "",i)); } - thumbnailed=false;
+ thumbnailed=false; } - numLayers=XML.getNumTags("movlayer");
- if(numLayers) {
- for (int i=0;i<numLayers;i++) {
- string s=XML.getAttribute("movlayer", "file", "",i);
+ numLayers=XML.getNumTags("movlayer"); + if(numLayers) { + for (int i=0;i<numLayers;i++) { + string s=XML.getAttribute("movlayer", "file", "",i); printf("loading %s: \n",s.c_str()); int note=XML.getAttribute("movlayer", "note", 0,i); - int endnote=XML.getAttribute("movlayer", "endnote", 0,i);
+ int endnote=XML.getAttribute("movlayer", "endnote", 0,i); layers[note]=new videolayer(XML.getAttribute("movlayer", "file", "",i),note,endnote,speed); if (endnote>note) { for (int j=note+1;j<endnote;j++) { layers[j]=layers[note]; } - }
+ } } - thumbnailed=false;
+ thumbnailed=false; } numLayers=XML.getNumTags("imglayer"); if(numLayers) { @@ -81,7 +81,7 @@ void playlist::loadLayers(){ } thumbnailed=false; } - XML.popTag();
+ XML.popTag(); } } @@ -106,22 +106,22 @@ void playlist::makeThumbnail(){ void playlist::loadimg(){ int numLayers=0; layers.clear(); - if(XML.pushTag("playlist")) {
- 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());
- layers[XML.getAttribute("imglayer", "note", 0,i)]=new imglayer(XML.getAttribute("imglayer", "file", "",i));
- }
- }
+ if(XML.pushTag("playlist")) { + 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()); + layers[XML.getAttribute("imglayer", "note", 0,i)]=new imglayer(XML.getAttribute("imglayer", "file", "",i)); + } + } else printf("no IMG layers loaded!\n"); - XML.popTag();
+ XML.popTag(); } } -
-playlist::~playlist()
-{
- //dtor
-}
+ +playlist::~playlist() +{ + //dtor +} |
