summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorTim Redfern <tim@getdrop.com>2017-12-29 03:36:45 +0000
committerTim Redfern <tim@getdrop.com>2017-12-29 03:36:45 +0000
commit4c9570bdf49ec3a6517e5be60fc960d7d9cdbed0 (patch)
treeeb4278452a7f67a30bc6341f7df8b0d6e1fe98be /gui
parentb470c73bfc271c032f4df9a3fd1b9770cf627f00 (diff)
syphon output
Diffstat (limited to 'gui')
-rw-r--r--gui/.DS_Storebin8196 -> 8196 bytes
-rw-r--r--gui/addons.make3
-rw-r--r--gui/config.make3
-rw-r--r--gui/src/chainImage.cpp2
-rw-r--r--gui/src/chainImage.h2
-rw-r--r--gui/src/chainImageSet.cpp2
-rw-r--r--gui/src/ofApp.cpp26
-rw-r--r--gui/src/ofApp.h8
-rwxr-xr-xgui/start3
9 files changed, 43 insertions, 6 deletions
diff --git a/gui/.DS_Store b/gui/.DS_Store
index c2c9288..58bdd7b 100644
--- a/gui/.DS_Store
+++ b/gui/.DS_Store
Binary files differ
diff --git a/gui/addons.make b/gui/addons.make
index e8305b7..ad9d6b0 100644
--- a/gui/addons.make
+++ b/gui/addons.make
@@ -2,4 +2,5 @@ ofxJSON
ofxDMX
ofxMidi
ofxArtnet
-ofxThreadedImageLoader \ No newline at end of file
+ofxThreadedImageLoader
+ofxSyphon \ No newline at end of file
diff --git a/gui/config.make b/gui/config.make
index 2ae93e7..65a3495 100644
--- a/gui/config.make
+++ b/gui/config.make
@@ -56,7 +56,7 @@ OF_ROOT = ../../openFrameworks
#
# Will automatically exclude the following:
#
-# $(PROJECT_ROOT)/bin%
+# $(PROJECT_EXCLUSIONSJECT_ROOT)/bin%
# $(PROJECT_ROOT)/obj%
# $(PROJECT_ROOT)/%.xcodeproj
#
@@ -72,6 +72,7 @@ OF_ROOT = ../../openFrameworks
#
# Note: Leave a leading space when adding list items with the += operator
################################################################################
+PROJECT_LDFLAGS = -FFrameworks -framework Syphon
# Currently, shared libraries that are needed are copied to the
# $(PROJECT_ROOT)/bin/libs directory. The following LDFLAGS tell the linker to
diff --git a/gui/src/chainImage.cpp b/gui/src/chainImage.cpp
index 61ea55d..1fbcc73 100644
--- a/gui/src/chainImage.cpp
+++ b/gui/src/chainImage.cpp
@@ -186,7 +186,7 @@ int chainImage::updateOutput(float decayRatio){
transition = 0.0f;
return SWITCH_REVERSE;
}
- if (scale>getLinkScale()*link->getLinkScale()){
+ if (scale>=getLinkScale()*link->getLinkScale()){
return SWITCH_NONE;
}
transition = 1.0f;
diff --git a/gui/src/chainImage.h b/gui/src/chainImage.h
index b318c79..9bfc70c 100644
--- a/gui/src/chainImage.h
+++ b/gui/src/chainImage.h
@@ -12,7 +12,7 @@
#define BEZIER_OUT 0.5
#define BEZIER_IN 0.5
#define ROTATION_BEZIER_FRACTION 0.0
-#define ROTATION_EASE_POWER 3.0
+#define ROTATION_EASE_POWER 4.0
#define SWITCH_NONE 0
#define SWITCH_FORWARD 1
diff --git a/gui/src/chainImageSet.cpp b/gui/src/chainImageSet.cpp
index e5c4ca6..569ab0e 100644
--- a/gui/src/chainImageSet.cpp
+++ b/gui/src/chainImageSet.cpp
@@ -39,7 +39,7 @@ void chainImageSet::drawOutput(){
*/
glScalef(ZOOM_FUDGE_FACTOR,ZOOM_FUDGE_FACTOR,ZOOM_FUDGE_FACTOR); //easy way to limit camera cutoff
- printf("drawing rotation %f for transition %f\n",(*currentImage)->getRotation(),(*currentImage)->transition);
+ //printf("drawing rotation %f for transition %f\n",(*currentImage)->getRotation(),(*currentImage)->transition);
gluLookAt( (*currentImage)->getTransform().x,
(*currentImage)->getTransform().y, // i1.linkPos.y+(xform.y*intervalpoint),
diff --git a/gui/src/ofApp.cpp b/gui/src/ofApp.cpp
index cbfb139..d28fe70 100644
--- a/gui/src/ofApp.cpp
+++ b/gui/src/ofApp.cpp
@@ -43,6 +43,22 @@ void ofApp::setup(){
sets[1].init();
commandPressed=false;
+
+ //syphon
+ bSmooth = false;
+ ofSetWindowTitle("ofxSyphon Example");
+
+ mainOutputSyphonServer.setName("Screen Output");
+ //individualTextureSyphonServer.setName("Texture Output");
+
+ //mClient.setup();
+
+ //using Syphon app Simple Server, found at http://syphon.v002.info/
+ //mClient.set("","Simple Server");
+
+
+ ofSetFrameRate(60); // if vertical sync is off, we can go a bit fast... this caps the framerate at 60fps.
+
}
//--------------------------------------------------------------
@@ -74,9 +90,16 @@ void ofApp::draw(){
}
void ofApp::drawOutput(ofEventArgs & args){
- ofBackground(0,0,0);
+ // Clear with alpha, so we can capture via syphon and composite elsewhere should we want.
+ glClearColor(0.0, 0.0, 0.0, 0.0);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ if (bSmooth){
+ ofEnableSmoothing();
+ }
+
for (int i=0;i<sets.size();i++){
#ifdef GPU_ALGORITHM
@@ -97,6 +120,7 @@ void ofApp::drawOutput(ofEventArgs & args){
next_update=ofGetElapsedTimef()+0.1f;
}
+ mainOutputSyphonServer.publishScreen();
}
diff --git a/gui/src/ofApp.h b/gui/src/ofApp.h
index 03120e4..7a76da3 100644
--- a/gui/src/ofApp.h
+++ b/gui/src/ofApp.h
@@ -4,6 +4,7 @@
#include "ofxDmx.h"
//#include "ofxArtnet.h"
#include "ofxMidi.h"
+#include "ofxSyphon.h"
#include "chainImageSet.h"
@@ -137,4 +138,11 @@ class ofApp : public ofBaseApp, public ofxMidiListener{
bool commandPressed;
+ ofxSyphonServer mainOutputSyphonServer;
+ // ofxSyphonServer individualTextureSyphonServer;
+
+ ofxSyphonClient mClient;
+
+ bool bSmooth;
+
};
diff --git a/gui/start b/gui/start
new file mode 100755
index 0000000..c6edba3
--- /dev/null
+++ b/gui/start
@@ -0,0 +1,3 @@
+mkdir bin/gui.app/Contents/Frameworks
+cp -r Frameworks/Syphon.framework bin/gui.app/Contents/Frameworks
+