summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xliveengineUnmapped/bin/data/knights.xml56
-rw-r--r--liveengineUnmapped/bin/data/settings.xml23
-rwxr-xr-xliveengineUnmapped/src/main.cpp4
-rwxr-xr-xliveengineUnmapped/src/playlist.cpp3
-rwxr-xr-xliveengineUnmapped/src/testApp.cpp12
-rwxr-xr-xliveengineUnmapped/src/testApp.h1
-rwxr-xr-xliveengineUnmapped/src/viewport.cpp31
7 files changed, 45 insertions, 85 deletions
diff --git a/liveengineUnmapped/bin/data/knights.xml b/liveengineUnmapped/bin/data/knights.xml
deleted file mode 100755
index 3b4d5f1..0000000
--- a/liveengineUnmapped/bin/data/knights.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<playlist>
- <svglayer note="36" file="mil_knights/knight08.WMF.svg"/>
- <svglayer note="37" file="mil_knights/knight09.WMF.svg"/>
- <svglayer note="38" file="mil_knights/knight10.WMF.svg"/>
- <svglayer note="39" file="mil_knights/knight11.WMF.svg"/>
- <svglayer note="40" file="mil_knights/knight12.WMF.svg"/>
- <svglayer note="41" file="mil_knights/knight13.WMF.svg"/>
- <svglayer note="42" file="mil_knights/knight14.WMF.svg"/>
- <svglayer note="43" file="mil_knights/knight15.WMF.svg"/>
- <svglayer note="44" file="mil_knights/knight16.WMF.svg"/>
- <svglayer note="45" file="mil_knights/knight17.WMF.svg"/>
- <svglayer note="46" file="mil_knights/knight18.WMF.svg"/>
- <svglayer note="47" file="mil_knights/knight19.WMF.svg"/>
- <svglayer note="48" file="mil_knights/knight20.WMF.svg"/>
- <svglayer note="49" file="mil_knights/knight21.WMF.svg"/>
- <svglayer note="50" file="mil_knights/knight22.WMF.svg"/>
- <svglayer note="51" file="mil_knights/knight23.WMF.svg"/>
- <svglayer note="52" file="mil_knights/knight24.WMF.svg"/>
- <svglayer note="53" file="mil_knights/knight25.WMF.svg"/>
- <svglayer note="54" file="mil_knights/knight26.WMF.svg"/>
- <svglayer note="55" file="mil_knights/knight27.WMF.svg"/>
- <svglayer note="56" file="mil_knights/knight28.WMF.svg"/>
- <svglayer note="57" file="mil_knights/knight29.WMF.svg"/>
- <svglayer note="58" file="mil_knights/knight30.WMF.svg"/>
- <svglayer note="59" file="mil_knights/knight31.WMF.svg"/>
- <svglayer note="60" file="mil_knights/knight32.WMF.svg"/>
- <svglayer note="61" file="mil_knights/knight33.WMF.svg"/>
- <svglayer note="62" file="mil_knights/knight34.WMF.svg"/>
- <svglayer note="63" file="mil_knights/knight35.WMF.svg"/>
- <svglayer note="64" file="mil_knights/knight36.WMF.svg"/>
- <svglayer note="65" file="mil_knights/knight37.WMF.svg"/>
-
- <svglayer note="67" file="mil_knights/knight39.WMF.svg"/>
- <svglayer note="68" file="mil_knights/knight40.WMF.svg"/>
- <svglayer note="69" file="mil_knights/knight41.WMF.svg"/>
- <svglayer note="70" file="mil_knights/knight42.WMF.svg"/>
- <svglayer note="71" file="mil_knights/knight43.WMF.svg"/>
- <svglayer note="72" file="mil_knights/knight44.WMF.svg"/>
- <svglayer note="73" file="mil_knights/knight45.WMF.svg"/>
- <svglayer note="74" file="mil_knights/knight46.WMF.svg"/>
- <svglayer note="75" file="mil_knights/knight47.WMF.svg"/>
- <svglayer note="76" file="mil_knights/knight48.WMF.svg"/>
- <svglayer note="77" file="mil_knights/knight49.WMF.svg"/>
- <svglayer note="78" file="mil_knights/knight50.WMF.svg"/>
- <svglayer note="79" file="mil_knights/knight51.WMF.svg"/>
- <svglayer note="80" file="mil_knights/knight52.WMF.svg"/>
- <svglayer note="81" file="mil_knights/knight53.WMF.svg"/>
- <svglayer note="82" file="mil_knights/knight54.WMF.svg"/>
- <svglayer note="83" file="mil_knights/knight55.WMF.svg"/>
- <svglayer note="84" file="mil_knights/knight56.WMF.svg"/>
- <svglayer note="85" file="mil_knights/knight57.WMF.svg"/>
- <svglayer note="86" file="mil_knights/knight58.WMF.svg"/>
-
-</playlist>
-
diff --git a/liveengineUnmapped/bin/data/settings.xml b/liveengineUnmapped/bin/data/settings.xml
index 4330b31..6a97584 100644
--- a/liveengineUnmapped/bin/data/settings.xml
+++ b/liveengineUnmapped/bin/data/settings.xml
@@ -1,14 +1,9 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<liveEngine port="1" channel="0">
-<viewport mapped="0" w="768" h="1360" x="0" y="0" rot="-90" ox="-86" oy="-384">
- <settings fov="17.500000" roll="0.000000" targX="-247.713226" targY="212.727859" targZ="0.000000" lat="0.000000" lng="180.000000" dolly="600.000000" />
- </viewport>
- <viewport mapped="0" w="768" h="1360" x="1360" y="0" rot="-90" ox="-86" oy="-384">
- <settings fov="17.500000" roll="0.000000" targX="-247.713226" targY="212.727859" targZ="0.000000" lat="0.000000" lng="180.000000" dolly="600.000000" />
- </viewport>
-<viewport mapped="0" w="1360" h="768" x="2720" y="0" rot="0" ox="-680" oy="-384">
- <settings fov="17.500000" roll="0.000000" targX="-247.713226" targY="212.727859" targZ="0.000000" lat="0.000000" lng="180.000000" dolly="600.000000" />
- </viewport>
-</liveEngine>
-
-
+<?xml version="1.0" encoding="UTF-8" ?>
+<liveEngine port="1" channel="0">
+ <viewport mapped="0" w="480" h="270" x="0" y="0" rot="0" >
+ </viewport>
+ <viewport mapped="0" w="270" h="480" x="480" y="0" rot="-90" >
+ </viewport>
+ <viewport mapped="0" w="270" h="480" x="960" y="0" rot="-90" >
+ </viewport>
+</liveEngine>
diff --git a/liveengineUnmapped/src/main.cpp b/liveengineUnmapped/src/main.cpp
index 615da21..cb2b5b2 100755
--- a/liveengineUnmapped/src/main.cpp
+++ b/liveengineUnmapped/src/main.cpp
@@ -7,8 +7,8 @@
int main( ){
ofAppGlutWindow window;
- //ofSetupOpenGL(ofxFensterManager::get(),1200,300, OF_WINDOW);
- ofSetupOpenGL(ofxFensterManager::get(),4080,768, OF_WINDOW); //2048,768
+ ofSetupOpenGL(ofxFensterManager::get(),1440,270, OF_WINDOW); //480x270
+ //ofSetupOpenGL(ofxFensterManager::get(),4080,768, OF_WINDOW); //2048,768
//ofSetupOpenGL(&window, 1024,768, OF_WINDOW); // <-------- setup the GL context
//ofSetupOpenGL(&window, 1024,768, OF_WINDOW);
diff --git a/liveengineUnmapped/src/playlist.cpp b/liveengineUnmapped/src/playlist.cpp
index 683cd3c..61987d1 100755
--- a/liveengineUnmapped/src/playlist.cpp
+++ b/liveengineUnmapped/src/playlist.cpp
@@ -14,7 +14,7 @@ void playlist::load(string _name){
if( !XML.loadFile(_name) ){
printf("unable to load %s check data/ folder\n",_name.c_str());
}else {
- printf("starting loader thread\n");
+ //printf("starting loader thread\n");
loadimg(); //how to do this from the worker thread???
startThread(false, false); //blocking, verbose
}
@@ -27,6 +27,7 @@ void playlist::threadedFunction(){
if( lock() ){
loadLayers();
unlock();
+ printf("unlocking thread\n");
}
}
diff --git a/liveengineUnmapped/src/testApp.cpp b/liveengineUnmapped/src/testApp.cpp
index 266ebb6..91359f8 100755
--- a/liveengineUnmapped/src/testApp.cpp
+++ b/liveengineUnmapped/src/testApp.cpp
@@ -74,6 +74,8 @@ void testApp::setup(){
}
}
+ printf("screen %ix%i\n",ofGetHeight(),ofGetWidth());
+
midiIn.listPorts();
midiIn.openPort(midiPort);
@@ -139,12 +141,13 @@ void testApp::setup(){
win->addListener(prevWin);
prevWin->setup();
prevWin->setParent(this);
- prevWin->setBuffer(&viewports[0]->rb2);
+ prevWin->setBuffer(&viewports[2]->rb2);
fullscreenoutput=false;
guiWin=new guiWindow();
gui.setup("","panel.xml",0,0);
+ gui.add(reverse.setup("reverse", false));
gui.add(reversemain.setup("reverse main", false));
gui.add(controlColours.setup("control colours", false));
gui.add(noteRandomiseColours.setup("randomise note colours", false));
@@ -213,7 +216,8 @@ void testApp::draw(){
//vp2.draw(lambda,controllers,reversemain?-xshift:xshift,yshift,list,transparentBlack,note,mode,controller_colours,controlColours,reversemain?1.0f/scale:scale,reversemain?1.0f/fscale:fscale,noteRandomiseColours?colShift:0.0f);
for (int i=0;i<viewports.size();i++) {
bool even=!(i%2);
- viewports[i]->draw(lambda,controllers,even&&reversemain?-xshift:xshift,yshift,list,transparentBlack,note,mode,controller_colours,controlColours,even&&reversemain?1.0f/(scale+os):scale+os,even&&reversemain?1.0f/fscale:fscale,noteRandomiseColours?colShift:0.0f,fadeBackground);
+ bool do_reverse=reverse?!(even&&reversemain):even&&reversemain;
+ viewports[i]->draw(lambda,controllers,do_reverse?-xshift:xshift,yshift,list,transparentBlack,note,mode,controller_colours,controlColours,do_reverse?1.0f/(scale+os):scale+os,do_reverse?1.0f/fscale:fscale,noteRandomiseColours?colShift:0.0f,fadeBackground);
}
ofSetColor(255,255,255);
@@ -531,12 +535,12 @@ void testApp::nmidiMessage(int event,int data1, int data2) {
note=data1;
lastnoteTime=ofGetElapsedTimef();
- if (list.layers.size()&&list.lock()) { //if playlist is loaded
+ if (list.lock()&&list.layers.size()) { //if playlist is loaded
map<int, layer*>::iterator itr;
//for(itr = list.layers.begin(); itr != list.layers.end(); ++itr){
// list.layers[itr->first]->setNote(note);
//}
- list.layers[note]->setNote(note);
+ if (list.layers.find(note)!=list.layers.end()) list.layers[note]->setNote(note);
list.unlock();
}
if (noteRandomiseColours) {
diff --git a/liveengineUnmapped/src/testApp.h b/liveengineUnmapped/src/testApp.h
index 4f75656..1e56c33 100755
--- a/liveengineUnmapped/src/testApp.h
+++ b/liveengineUnmapped/src/testApp.h
@@ -169,6 +169,7 @@ class testApp : public ofxFensterListener, public ofxMidiListener{
ofxPanel gui;
+ ofxToggle reverse;
ofxToggle reversemain;
ofxToggle controlColours;
ofxToggle noteRandomiseColours;
diff --git a/liveengineUnmapped/src/viewport.cpp b/liveengineUnmapped/src/viewport.cpp
index cc2cc25..a169146 100755
--- a/liveengineUnmapped/src/viewport.cpp
+++ b/liveengineUnmapped/src/viewport.cpp
@@ -26,7 +26,7 @@ void viewport::setup(int _w,int _h,int _x,int _y,float _r,int _ox,int _oy) {
void viewport::draw(float a,unsigned char* controllers,int xshift,int yshift,playlist &list,bool transparentBlack,int note,int mode,ofColor* controller_colours,bool controlColours,float scale,float fscale,float colShift,int fadeBG){
-
+ //http://forum.xfce.org/viewtopic.php?id=6580
// test screen shape
/*
@@ -37,6 +37,8 @@ void viewport::draw(float a,unsigned char* controllers,int xshift,int yshift,pla
ofRect(0,h/2,w/2,h/2);
ofRect(w/2,0,w/2,h/2);
*/
+
+ ofPushMatrix();
rb1.begin();
@@ -57,7 +59,7 @@ void viewport::draw(float a,unsigned char* controllers,int xshift,int yshift,pla
//fadeout part
ofEnableAlphaBlending();
ofSetColor(0,0,0,fadeBG);
- ofRect(0,0,ofGetWidth(),ofGetHeight());
+ ofRect(0,0,w,h);
ofDisableAlphaBlending();
}
@@ -92,26 +94,39 @@ void viewport::draw(float a,unsigned char* controllers,int xshift,int yshift,pla
}
}
+ ofPopStyle();
+
rb1.end();
rb2.begin();
ofSetColor(255,255,255);
rb1.draw(0,0);
rb2.end();
+
+ ofPopMatrix();
ofPushMatrix();
- ofTranslate(x+(w/2),y+(h/2));
+ //ofTranslate(x+(w/2),y+(h/2)); this was the one that was working
+ //ofTranslate(abs(sin(ofDegToRad(r))*h/2)+abs(cos(ofDegToRad(r))*w/2),abs(sin(ofDegToRad(r))*w/2)+abs(cos(ofDegToRad(r))*h/2));
+ ofTranslate(x,y);
+
+ ofTranslate(((w/2)*abs(cos(ofDegToRad(r))))+((h/2)*abs(sin(ofDegToRad(r)))),
+ ((w/2)*abs(sin(ofDegToRad(r))))+((h/2)*abs(cos(ofDegToRad(r)))));
+
ofRotate(r);
+ ofTranslate(-w/2,-h/2);
//ofTranslate(-abs(sin(ofDegToRad(r))*h/2)-abs(cos(ofDegToRad(r))*w/2),-abs(sin(ofDegToRad(r))*w/2)-abs(cos(ofDegToRad(r))*h/2));
- ofTranslate(ox,oy);
-
+ //ofTranslate(ox,oy); get rid of this and get the rotation right
+
ofDisableAlphaBlending();
- rb2.draw(0,0);
+ rb2.draw(0,0);
+
+ ofPopMatrix();
- ofPopStyle();
+
+
- ofPopMatrix();
}