summaryrefslogtreecommitdiff
path: root/src/viewport.h
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2013-05-29 14:47:17 +0100
committerTim Redfern <tim@eclectronics.org>2013-05-29 14:47:17 +0100
commit809d05f2b17409c0b18951c0107c7fc275621b0c (patch)
treec26fff53e0b324f2fda14898db729c4f9816a136 /src/viewport.h
parent296e1ecf1d4402166bb0d958980f8bf0faba4f5f (diff)
drag drop palettes
Diffstat (limited to 'src/viewport.h')
-rwxr-xr-xsrc/viewport.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/viewport.h b/src/viewport.h
index 1e3e8a8..88e9835 100755
--- a/src/viewport.h
+++ b/src/viewport.h
@@ -5,8 +5,9 @@
#include "ofxXmlSettings.h"
static int bufferSize = 2048;
-static int oversample = 8;
+static int oversample = 8;
static int windowsize = 32;
+static int previewscale = 5;
//make sure that windowsize*oversample*8 <= buffersize
@@ -82,14 +83,14 @@ class vpcontrol {
left.assign(bufferSize, 0.0);
right.assign(bufferSize, 0.0);
volHistory.assign(400, 0.0);
-
+
bufferCounter = 0;
drawCounter = 0;
smoothedVol = 0.0;
scaledVol = 0.0;
}
void update(){
- //lets scale the vol up to a 0-1 range
+ //lets scale the vol up to a 0-1 range
scaledVol = ofMap(smoothedVol, 0.0, 0.17, 0.0, 1.0, true);
//lets record the volume into an array
@@ -112,10 +113,10 @@ class vpcontrol {
vector <float> left;
vector <float> right;
vector <float> volHistory;
-
+
int bufferCounter;
int drawCounter;
-
+
float smoothedVol;
float scaledVol;
};
@@ -130,10 +131,11 @@ class viewport
void drawport(vpcontrol &control);
void draw(uint8_t brightness,float scale=1.0f);
ofFbo rb1,rb2;
- palette Palette;
+ palette Palette;
+ int w,h;
protected:
private:
- int x,y,w,h,bw,bh,ox,oy,num;
+ int x,y,bw,bh,ox,oy,num;
float seed;
};