commit 44ee5938a203fe3d9877ad1db8b9b01fee01a8e9
parent d17a743c5adc8da3fd24862008050e748a21eb6b
Author: Adam M <aemalone@gmail.com>
Date: Sun, 7 Jul 2019 10:32:38 -0500
Better UI for Roly Pouter
Diffstat:
3 files changed, 105 insertions(+), 10 deletions(-)
diff --git a/res/computerscare-medium-knob-dot-indicator.svg b/res/computerscare-medium-knob-dot-indicator.svg
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<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"
+ id="Layer_1"
+ data-name="Layer 1"
+ viewBox="0 0 28 28"
+ version="1.1"
+ sodipodi:docname="computerscare-medium-knob-dot-indicator.svg"
+ inkscape:version="0.92.2 5c3e80d, 2017-08-06"
+ width="28"
+ height="28">
+ <metadata
+ id="metadata1289">
+ <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>01 Big Knob</dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1398"
+ inkscape:window-height="834"
+ id="namedview1287"
+ showgrid="false"
+ inkscape:zoom="15.733333"
+ inkscape:cx="18.963494"
+ inkscape:cy="16.744952"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="Big_Knob" />
+ <defs
+ id="defs1279">
+ <style
+ id="style1277">.cls-1{fill:#245559;}.cls-2{fill:none;stroke:#24c9a6;stroke-miterlimit:10;stroke-width:3px;}</style>
+ </defs>
+ <title
+ id="title1281">01 Big Knob</title>
+ <g
+ id="Big_Knob"
+ data-name="Big Knob"
+ transform="translate(0,-32)">
+ <path
+ style="fill:#245559;stroke:#000000;stroke-width:0.40182629;stroke-opacity:1"
+ d="M 25.62578,46.000183 C 26.374585,54.886007 20.596733,58.72213 13.967114,58.111561 7.8708847,57.550115 -0.06927658,50.275098 1.9123265,44.034327 4.8258211,34.858699 5.0683776,37.665788 7.8677328,36.080009 10.080145,34.82672 10.946556,34.276664 13.967114,34.001984 c 3.68123,-0.334759 7.366697,-0.291907 10.540264,2.584521 1.741799,1.578715 0.910119,6.942056 1.118402,9.413678 z"
+ id="Big_Button_Circle"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="sssssss" />
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#24c9a6;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.37795276;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 16.862146,36.050648 c 0.117928,-0.66458 0.143572,-1.22448 -0.101176,-1.753193 0.307778,-0.299636 0.726646,-0.503303 0.602995,-0.886243 -0.274556,-0.256096 -0.848253,-0.275434 -1.252334,-0.22093 -0.552513,0.09233 -1.178468,0.03274 -1.689073,0.149938 -2.516396,0.08453 -1.133525,0.778224 -1.263805,1.416518 0.04674,0.589114 -0.213607,1.270542 -0.111272,1.865607 1.164475,1.134156 2.759399,0.548985 3.814665,-0.571697 z"
+ id="Button_Pointer"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cccccccc" />
+ </g>
+</svg>
diff --git a/src/Computerscare.hpp b/src/Computerscare.hpp
@@ -256,6 +256,11 @@ struct MediumSnapKnob : RoundBlackSnapKnob {
setSvg(APP->window->loadSvg(asset::plugin(pluginInstance, "res/computerscare-medium-knob-effed.svg")));
}
};
+struct MediumDotSnapKnob : RoundBlackSnapKnob {
+ MediumDotSnapKnob() {
+ setSvg(APP->window->loadSvg(asset::plugin(pluginInstance, "res/computerscare-medium-knob-dot-indicator.svg")));
+ }
+};
struct SmoothKnob : RoundKnob {
SmoothKnob() {
@@ -352,12 +357,14 @@ struct SmallLetterDisplay : Widget {
int fontSize = 19;
std::string defaultFontPath = "res/Oswald-Regular.ttf";
NVGcolor baseColor = COLOR_COMPUTERSCARE_TRANSPARENT;
+ NVGcolor textColor = nvgRGB(0x10, 0x10, 0x00);
float letterSpacing = 2.5;
int textAlign = 1;
bool active = false;
bool blink = false;
bool doubleblink = false;
+ float breakRowWidth = 80.f;
SmallLetterDisplay() {
value = "";
@@ -397,9 +404,9 @@ struct SmallLetterDisplay : Widget {
nvgTextAlign(ctx.vg, textAlign);
Vec textPos = Vec(6.0f, 12.0f);
- NVGcolor textColor = (!blink || doubleblink) ? nvgRGB(0x10, 0x10, 0x00) : COLOR_COMPUTERSCARE_YELLOW;
- nvgFillColor(ctx.vg, textColor);
- nvgTextBox(ctx.vg, textPos.x, textPos.y, 80, value.c_str(), NULL);
+ NVGcolor color = (!blink || doubleblink) ? textColor : COLOR_COMPUTERSCARE_YELLOW;
+ nvgFillColor(ctx.vg, color);
+ nvgTextBox(ctx.vg, textPos.x, textPos.y, breakRowWidth, value.c_str(), NULL);
}
};
diff --git a/src/ComputerscareRolyPouter.cpp b/src/ComputerscareRolyPouter.cpp
@@ -74,7 +74,7 @@ struct PouterSmallDisplay : SmallLetterDisplay
{
- std::string str = std::to_string(module->routing[ch]) + "->"+ std::to_string(ch+1);
+ std::string str = std::to_string(module->routing[ch]);
value = str;
@@ -84,6 +84,7 @@ struct PouterSmallDisplay : SmallLetterDisplay
}
};
+
struct ComputerscareRolyPouterWidget : ModuleWidget {
ComputerscareRolyPouterWidget(ComputerscareRolyPouter *module) {
@@ -105,7 +106,7 @@ struct ComputerscareRolyPouterWidget : ModuleWidget {
for (int i = 0; i < numKnobs; i++) {
xx = 1.4f + 24.3 * (i - i % 8) / 8;
yy = 66 + 36.5 * (i % 8) + 14.3 * (i - i % 8) / 8;
- addLabeledKnob(std::to_string(i + 1), xx, yy, module, i, (i - i % 8) * 0.2 - 3, 0);
+ addLabeledKnob(std::to_string(i + 1), xx, yy, module, i, (i - i % 8) * 1.3 - 5, i<8 ? 4 : 0);
}
@@ -116,19 +117,32 @@ struct ComputerscareRolyPouterWidget : ModuleWidget {
void addLabeledKnob(std::string label, int x, int y, ComputerscareRolyPouter *module, int index, float labelDx, float labelDy) {
pouterSmallDisplay = new PouterSmallDisplay(index);
- pouterSmallDisplay->box.size = Vec(5, 10);
- pouterSmallDisplay->fontSize = 12;
- pouterSmallDisplay->textAlign = 1;
+ pouterSmallDisplay->box.size = Vec(20, 20);
+ pouterSmallDisplay->box.pos = Vec(x-2.5 ,y+1.f);
+ pouterSmallDisplay->fontSize = 26;
+ pouterSmallDisplay->textAlign = 18;
+ pouterSmallDisplay->textColor = COLOR_COMPUTERSCARE_LIGHT_GREEN;
+ pouterSmallDisplay->breakRowWidth=20;
pouterSmallDisplay->module = module;
- addParam(createParam<MediumSnapKnob>(Vec(x, y), module, ComputerscareRolyPouter::KNOB + index));
- pouterSmallDisplay->box.pos = Vec(x + labelDx, y - 12 + labelDy);
+ outputChannelLabel = new SmallLetterDisplay();
+ outputChannelLabel->box.size = Vec(5, 5);
+ outputChannelLabel->box.pos = Vec(x + labelDx, y - 12 + labelDy);
+ outputChannelLabel->fontSize = 14;
+ outputChannelLabel->textAlign = index < 8 ? 1 : 4;
+ outputChannelLabel->breakRowWidth=15;
+
+ outputChannelLabel->value = std::to_string(index + 1);
+ addParam(createParam<MediumDotSnapKnob>(Vec(x, y), module, ComputerscareRolyPouter::KNOB + index));
addChild(pouterSmallDisplay);
+ addChild(outputChannelLabel);
}
PouterSmallDisplay* pouterSmallDisplay;
+ SmallLetterDisplay* outputChannelLabel;
};
+
Model *modelComputerscareRolyPouter = createModel<ComputerscareRolyPouter, ComputerscareRolyPouterWidget>("computerscare-roly-pouter");