summaryrefslogtreecommitdiff
path: root/liveengine/src/playlist.cpp
diff options
context:
space:
mode:
authorComment <tim@gray.(none)>2013-01-24 18:07:04 +0000
committerComment <tim@gray.(none)>2013-01-24 18:07:04 +0000
commit3bf0663e94b6335cb748a50a8b95e8a98d2a0630 (patch)
treea82627776c3bdeedbc99e2b6dcf97b78328a5047 /liveengine/src/playlist.cpp
parente54790009e0d7b6ae5cc4d3e54880ff0bdc63f86 (diff)
folded kinect into main branch
Diffstat (limited to 'liveengine/src/playlist.cpp')
-rwxr-xr-xliveengine/src/playlist.cpp45
1 files changed, 40 insertions, 5 deletions
diff --git a/liveengine/src/playlist.cpp b/liveengine/src/playlist.cpp
index 51bd852..683cd3c 100755
--- a/liveengine/src/playlist.cpp
+++ b/liveengine/src/playlist.cpp
@@ -25,26 +25,61 @@ void playlist::load(string _name){
void playlist::threadedFunction(){
if( lock() ){
- loadsvg();
+ loadLayers();
unlock();
}
}
-void playlist::loadsvg(){
+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: ",s.c_str());
+ printf("loading %s: \n",s.c_str());
layers[XML.getAttribute("svglayer", "note", 0,i)]=new svglayer(XML.getAttribute("svglayer", "file", "",i));
}
thumbnailed=false;
- }
- else printf("no SVG layers loaded!\n");
+ }
+ 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);
+ 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;
+ }
+ numLayers=XML.getNumTags("imglayer");
+ if(numLayers) {
+ for (int i=0;i<numLayers;i++) {
+ string s=XML.getAttribute("imglayer", "files", "",i);
+ printf("loading %s: \n",s.c_str());
+ int note=XML.getAttribute("imglayer", "note", 0,i);
+ int endnote=XML.getAttribute("imglayer", "endnote", 0,i);
+ float rate=XML.getAttribute("imglayer", "rate", 0.0,i);
+ int frames=XML.getAttribute("imglayer", "frames", 0,i);
+ int start=XML.getAttribute("imglayer", "start", 1,i);
+ layers[note]=new imglayer(s,frames,start,rate,note,endnote);
+ if (endnote>note) {
+ for (int j=note+1;j<=endnote;j++) {
+ layers[j]=layers[note];
+ }
+ }
+ }
+ thumbnailed=false;
+ }
XML.popTag();
}