From 633aee47fb7392b807e00e1827fad605fb68642b Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Mon, 30 Oct 2017 17:09:10 +0000 Subject: drag drop json presets --- gui/src/chainImageSet.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'gui/src/chainImageSet.cpp') 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 &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); -- cgit v1.2.3