Browse Source

Updated Braids display to match Component Library style, removed

Branches mode buttons (for now)
tags/v0.4.0
Andrew Belt 8 years ago
parent
commit
a1a69b99da
2 changed files with 21 additions and 8 deletions
  1. +19
    -6
      src/Braids.cpp
  2. +2
    -2
      src/Branches.cpp

+ 19
- 6
src/Braids.cpp View File

@@ -167,15 +167,27 @@ struct BraidsDisplay : TransparentWidget {
void draw(NVGcontext *vg) {
int shape = roundf(getf(value));

// Background
NVGcolor backgroundColor = nvgRGB(0x38, 0x38, 0x38);
NVGcolor borderColor = nvgRGB(0x10, 0x10, 0x10);
nvgBeginPath(vg);
nvgRoundedRect(vg, 0.0, 0.0, box.size.x, box.size.y, 5.0);
nvgFillColor(vg, backgroundColor);
nvgFill(vg);
nvgStrokeWidth(vg, 1.0);
nvgStrokeColor(vg, borderColor);
nvgStroke(vg);

nvgFontSize(vg, 36);
nvgFontFaceId(vg, font->handle);
nvgTextLetterSpacing(vg, 2.5);

NVGcolor color = nvgRGB(0xaf, 0xd2, 0x2c);
nvgFillColor(vg, nvgTransRGBA(color, 16));
nvgText(vg, 0.0, 0.0, "~~~~", NULL);
nvgFillColor(vg, color);
nvgText(vg, 0.0, 0.0, algo_values[shape], NULL);
Vec textPos = Vec(10, 48);
NVGcolor textColor = nvgRGB(0xaf, 0xd2, 0x2c);
nvgFillColor(vg, nvgTransRGBA(textColor, 16));
nvgText(vg, textPos.x, textPos.y, "~~~~", NULL);
nvgFillColor(vg, textColor);
nvgText(vg, textPos.x, textPos.y, algo_values[shape], NULL);
}
};

@@ -194,7 +206,8 @@ BraidsWidget::BraidsWidget() {

{
BraidsDisplay *display = new BraidsDisplay();
display->box.pos = Vec(24, 101);
display->box.pos = Vec(14, 53);
display->box.size = Vec(148, 56);
display->value = &module->params[Braids::SHAPE_PARAM];
addChild(display);
}


+ 2
- 2
src/Branches.cpp View File

@@ -89,14 +89,14 @@ BranchesWidget::BranchesWidget() {
addChild(createScrew<SilverScrew>(Vec(15, 365)));

addParam(createParam<Rogan1PSRed>(Vec(24, 64), module, Branches::THRESHOLD1_PARAM, 0.0, 1.0, 0.5));
addParam(createParam<MediumToggleSwitch>(Vec(69, 58), module, Branches::MODE1_PARAM, 0.0, 1.0, 0.0));
// addParam(createParam<MediumToggleSwitch>(Vec(69, 58), module, Branches::MODE1_PARAM, 0.0, 1.0, 0.0));
addInput(createInput<PJ3410Port>(Vec(5, 119), module, Branches::IN1_INPUT));
addInput(createInput<PJ3410Port>(Vec(52, 119), module, Branches::P1_INPUT));
addOutput(createOutput<PJ3410Port>(Vec(5, 157), module, Branches::OUT1A_OUTPUT));
addOutput(createOutput<PJ3410Port>(Vec(52, 157), module, Branches::OUT1B_OUTPUT));

addParam(createParam<Rogan1PSGreen>(Vec(24, 220), module, Branches::THRESHOLD2_PARAM, 0.0, 1.0, 0.5));
addParam(createParam<MediumToggleSwitch>(Vec(69, 214), module, Branches::MODE2_PARAM, 0.0, 1.0, 0.0));
// addParam(createParam<MediumToggleSwitch>(Vec(69, 214), module, Branches::MODE2_PARAM, 0.0, 1.0, 0.0));
addInput(createInput<PJ3410Port>(Vec(5, 275), module, Branches::IN2_INPUT));
addInput(createInput<PJ3410Port>(Vec(52, 275), module, Branches::P2_INPUT));
addOutput(createOutput<PJ3410Port>(Vec(5, 313), module, Branches::OUT2A_OUTPUT));


Loading…
Cancel
Save