summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2012-09-05 13:37:00 +0100
committerTim Redfern <tim@eclectronics.org>2012-09-05 13:37:00 +0100
commit02dbff4e82603279a0b0c5062d20067b2614a15e (patch)
tree0f5cdfb018d8264b47ec1497850800c0d765a342
parent65cf7b27e9d2f9e59da322b4fbad1ed1df27eb8d (diff)
first show
-rw-r--r--liveengine/liveengine.layout14
-rw-r--r--liveengine/src/main.cpp2
-rwxr-xr-xliveengine/src/testApp.cpp72
-rwxr-xr-xliveengine/src/testApp.h9
4 files changed, 75 insertions, 22 deletions
diff --git a/liveengine/liveengine.layout b/liveengine/liveengine.layout
index 1691854..b43ca8b 100644
--- a/liveengine/liveengine.layout
+++ b/liveengine/liveengine.layout
@@ -16,19 +16,19 @@
<File name="config.make" open="0" top="0" tabpos="3">
<Cursor position="477" topLine="0" />
</File>
- <File name="src/layers.cpp" open="1" top="0" tabpos="3">
+ <File name="src/layers.cpp" open="1" top="0" tabpos="2">
<Cursor position="1853" topLine="23" />
</File>
- <File name="src/layers.h" open="1" top="0" tabpos="2">
- <Cursor position="613" topLine="3" />
+ <File name="src/layers.h" open="1" top="0" tabpos="1">
+ <Cursor position="107" topLine="21" />
</File>
<File name="src/main.cpp" open="0" top="0" tabpos="7">
<Cursor position="220" topLine="0" />
</File>
- <File name="src/testApp.cpp" open="1" top="1" tabpos="4">
- <Cursor position="2295" topLine="66" />
+ <File name="src/testApp.cpp" open="1" top="1" tabpos="3">
+ <Cursor position="1650" topLine="48" />
</File>
- <File name="src/testApp.h" open="1" top="0" tabpos="1">
- <Cursor position="2630" topLine="82" />
+ <File name="src/testApp.h" open="1" top="0" tabpos="4">
+ <Cursor position="2008" topLine="55" />
</File>
</CodeBlocks_layout_file>
diff --git a/liveengine/src/main.cpp b/liveengine/src/main.cpp
index 5c556af..192f275 100644
--- a/liveengine/src/main.cpp
+++ b/liveengine/src/main.cpp
@@ -6,7 +6,7 @@
int main( ){
ofAppGlutWindow window;
- ofSetupOpenGL(&window, 800,600, OF_WINDOW); // <-------- setup the GL context
+ ofSetupOpenGL(&window, 1024,768, OF_FULLSCREEN); // <-------- setup the GL context
//ofSetupOpenGL(&window, 1024,768, OF_WINDOW);
// this kicks off the running of my app
diff --git a/liveengine/src/testApp.cpp b/liveengine/src/testApp.cpp
index c23ec86..52a9cc3 100755
--- a/liveengine/src/testApp.cpp
+++ b/liveengine/src/testApp.cpp
@@ -32,7 +32,7 @@ void testApp::setup(){
controlColours=false;
- grab.allocate(ofGetWidth(), ofGetHeight(),GL_RGB);
+ grab.allocate(1024,768,GL_RGB); //ofGetWidth(), ofGetHeight(),GL_RGB);
//grab.setUseTexture(true);
showFPS=false;
@@ -43,6 +43,7 @@ void testApp::setup(){
xshift=-1;
yshift=-1;
+ fadetime=0;
mode=BLOCKS;
@@ -57,7 +58,10 @@ void testApp::setup(){
printf("hue of green is %f\n",ofColor(0,255,0).getHue());
printf("hue of blue is %f\n",ofColor(0,0,255).getHue());
hue is float from 0.0-255.0
- */
+ */
+ ofSetFrameRate(60);
+ rotate=0;
+ scale=1.0f;
}
void testApp::makeColours() {
@@ -71,7 +75,7 @@ void testApp::update(){
//--------------------------------------------------------------
void testApp::draw(){
- ofSetColor(255,255,255);
+
grab.loadScreenData( 0, 0, ofGetWidth(), ofGetHeight() );
/* can this work?
@@ -79,8 +83,13 @@ void testApp::draw(){
grab.setTextureWrap( GL_WRAP_BORDER, GL_WRAP_BORDER);
grab.draw(0,0); // xshift,yshift);
*/
- int startx=(xshift>0?xshift-ofGetWidth():xshift);
- int starty=(yshift>0?yshift-ofGetHeight():yshift);
+ ofSetColor(255-fadetime,255-fadetime,255-fadetime);
+ for (int i=(xshift>0?xshift-ofGetWidth():xshift);i<ofGetWidth()*2;i+=ofGetWidth()) {
+ for (int j=(yshift>0?yshift-ofGetHeight():yshift);j<ofGetHeight()*2;j+=ofGetHeight()) {
+ grab.draw(i,j);
+ }
+ }
+
float notewidth=ofGetWidth()/NUM_NOTES;
float noteheight=ofGetHeight()/NUM_CONTROLLERS;
@@ -97,8 +106,11 @@ void testApp::draw(){
break;
case LIST:
if (list.lock()) { //if playlist is loaded
- ofPushMatrix();
- //ofScale(sin(ofGetElapsedTimef())+1.1,sin(ofGetElapsedTimef())+1.1);
+ ofPushMatrix();
+ ofTranslate(ofGetWidth()/2,ofGetHeight()/2);
+ ofScale(scale,scale,scale);
+ ofRotate(rotate);
+ ofTranslate(-ofGetWidth()/2,-ofGetHeight()/2);
if (list.layers.find(note)!=list.layers.end()) {
if (controlColours) list.layers[note]->draw(lamda,controllers);
else list.layers[note]->draw(lamda);
@@ -122,7 +134,7 @@ void testApp::keyPressed (int key){
list.load("insects.xml");
}
if(key == 'w'){
- list.load("barcelona.xml");
+ list.load("women_ethnic.xml");
}
if(key == 'e'){
list.load("organs.xml");
@@ -130,6 +142,24 @@ void testApp::keyPressed (int key){
if(key == 'r'){
list.load("tai_chi.xml");
}
+ if(key == 't'){
+ list.load("reptiles.xml");
+ }
+ if(key == 'y'){
+ list.load("military_ladies.xml");
+ }
+ if(key == 'u'){
+ list.load("knights.xml");
+ }
+ if(key == 'i'){
+ list.load("mil_historic.xml");
+ }
+ if(key == 'o'){
+ list.load("yoga.xml");
+ }
+ if(key == 'p'){
+ list.load("dancing.xml");
+ }
if(key == 's'){
XML.saveFile("settings.xml");
printf("settings saved!\n");
@@ -141,17 +171,17 @@ void testApp::keyPressed (int key){
mode=key-'0';
}
if(key == OF_KEY_LEFT){
- xshift++;
+ yshift++;
}
if(key == OF_KEY_RIGHT){
- xshift--;
+ yshift--;
}
if(key == OF_KEY_DOWN){
- yshift--;
+ xshift--;
}
if(key == OF_KEY_UP){
- yshift++;
+ xshift++;
}
if(key == '='){
makeColours();
@@ -159,6 +189,24 @@ void testApp::keyPressed (int key){
if(key == '-'){
controlColours=!controlColours;
}
+ if(key == '+'){
+ fadetime=min(128,fadetime+1);
+ }
+ if(key == '_'){
+ fadetime=max(0,fadetime-1);
+ }
+ if(key == ']'){
+ scale*=1.01;
+ }
+ if(key == '['){
+ scale/=1.01;
+ }
+ if(key == '}'){
+ rotate+=90;
+ }
+ if(key == '{'){
+ rotate-=90;
+ }
}
//--------------------------------------------------------------
diff --git a/liveengine/src/testApp.h b/liveengine/src/testApp.h
index af99c6a..4d769da 100755
--- a/liveengine/src/testApp.h
+++ b/liveengine/src/testApp.h
@@ -71,8 +71,9 @@ non random colours
#include "ofxMidi.h"
-#define BLOCKS 0
-#define LIST 1
+#define NOTHING 0
+#define BLOCKS 1
+#define LIST 2
#include "playlist.h"
@@ -110,6 +111,10 @@ class testApp : public ofBaseApp, public ofxMidiListener{
float lastnoteTime;
float decayTime;
+ int fadetime;
+ int rotate;
+ float scale;
+
int xshift,yshift;
ofColor* controller_colours;