Commit 89da3226 authored by Lky's avatar Lky

adding interface component

parent 43941728
......@@ -14,7 +14,7 @@ void kanava::build(int w, int h, string path)
{
// ALLOCATIONS
hap_w = w; hap_h = h;
x_crop = 0; x_outside = 0;
x_crop = 0; x_outside = 0; x_inside = 0;
inner_fbo.allocate(hap_w - x_crop, hap_h, GL_RGB);
outer_fbo.allocate(w, h, GL_RGB);
......@@ -30,7 +30,7 @@ void kanava::update()
// first Fbo, for hap file
inner_fbo.begin();
ofClear(50, 0, 0);
hap_video.draw(x_crop, 0);
hap_video.draw(x_inside, 0);
inner_fbo.end();
// second Fbo, to crop - build glitches
......@@ -56,9 +56,24 @@ void kanava::setSpeed(float value)
}
}
void kanava::setInsideCrop(int value) {
void kanava::setInsideX(int value)
{
x_inside = value;
}
void kanava::setOutsideX(int value)
{
// deprecated :: use x_pos in ofApp instead
x_outside = value;
}
void kanava::setCropX(int value)
{
x_crop = value;
inner_fbo.allocate(hap_w - x_crop, hap_h, GL_RGB);
}
void kanava::setFboWidth(int value) {
inner_fbo.allocate(value, hap_h, GL_RGB);
}
ofTexture kanava::getTexture() {
......
......@@ -13,7 +13,10 @@ public:
void draw();
void setSpeed(float value);
void setInsideCrop(int value);
void setInsideX(int value);
void setOutsideX(int value);
void setCropX(int value);
void setFboWidth(int value);
ofTexture getTexture();
......@@ -29,7 +32,7 @@ private:
int hap_w, hap_h;
float speed;
int x_crop, x_outside;
int x_crop, x_inside, x_outside;
};
This diff is collapsed.
......@@ -57,20 +57,48 @@ private:
ofShader shader;
// INTERFACE
ofxDatGui* kanavaParameters;
struct parameterGUIAutomaton {
string name_reference;
ofxDatGuiFolder* folder;
ofParameter<bool> launch;
ofParameter<int> step_value;
ofParameter<int> speed_value;
ofParameter<bool> reverse;
ofParameter<bool> loop;
void setupAutomaton(ofxDatGuiFolder** parent, string name, int x, int y, int min, int max, int value);
void setupAutomaton(string name, int x, int y, int min, int max, int value);
};
struct KanavaFolder {
ofxDatGuiFolder* colorParameters;
ofxDatGuiFolder* autoAnimate;
ofParameter<int> opacity, saturation, contrast;
ofParameter<int> x_pos, y_pos, scale;
ofxDatGuiFolder* geometry;
ofxDatGuiFolder* pos_x_animate;
parameterGUIAutomaton pos_x_automaton;
};
struct channelVariable {
int x_pos, y_pos, scale;
int opacity, saturation, contrast;
int fbo_width, inside_x_crop, inside_x_pos;
void init();
};
float animationTime;
ofxDatGui* kanavaParameters;
channelVariable* kanava_variables;
parameterGUIAutomaton* parametersAutomaton;
KanavaFolder * kanava_gui;
void changeInsideCrop(int channel, int value);
void onToggleEvent(ofxDatGuiToggleEvent e);
void onButtonEvent(ofxDatGuiButtonEvent e);
void onSliderEvent(ofxDatGuiSliderEvent e);
// ARDUINO
void setupArduino(const int & version);
void digitalPinChanged(const int & pinNum);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment