summaryrefslogtreecommitdiff
path: root/gui/src/ofApp.h
diff options
context:
space:
mode:
authorTim Redfern <tim@getdrop.com>2018-05-31 18:18:28 +0100
committerTim Redfern <tim@getdrop.com>2018-05-31 18:18:28 +0100
commit23879cc5bf88de215f10de14f1a3de9b6b2f586a (patch)
tree2d665c3c06e45b9696cd82ff5abcf18d71d6b47f /gui/src/ofApp.h
parentbc654332edf65b0425c170db16db6c8dd1f80e8c (diff)
fixed rounding bug
Diffstat (limited to 'gui/src/ofApp.h')
-rw-r--r--gui/src/ofApp.h85
1 files changed, 74 insertions, 11 deletions
diff --git a/gui/src/ofApp.h b/gui/src/ofApp.h
index 33c855a..c9b1c4f 100644
--- a/gui/src/ofApp.h
+++ b/gui/src/ofApp.h
@@ -1,26 +1,42 @@
#pragma once
#include "ofMain.h"
-#include "lineTransformer.h"
-#include "ofxNDI.h"
+
+//#include "ofxNDI.h"
#include "ofxGui.h"
-#include "ofxHelios.h"
+#include "ofxXmlSettings.h"
#include "ofxOpenCv.h"
#include "ofxSVG.h"
-#include "lineSegmenter.h"
-#include "ofxXmlSettings.h"
#include "ofxClipper.h"
#include "ofxMidi.h"
+#include "ofxHelios.h"
+#include "lineTransformer.h"
+#include "lineSegmenter.h"
+
+#include "ofxGist.h"
+//This is included only as a way of getting buffer out of loaded sound.
+//There are many other ways you can do that.
+//This player includes a version of kissFFT. You can remove the one included in Gist.
+//https://github.com/borg/ofxOpenALSoundPlayer
+#include "ofxOpenALSoundPlayer.h"
+//Slightly modified to add a dynamic getVariable method to be able to plot based on
+//gist feature list
+//https://github.com/local-projects/ofxHistoryPlot
+#include "ofxHistoryPlot.h"
+#include "Audioplotter.h"
+
enum Source{
TEST,
- NDI,
+// NDI,
Player,
SVG_outlines,
SVG_segmenters,
+ Audio,
Source_end
};
+
class ofApp: public ofBaseApp, public ofxMidiListener {
public:
@@ -52,6 +68,8 @@ class ofApp: public ofBaseApp, public ofxMidiListener {
void outputWindowResized(ofResizeEventArgs &resizeargs);
void select_random_shapes();
+
+ void default_settings();
void save_settings();
bool commandPressed;
@@ -60,12 +78,46 @@ class ofApp: public ofBaseApp, public ofxMidiListener {
int select_warpframe;
bool bDrawFrame;
- ofxPanel gui;
ofxHelios laser;
int source;
+ //======================================== //audio
+
+ ofxGist gist;
+ void onNoteOn(GistEvent &e);
+ void onNoteOff(GistEvent &e);
+
+ ofSoundStream soundStream;
+ ofxOpenALSoundPlayer player;
+
+ void processAudio(float * input, int bufferSize, int nChannels);
+ void audioIn(float * input, int bufferSize, int nChannels);
+
+ void loadSong(string str);
+
+ int bufferSize;
+ int sampleRate;
+
+ vector<float>fftSmoothed;
+ vector <float> left;
+ vector <float> right;
+ vector <float> centre;
+
+ Audioplotter plotter;
+
+ //======== audio gui
+
+ ofxPanel audiogui;
+ ofParameter<bool> useMic;
+ ofParameter<bool> useFft;
+ ofParameter<float> scalePlot;
+ ofParameter<float> decayPlot;
+
+ void useMicChanged();
+
+
//======================================== //thresholding
ofxCvColorImage colorImg;
@@ -73,7 +125,7 @@ class ofApp: public ofBaseApp, public ofxMidiListener {
ofxCvContourFinder contourFinder;
//======================================== //ofxNDI
-
+/*
ofxNDIreceiver ndiReceiver;
ofImage ndiImage;
char senderName[256];
@@ -84,8 +136,10 @@ class ofApp: public ofBaseApp, public ofxMidiListener {
// For received frame fps calculations
double startTime, lastTime, frameTime, frameRate, fps;
+*/
+ //====== drawing gui
- //====== gui
+ ofxPanel drawgui;
ofxIntSlider contour_threshold;
ofxFloatSlider contour_simplify;
@@ -93,8 +147,6 @@ class ofApp: public ofBaseApp, public ofxMidiListener {
ofxIntSlider laser_R;
ofxIntSlider laser_G;
ofxIntSlider laser_B;
- ofxIntSlider laser_intensity;
- ofxIntSlider laser_points;
//====== video
@@ -121,6 +173,17 @@ class ofApp: public ofBaseApp, public ofxMidiListener {
ofxFloatSlider xf_scale_min;
ofxFloatSlider xf_scale_max;
+
+ //======= laser gui
+
+ ofxPanel lasergui;
+ ofParameter<bool> laser_power;
+ ofParameter<int> laser_intensity;
+ ofParameter<int> laser_points;
+ ofParameter<int> laser_subdivide;
+ ofParameter<int> laser_blank_num;
+ ofParameter<float> laser_max_angle;
+
//======================================= //MIDI
ofxMidiIn midiIn;