From 34a459de430dd35034ec9404fe7ec54407641085 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Fri, 31 Aug 2012 16:48:23 +0100 Subject: threaded loader --- liveengine/src/testApp.cpp | 51 +++++++++++----------------------------------- 1 file changed, 12 insertions(+), 39 deletions(-) (limited to 'liveengine/src/testApp.cpp') diff --git a/liveengine/src/testApp.cpp b/liveengine/src/testApp.cpp index ee89f6a..0d8ec28 100755 --- a/liveengine/src/testApp.cpp +++ b/liveengine/src/testApp.cpp @@ -1,35 +1,5 @@ #include "testApp.h" -void testApp::loadplaylist(string _name){ - int numLayers=0; - layers.clear(); - if( !XML.loadFile(_name) ){ - printf("unable to load %s check data/ folder\n",_name.c_str()); - }else{ - if(XML.pushTag("playlist")) { - numLayers=XML.getNumTags("svglayer"); - if(numLayers) { - for (int i=0;idraw(lamda); - ofPopMatrix(); + case LIST: + if (list.lock()) { //if playlist is loaded + ofPushMatrix(); + //ofScale(sin(ofGetElapsedTimef())+1.1,sin(ofGetElapsedTimef())+1.1); + if (list.layers.find(note)!=list.layers.end()) list.layers[note]->draw(lamda); + ofPopMatrix(); + list.unlock(); + } break; } } @@ -126,16 +99,16 @@ void testApp::draw(){ //-------------------------------------------------------------- void testApp::keyPressed (int key){ if(key == 'q'){ - loadplaylist("insects.xml"); + list.load("insects.xml"); } if(key == 'w'){ - loadplaylist("barcelona.xml"); + list.load("barcelona.xml"); } if(key == 'e'){ - loadplaylist("organs.xml"); + list.load("organs.xml"); } if(key == 'r'){ - loadplaylist("tai_chi.xml"); + list.load("tai_chi.xml"); } if(key == 's'){ XML.saveFile("settings.xml"); -- cgit v1.2.3