Commit 92c2809f authored by alexandre burton's avatar alexandre burton
Browse files

CropFilter: gestion interne du ofxPanel et fonctions load/save

parent d42ed1e5
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "ofxArtnet.h" #include "ofxArtnet.h"
#include "ofxCloudLib/ParsedParameterGroup.hpp" #include "ofxCloudLib/ParsedParameterGroup.hpp"
#include "ofxOsc.h" #include "ofxOsc.h"
#include "ofxGui.h"
namespace ofxCloudLib namespace ofxCloudLib
{ {
...@@ -231,8 +232,22 @@ class FilterManager ...@@ -231,8 +232,22 @@ class FilterManager
filters_.back()->parameters_.setName("Filter #" + ofToString(i)); filters_.back()->parameters_.setName("Filter #" + ofToString(i));
parameters_.add(filters_.back()->parameters_); parameters_.add(filters_.back()->parameters_);
} }
zones_gui_.setup(parameters_);
zones_gui_.setPosition(220,10);
zones_gui_.minimizeAll();
} }
void save_preset_id(int num) {
zones_gui_.saveToFile("bin/data/presets/zones/preset"+ofToString(num)+".json");
}
void load_preset_id(int num) {
zones_gui_.loadFromFile("bin/data/presets/zones/preset"+ofToString(num)+".json");
}
void setup_artnet() void setup_artnet()
{ {
std::cout << "setting up artnet on " << my_artnet_ip_ << std::endl; std::cout << "setting up artnet on " << my_artnet_ip_ << std::endl;
...@@ -330,6 +345,12 @@ class FilterManager ...@@ -330,6 +345,12 @@ class FilterManager
} }
} }
void draw_gui()
{
zones_gui_.draw();
}
void draw_rgbw(int x, int y, int w, int h) void draw_rgbw(int x, int y, int w, int h)
{ {
rgbw_.draw(x, y, w, h); rgbw_.draw(x, y, w, h);
...@@ -338,6 +359,7 @@ class FilterManager ...@@ -338,6 +359,7 @@ class FilterManager
ofParameterGroup parameters_; ofParameterGroup parameters_;
ofParameter<bool> enabled_; ofParameter<bool> enabled_;
ofImage rgbw_; ofImage rgbw_;
ofxPanel zones_gui_;
private: private:
std::string my_artnet_ip_; std::string my_artnet_ip_;
......
...@@ -124,7 +124,7 @@ class ofCloudServerApp : public ofBaseApp ...@@ -124,7 +124,7 @@ class ofCloudServerApp : public ofBaseApp
if (key == 'c') merger_.draw_cam_colors_ = !merger_.draw_cam_colors_; if (key == 'c') merger_.draw_cam_colors_ = !merger_.draw_cam_colors_;
if (key == 's') draw_clusters_ = !draw_clusters_; if (key == 's') draw_clusters_ = !draw_clusters_;
key_pressed(key); key_pressed(key); // passe aux subclasses
} }
void keyReleased(int key) { key_released(key); } void keyReleased(int key) { key_released(key); }
......
Supports Markdown
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