computerscare-vcv-modules

computerscare modules for VCV Rack
Log | Files | Refs

commit f808e7e125aad09247f8ae618a39b811f3103fda
parent eb76d7996991a503a5cc313163bf57d27a71ae08
Author: Adam M <[email protected]>
Date:   Sat, 13 Oct 2018 18:53:45 -0500

add new svg ports, fix clipping issue for ports

Diffstat:
Ares/computerscare-pentagon-jack-1-outline-flipped.svg | 84+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mres/computerscare-pentagon-jack-1-outline.svg | 28++++++++++++++--------------
Ares/computerscare-pentagon-jack-pointing-up.svg | 77+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Msrc/Computerscare.hpp | 10+++++++++-
Msrc/ComputerscareLaundrySoup.cpp | 14++++++++------
Msrc/ComputerscarePatchSequencer.cpp | 12++++++++++--
6 files changed, 202 insertions(+), 23 deletions(-)

diff --git a/res/computerscare-pentagon-jack-1-outline-flipped.svg b/res/computerscare-pentagon-jack-1-outline-flipped.svg @@ -0,0 +1,84 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="32" + height="34" + viewBox="0 0 8.4666666 8.9958332" + version="1.1" + id="svg4524" + inkscape:version="0.92.2 5c3e80d, 2017-08-06" + sodipodi:docname="computerscare-pentagon-jack-1-outline-flipped.svg"> + <defs + id="defs4518"> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 99.999997 : 1" + inkscape:vp_y="0 : 999.99997 : 0" + inkscape:vp_z="200 : 99.999997 : 1" + inkscape:persp3d-origin="99.999998 : 66.666666 : 1" + id="perspective5087" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="15.839192" + inkscape:cx="17.38478" + inkscape:cy="14.146193" + inkscape:document-units="mm" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1440" + inkscape:window-height="855" + inkscape:window-x="0" + inkscape:window-y="1" + inkscape:window-maximized="1" + units="px" /> + <metadata + id="metadata4521"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-288.00418)" + style="display:inline"> + <path + style="fill:#eaeaea;fill-opacity:1;stroke:#000000;stroke-width:0.235;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:transform-center-y="-0.32699901" + d="m 4.2550057,289.04768 -3.25680009,2.36619 1.24398689,3.82863 H 6.267819 l 1.2439871,-3.82863 z" + id="path5105" + inkscape:connector-curvature="0" /> + <path + style="fill:#000000;fill-opacity:1;stroke:#198c73;stroke-width:0.44999999;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 6.3492468,292.70726 a 2.094241,2.094241 0 0 0 -2.0942411,-2.09425 2.094241,2.094241 0 0 0 -2.094241,2.09425 2.094241,2.094241 0 0 0 2.094241,2.09424 2.094241,2.094241 0 0 0 2.0942411,-2.09424 z" + id="path5129" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path894" + d="m 4.2609653,288.31605 -3.98869272,2.89794 1.52354502,4.68902 h 4.9302956 l 1.5235452,-4.68902 z" + inkscape:transform-center-y="-0.40048513" + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.368;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + </g> +</svg> diff --git a/res/computerscare-pentagon-jack-1-outline.svg b/res/computerscare-pentagon-jack-1-outline.svg @@ -10,8 +10,8 @@ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="27" - height="27" - viewBox="0 0 7.1437501 7.1437501" + height="29" + viewBox="0 0 7.1437501 7.6729167" version="1.1" id="svg4524" inkscape:version="0.92.2 5c3e80d, 2017-08-06" @@ -20,10 +20,10 @@ id="defs4518"> <inkscape:perspective sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 100 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="200 : 100 : 1" - inkscape:persp3d-origin="100 : 66.666669 : 1" + inkscape:vp_x="0 : 99.999999 : 1" + inkscape:vp_y="0 : 999.99999 : 0" + inkscape:vp_z="200 : 99.999999 : 1" + inkscape:persp3d-origin="100 : 66.666668 : 1" id="perspective5087" /> </defs> <sodipodi:namedview @@ -33,9 +33,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="22.4" - inkscape:cx="11.30391" - inkscape:cy="13.38896" + inkscape:zoom="15.839192" + inkscape:cx="17.668885" + inkscape:cy="4.2468642" inkscape:document-units="mm" inkscape:current-layer="layer1" showgrid="false" @@ -53,7 +53,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> + <dc:title></dc:title> </cc:Work> </rdf:RDF> </metadata> @@ -61,16 +61,16 @@ inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" - transform="translate(0,-289.85624)"> + transform="translate(0,-289.32708)"> <path style="fill:#eaeaea;fill-opacity:1;stroke:#000000;stroke-width:0.15000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" inkscape:transform-center-y="0.34786668" - d="m 3.5701275,297.10301 -3.46468092,-2.51722 1.32339032,-4.07301 h 4.2825813 l 1.3233906,4.07301 z" + d="m 3.5701275,296.80329 -3.46468092,-2.51722 1.32339032,-4.07301 h 4.2825813 l 1.3233906,4.07301 z" id="path5105" inkscape:connector-curvature="0" /> <path - style="fill:#000000;fill-opacity:1;stroke:#198c73;stroke-width:0.45;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 5.6643686,293.24661 a 2.094241,2.094241 0 0 1 -2.0942411,2.09425 2.094241,2.094241 0 0 1 -2.094241,-2.09425 2.094241,2.094241 0 0 1 2.094241,-2.09424 2.094241,2.094241 0 0 1 2.0942411,2.09424 z" + style="fill:#000000;fill-opacity:1;stroke:#198c73;stroke-width:0.44999999;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 5.6643686,292.94689 a 2.094241,2.094241 0 0 1 -2.0942411,2.09425 2.094241,2.094241 0 0 1 -2.094241,-2.09425 2.094241,2.094241 0 0 1 2.094241,-2.09424 2.094241,2.094241 0 0 1 2.0942411,2.09424 z" id="path5129" inkscape:connector-curvature="0" /> </g> diff --git a/res/computerscare-pentagon-jack-pointing-up.svg b/res/computerscare-pentagon-jack-pointing-up.svg @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="27" + height="29" + viewBox="0 0 7.1437501 7.6729167" + version="1.1" + id="svg4524" + inkscape:version="0.92.2 5c3e80d, 2017-08-06" + sodipodi:docname="computerscare-pentagon-jack-pointing-up.svg"> + <defs + id="defs4518"> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 99.999999 : 1" + inkscape:vp_y="0 : 999.99999 : 0" + inkscape:vp_z="200 : 99.999999 : 1" + inkscape:persp3d-origin="100 : 66.666668 : 1" + id="perspective5087" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="15.839192" + inkscape:cx="6.3678035" + inkscape:cy="9.2976269" + inkscape:document-units="mm" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1440" + inkscape:window-height="855" + inkscape:window-x="0" + inkscape:window-y="1" + inkscape:window-maximized="1" + units="px" /> + <metadata + id="metadata4521"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-289.32708)"> + <path + style="fill:#eaeaea;fill-opacity:1;stroke:#000000;stroke-width:0.15000001;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:transform-center-y="-0.34787155" + d="m 3.5701275,289.50177 -3.46468092,2.51722 1.32339032,4.07301 h 4.2825813 l 1.3233906,-4.07301 z" + id="path5105" + inkscape:connector-curvature="0" /> + <path + style="fill:#000000;fill-opacity:1;stroke:#198c73;stroke-width:0.44999999;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 5.6643686,293.35817 a 2.094241,2.094241 0 0 0 -2.0942411,-2.09425 2.094241,2.094241 0 0 0 -2.094241,2.09425 2.094241,2.094241 0 0 0 2.094241,2.09424 2.094241,2.094241 0 0 0 2.0942411,-2.09424 z" + id="path5129" + inkscape:connector-curvature="0" /> + </g> +</svg> diff --git a/src/Computerscare.hpp b/src/Computerscare.hpp @@ -23,7 +23,15 @@ extern Model *modelComputerscareLaundrySoup; struct OutPort : SVGPort { OutPort() { - background->svg = SVG::load(assetPlugin(plugin, "res/09 Output Plug.svg")); + background->svg = SVG::load(assetPlugin(plugin, "res/computerscare-pentagon-jack-1-outline-flipped.svg")); + background->wrap(); + box.size = background->box.size; + } +}; + +struct PointingUpPort : SVGPort { + PointingUpPort() { + background->svg = SVG::load(assetPlugin(plugin, "res/computerscare-pentagon-jack-pointing-up.svg")); background->wrap(); box.size = background->box.size; } diff --git a/src/ComputerscareLaundrySoup.cpp b/src/ComputerscareLaundrySoup.cpp @@ -12,7 +12,9 @@ struct ComputerscareLaundrySoup; const int numFields = 5; class MyTextField : public LedDisplayTextField { + public: + int fontSize = 18; MyTextField() : LedDisplayTextField() {} void setModule(ComputerscareLaundrySoup* _module) { module = _module; @@ -22,7 +24,7 @@ public: bndSetFont(font->handle); int textPos = bndIconLabelTextPosition(gVg, textOffset.x, textOffset.y, box.size.x - 2*textOffset.x, box.size.y - 2*textOffset.y, - -1, 22, text.c_str(), mousePos.x, mousePos.y); + -1, fontSize, text.c_str(), mousePos.x, mousePos.y); bndSetFont(gGuiFont->handle); return textPos; } @@ -30,7 +32,7 @@ public: nvgScissor(vg, 0, 0, box.size.x, box.size.y); // Background - nvgFontSize(vg, 22); + nvgFontSize(vg, fontSize); nvgBeginPath(vg); nvgRoundedRect(vg, 0, 0, box.size.x, box.size.y, 5.0); nvgFillColor(vg, nvgRGB(0x00, 0x00, 0x00)); @@ -45,9 +47,9 @@ public: int begin = min(cursor, selection); int end = (this == gFocusedWidget) ? max(cursor, selection) : -1; //bndTextField(vg,textOffset.x,textOffset.y+2, box.size.x, box.size.y, -1, 0, 0, const char *text, int cbegin, int cend); - bndIconLabelCaret(vg, textOffset.x, textOffset.y+2, + bndIconLabelCaret(vg, textOffset.x, textOffset.y - 2, box.size.x - 2*textOffset.x, box.size.y - 2*textOffset.y, - -1, color, 22, text.c_str(), highlightColor, begin, end); + -1, color, fontSize, text.c_str(), highlightColor, begin, end); bndSetFont(gGuiFont->handle); } @@ -318,7 +320,7 @@ struct ComputerscareLaundrySoupWidget : ModuleWidget { addInput(Port::create<InPort>(mm2px(Vec(12 , 0)), Port::INPUT, module, ComputerscareLaundrySoup::GLOBAL_RESET_INPUT)); for(int i = 0; i < numFields; i++) { - addOutput(Port::create<InPort>(mm2px(Vec(55 , verticalStart + verticalSpacing*i - 10)), Port::OUTPUT, module, ComputerscareLaundrySoup::TRG_OUTPUT + i)); + addOutput(Port::create<OutPort>(mm2px(Vec(55 , verticalStart + verticalSpacing*i - 11)), Port::OUTPUT, module, ComputerscareLaundrySoup::TRG_OUTPUT + i)); addInput(Port::create<InPort>(mm2px(Vec(2, verticalStart + verticalSpacing*i-10)), Port::INPUT, module, ComputerscareLaundrySoup::CLOCK_INPUT + i)); @@ -327,7 +329,7 @@ struct ComputerscareLaundrySoupWidget : ModuleWidget { textField = Widget::create<MyTextField>(mm2px(Vec(1, verticalStart + verticalSpacing*i))); textField->setModule(module); - textField->box.size = mm2px(Vec(63, 10)); + textField->box.size = mm2px(Vec(63, 8)); textField->multiline = false; textField->color = nvgRGB(0xC0, 0xE7, 0xDE); addChild(textField); diff --git a/src/ComputerscarePatchSequencer.cpp b/src/ComputerscarePatchSequencer.cpp @@ -341,8 +341,16 @@ struct ComputerscarePatchSequencerWidget : ModuleWidget { for (int i = 0 ; i < 10 ; i++) { addInput(Port::create<InPort>(Vec(3, i * row_spacing + top_row), Port::INPUT, module, ComputerscarePatchSequencer::INPUT_JACKS + i)); - addOutput(Port::create<InPort>(Vec(33 + i * column_spacing , top_row + 10 * row_spacing), Port::OUTPUT, module, ComputerscarePatchSequencer::OUTPUTS + i)); - for(int j = 0 ; j < 10 ; j++ ) + + if(i%2) { + addOutput(Port::create<PointingUpPort>(Vec(33 + i * column_spacing , top_row + 10 * row_spacing), Port::OUTPUT, module, ComputerscarePatchSequencer::OUTPUTS + i)); + } + else { + addOutput(Port::create<InPort>(Vec(33 + i * column_spacing , top_row + 10 * row_spacing), Port::OUTPUT, module, ComputerscarePatchSequencer::OUTPUTS + i)); + + } + + for(int j = 0 ; j < 10 ; j++ ) { // the part you click addParam(ParamWidget::create<LEDButton>(Vec(35 + column_spacing * j+2, top_row + row_spacing * i+4), module, ComputerscarePatchSequencer::SWITCHES + i + j * 10, 0.0, 1.0, 0.0));