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 @@
#include "ofxArtnet.h"
#include "ofxCloudLib/ParsedParameterGroup.hpp"
#include "ofxOsc.h"
#include "ofxGui.h"
namespace ofxCloudLib
{
......@@ -231,8 +232,22 @@ class FilterManager
filters_.back()->parameters_.setName("Filter #" + ofToString(i));
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()
{
std::cout << "setting up artnet on " << my_artnet_ip_ << std::endl;
......@@ -330,6 +345,12 @@ class FilterManager
}
}
void draw_gui()
{
zones_gui_.draw();
}
void draw_rgbw(int x, int y, int w, int h)
{
rgbw_.draw(x, y, w, h);
......@@ -338,6 +359,7 @@ class FilterManager
ofParameterGroup parameters_;
ofParameter<bool> enabled_;
ofImage rgbw_;
ofxPanel zones_gui_;
private:
std::string my_artnet_ip_;
......
......@@ -124,7 +124,7 @@ class ofCloudServerApp : public ofBaseApp
if (key == 'c') merger_.draw_cam_colors_ = !merger_.draw_cam_colors_;
if (key == 's') draw_clusters_ = !draw_clusters_;
key_pressed(key);
key_pressed(key); // passe aux subclasses
}
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