summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gui/src/chainImageSet.cpp17
-rw-r--r--gui/src/chainImageSet.h1
-rw-r--r--gui/src/ofApp.cpp41
3 files changed, 50 insertions, 9 deletions
diff --git a/gui/src/chainImageSet.cpp b/gui/src/chainImageSet.cpp
index 9f2cfcc..1036e4a 100644
--- a/gui/src/chainImageSet.cpp
+++ b/gui/src/chainImageSet.cpp
@@ -244,6 +244,23 @@ save dragdrop pos in loadingImages and attempt to insert in the chain
//return false;
}
+bool chainImageSet::addfiles(std::vector<string> &filenames){
+
+ for (auto f=filenames.begin();f!=filenames.end();f++){
+ if(f->substr(f->find_last_of(".") + 1) == "json") {
+ images.clear();
+ bool success=loadJson(*f);
+
+ ofLogVerbose("Load %s %s\n",
+ f->c_str(),
+ success?"succeeded":"failed");
+ }
+ else {
+ add(*f);
+ }
+ }
+
+}
void chainImageSet::keyPressed(ofKeyEventArgs &keyargs){
//printf("Got key %i, modifiers:%i\n",keyargs.key,keyargs.modifiers);
diff --git a/gui/src/chainImageSet.h b/gui/src/chainImageSet.h
index 879329a..6620923 100644
--- a/gui/src/chainImageSet.h
+++ b/gui/src/chainImageSet.h
@@ -29,6 +29,7 @@ class chainImageSet{
void drawOutput();
void drawGpu();
void updateOutput();
+ bool addfiles(std::vector<string> &filenames);
bool add(std::string filename,ofPoint pos=ofPoint(0,0),float ratio=0.3,float rotation=0.0);
void keyPressed(ofKeyEventArgs &keyargs);
void mouseDragged(int x, int y, int button);
diff --git a/gui/src/ofApp.cpp b/gui/src/ofApp.cpp
index a89a893..43f51f1 100644
--- a/gui/src/ofApp.cpp
+++ b/gui/src/ofApp.cpp
@@ -229,6 +229,29 @@ void ofApp::newMidiMessage(ofxMidiMessage& msg) {
}
+ //column 2 for more controls
+ offet=2;
+
+ if (msg.channel==1&&msg.control==1+offet){
+ //pot 1
+ for (int i=0;i<sets.size();i++){
+ //sets[i].zoomMultiplier=1.0f+(((float)msg.value-64)/64.0f); doesn't work
+ };
+
+ printf("Val %i, zoomMultiplier: %f \n",msg.value,sets[0].fitFactor);
+ }
+ if (msg.channel==1&&msg.control==65+offet){
+ //top button 1
+
+ }
+ if (msg.channel==1&&msg.control==73+offet){
+ //bottom button 1
+ }
+ if (msg.channel==1&&msg.control==81+offet){
+ //fader 1
+
+ }
+
}
//--------------------------------------------------------------
@@ -322,20 +345,20 @@ void ofApp::gotMessage(ofMessage msg){
//--------------------------------------------------------------
void ofApp::dragEvent(ofDragInfo dragInfo){
- std::string filenames;
+ //std::string filenames;
- for (auto f = dragInfo.files.begin(); f != dragInfo.files.end(); f++){
- if (f!=dragInfo.files.begin()){
- filenames=filenames+", ";
- }
- filenames=filenames+*f;
+ //for (auto f = dragInfo.files.begin(); f != dragInfo.files.end(); f++){
+ // if (f!=dragInfo.files.begin()){
+ // filenames=filenames+", ";
+ // }
+ // filenames=filenames+*f;
if (dragInfo.position.y<200){
- sets[0].add(*f); //,dragInfo.position);
+ sets[0].addfiles(dragInfo.files); //,dragInfo.position);
}
- else sets[1].add(*f); //,dragInfo.position);
+ else sets[1].addfiles(dragInfo.files); //,dragInfo.position);
- }
+ //}
}