Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ Cyril is built against version 0.8.1 of openFrameworks

* http://www.openframeworks.cc/download/

It also depends on two (non-core) ofx Addons:
It also depends on some (non-core) ofx Addons:

* https://github.com/darrenmothersele/ofxBeat
* https://github.com/darrenmothersele/ofxEditor
* https://github.com/bakercp/ofxIO
* https://github.com/neilmendoza/ofxPostProcessing
7 changes: 7 additions & 0 deletions bin/data/code/0.cy
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
rotate

color 255, 255, rand(255)

tile 5, 5, 5
box 0.8
end
16 changes: 16 additions & 0 deletions bin/data/filters.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<filters>
<bloom>0</bloom>
<contrast>0</contrast>
<convolution>0</convolution>
<dof>0</dof>
<edge>0</edge>
<fxaa>0</fxaa>
<godrays>0</godrays>
<tiltshift>0</tiltshift>
<kaleidoscope>0</kaleidoscope>
<noisewarp>0</noisewarp>
<pixelate>1</pixelate>
<rimhighlight>0</rimhighlight>
<toon>0</toon>
<zoomblur>0</zoomblur>
</filters>
187 changes: 187 additions & 0 deletions cyril.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>E4B69B5A0A3A1756003C02F2</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
46 changes: 45 additions & 1 deletion src/cyrilApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


//--------------------------------------------------------------
void cyrilApp::setup(){
void cyrilApp::setup() {
doResetTimers = true;

ofSoundStreamSetup(0, 1, this, 44100, beat.getBufferSize(), 4);
Expand Down Expand Up @@ -133,6 +133,46 @@ void cyrilApp::setup(){

isFullScreen = true;
ofSetFullscreen(true);

checkForFilters();
}

// Temporary handling to enable filters via an XML file.
// This will eventually become editor commands!
void cyrilApp::checkForFilters() {

post.init(ofGetWidth(), ofGetHeight());
ofxXmlSettings filters;
filters.loadFile("filters.xml");

if( filters.getValue("filters:bloom", 0) == 1 )
post.createPass<BloomPass>();
if( filters.getValue("filters:contrast", 0) == 1 )
post.createPass<ContrastPass>();
if( filters.getValue("filters:convolution", 0) == 1 )
post.createPass<ConvolutionPass>();
if( filters.getValue("filters:dof", 0) == 1 )
post.createPass<DofPass>();
if( filters.getValue("filters:edge", 0) == 1 )
post.createPass<EdgePass>();
if( filters.getValue("filters:fxaa", 0) == 1 )
post.createPass<FxaaPass>();
if( filters.getValue("filters:godrays", 0) == 1 )
post.createPass<GodRaysPass>();
if( filters.getValue("filters:tiltshift", 0) == 1 )
post.createPass<HorizontalTiltShifPass>();
if( filters.getValue("filters:kaleidoscope", 0) == 1 )
post.createPass<KaleidoscopePass>();
if( filters.getValue("filters:noisewarp", 0) == 1 )
post.createPass<NoiseWarpPass>();
if( filters.getValue("filters:pixelate", 0) == 1 )
post.createPass<PixelatePass>();
if( filters.getValue("filters:rimhighlight", 0) == 1 )
post.createPass<RimHighlightingPass>();
if( filters.getValue("filters:toon", 0) == 1 )
post.createPass<ToonPass>();
if( filters.getValue("filters:zoomblur", 0) == 1 )
post.createPass<ZoomBlurPass>();
}

//--------------------------------------------------------------
Expand Down Expand Up @@ -171,6 +211,8 @@ void cyrilApp::update(){
//--------------------------------------------------------------
void cyrilApp::draw(){

post.begin();

ofEnableDepthTest();

if (lightsOn) {
Expand Down Expand Up @@ -221,6 +263,8 @@ void cyrilApp::draw(){
_state.light->disable();
}

post.end();

if (editorVisible) {
ofDisableDepthTest();
ofPushMatrix();
Expand Down
6 changes: 5 additions & 1 deletion src/cyrilApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@
#include "ofxBeat.h"

#include "ofxIO.h"
#include "ofxPostProcessing.h"

using namespace ofx::IO;

class cyrilApp : public ofBaseApp{

ofxEditor editor;
ofxEditor editor;
ofxBeat beat;
ofxPostProcessing post;

//ofxXmlSettings settings;
string fileName;
Expand Down Expand Up @@ -68,6 +71,7 @@ class cyrilApp : public ofBaseApp{
void applyGlobalSettings();
void reloadSettings();
void runProgram();
void checkForFilters();

void audioReceived(float*, int, int);

Expand Down