summaryrefslogtreecommitdiff
path: root/passadesgui/src/ofApp.cpp
diff options
context:
space:
mode:
authorTim Redfern <tim@getdrop.com>2022-10-01 11:43:36 +0100
committerTim Redfern <tim@getdrop.com>2022-10-01 11:43:36 +0100
commitec4a59ed5dc4bd235c04636d311e021a7751b882 (patch)
tree65c4fc1a7cf1fa01046412e2d426d00825b23583 /passadesgui/src/ofApp.cpp
parentaca6161b1c8ee632e388731084b6158a1483e71a (diff)
bug squashed
Diffstat (limited to 'passadesgui/src/ofApp.cpp')
-rw-r--r--passadesgui/src/ofApp.cpp66
1 files changed, 64 insertions, 2 deletions
diff --git a/passadesgui/src/ofApp.cpp b/passadesgui/src/ofApp.cpp
index e8b8a91..babc284 100644
--- a/passadesgui/src/ofApp.cpp
+++ b/passadesgui/src/ofApp.cpp
@@ -1205,19 +1205,41 @@ void ofApp::dragEvent(ofDragInfo dragInfo){
std::stringstream strm;
+ ofVec2f offset;
+ bool useFill=false;
+ if (filename.find("WMF")<filename.size()){ //a dirty hack
+ useFill=true;
+ ofLog()<<filename<<" found WMF: "<<filename.find("WMF");
+ offset=ofVec2f(ofGetWidth()-svg.getWidth(),(ofGetHeight()-svg.getHeight())/2);
+
+ }
+
+
if (imagepaths.size()){
segmenters.clear();
shape_selection_durations.clear();
+
+
+ //ofLog()<<filename<<" path 0 using "<<(useFill?"FILL":"STROKE")<<" stroke sat: "<<
+ // imagepaths[0].getStrokeColor().getSaturation()<<" fill sat: "<<
+ // imagepaths[0].getFillColor().getSaturation();
for (auto& path:imagepaths){
path.setPolyWindingMode(OF_POLY_WINDING_ODD);
vector <ofPolyline> outlines= path.getOutline();
+
+
+ //if (path.getFillColor().getSaturation()==0){
+ // useFill=false; //hard to get reliable results from this
+ //}
+
for (auto& outline:outlines){
strm << outline.size() << "->";
outline.simplify(contour_simplify);
+ outline.translate(offset);
+ //outline.rotateDeg(180,glm::vec3(0,0,0));
strm << outline.size() << " ";
- segmenters.push_back(lineSegmenter(outline));
- //segmenters.push_back(colourLineSegmenter(outline,path.getStrokeColor()));
+ segmenters.push_back(colourLineSegmenter(outline,useFill?path.getFillColor():path.getStrokeColor()));
shape_selection_durations.push_back(0.0f);
}
strm << " , ";
@@ -1409,5 +1431,45 @@ void ofApp::newMidiMessage(ofxMidiMessage& msg) {
//fader
segmenter_speed=(((float)msg.value)/64.0f)-1.0f;
}
+
+ //===============================================
+ offset=6;
+
+ if (msg.channel==1&&msg.control==1+offset){
+ //pot
+ }
+ if (msg.channel==1&&msg.control==33+offset){
+ //pot button
+ }
+ if (msg.channel==1&&msg.control==65+offset){
+ //top button
+ }
+ if (msg.channel==1&&msg.control==73+offset){
+ //bottom button
+ }
+ if (msg.channel==1&&msg.control==81+offset){
+ //fader
+ segmenter_length=(((float)msg.value)/128.0f);
+ }
+
+ //===============================================
+ offset=6;
+
+ if (msg.channel==1&&msg.control==1+offset){
+ //pot
+ }
+ if (msg.channel==1&&msg.control==33+offset){
+ //pot button
+ }
+ if (msg.channel==1&&msg.control==65+offset){
+ //top button
+ }
+ if (msg.channel==1&&msg.control==73+offset){
+ //bottom button
+ }
+ if (msg.channel==1&&msg.control==81+offset){
+ //fader
+ segmenter_number=(((float)msg.value)/16);
+ }
}