Browse Source

Modify source to reflect change from PNG to SVG

addChild for setting faceplate graphics is changed to ModuleWidget's
setPanel method to reflect the usual approach to setting SVG graphics for
the faceplate.

In Tides, addChild is still used so that the faceplate
can be switched between Tides and Sheep as needed.
tags/v0.6.0
Evan King 7 years ago
parent
commit
30252ae668
13 changed files with 31 additions and 103 deletions
  1. +9
    -15
      src/Blinds.cpp
  2. +1
    -7
      src/Braids.cpp
  3. +1
    -7
      src/Branches.cpp
  4. +1
    -7
      src/Clouds.cpp
  5. +1
    -7
      src/Elements.cpp
  6. +1
    -7
      src/Frames.cpp
  7. +1
    -7
      src/Kinks.cpp
  8. +1
    -7
      src/Links.cpp
  9. +1
    -7
      src/Rings.cpp
  10. +1
    -7
      src/Shades.cpp
  11. +6
    -6
      src/Tides.cpp
  12. +5
    -11
      src/Veils.cpp
  13. +2
    -8
      src/Warps.cpp

+ 9
- 15
src/Blinds.cpp View File

@@ -71,13 +71,7 @@ void Blinds::step() {

struct BlindsWidget : ModuleWidget {
BlindsWidget(Blinds *module) : ModuleWidget(module) {
box.size = Vec(15*12, 380);
{
Panel *panel = new LightPanel();
panel->backgroundImage = Image::load(assetPlugin(plugin, "res/Blinds.png"));
panel->box.size = box.size;
addChild(panel);
}
setPanel(SVG::load(assetPlugin(plugin, "res/Blinds.svg")));

addChild(Widget::create<ScrewSilver>(Vec(15, 0)));
addChild(Widget::create<ScrewSilver>(Vec(150, 0)));
@@ -109,15 +103,15 @@ struct BlindsWidget : ModuleWidget {
addOutput(Port::create<PJ301MPort>(Vec(144, 198), Port::OUTPUT, module, Blinds::OUT3_OUTPUT));
addOutput(Port::create<PJ301MPort>(Vec(144, 277), Port::OUTPUT, module, Blinds::OUT4_OUTPUT));

addChild(ModuleLightWidget::create<SmallLight<GreenRedLight>>(Vec(77, 96), module, Blinds::CV1_POS_LIGHT));
addChild(ModuleLightWidget::create<SmallLight<GreenRedLight>>(Vec(77, 175), module, Blinds::CV2_POS_LIGHT));
addChild(ModuleLightWidget::create<SmallLight<GreenRedLight>>(Vec(77, 254), module, Blinds::CV3_POS_LIGHT));
addChild(ModuleLightWidget::create<SmallLight<GreenRedLight>>(Vec(77, 333), module, Blinds::CV4_POS_LIGHT));
addChild(ModuleLightWidget::create<SmallLight<GreenRedLight>>(Vec(78, 96), module, Blinds::CV1_POS_LIGHT));
addChild(ModuleLightWidget::create<SmallLight<GreenRedLight>>(Vec(78, 175), module, Blinds::CV2_POS_LIGHT));
addChild(ModuleLightWidget::create<SmallLight<GreenRedLight>>(Vec(78, 254), module, Blinds::CV3_POS_LIGHT));
addChild(ModuleLightWidget::create<SmallLight<GreenRedLight>>(Vec(78, 333), module, Blinds::CV4_POS_LIGHT));

addChild(ModuleLightWidget::create<MediumLight<GreenRedLight>>(Vec(150, 87), module, Blinds::OUT1_POS_LIGHT));
addChild(ModuleLightWidget::create<MediumLight<GreenRedLight>>(Vec(150, 166), module, Blinds::OUT2_POS_LIGHT));
addChild(ModuleLightWidget::create<MediumLight<GreenRedLight>>(Vec(150, 245), module, Blinds::OUT3_POS_LIGHT));
addChild(ModuleLightWidget::create<MediumLight<GreenRedLight>>(Vec(150, 324), module, Blinds::OUT4_POS_LIGHT));
addChild(ModuleLightWidget::create<MediumLight<GreenRedLight>>(Vec(152, 87), module, Blinds::OUT1_POS_LIGHT));
addChild(ModuleLightWidget::create<MediumLight<GreenRedLight>>(Vec(152, 166), module, Blinds::OUT2_POS_LIGHT));
addChild(ModuleLightWidget::create<MediumLight<GreenRedLight>>(Vec(152, 245), module, Blinds::OUT3_POS_LIGHT));
addChild(ModuleLightWidget::create<MediumLight<GreenRedLight>>(Vec(152, 324), module, Blinds::OUT4_POS_LIGHT));
}
};



+ 1
- 7
src/Braids.cpp View File

@@ -295,13 +295,7 @@ struct BraidsLowCpuItem : MenuItem {

struct BraidsWidget : ModuleWidget {
BraidsWidget(Braids *module) : ModuleWidget(module) {
box.size = Vec(15*16, 380);
{
Panel *panel = new LightPanel();
panel->backgroundImage = Image::load(assetPlugin(plugin, "res/Braids.png"));
panel->box.size = box.size;
addChild(panel);
}
setPanel(SVG::load(assetPlugin(plugin, "res/Braids.svg")));

{
BraidsDisplay *display = new BraidsDisplay();


+ 1
- 7
src/Branches.cpp View File

@@ -91,13 +91,7 @@ void Branches::step() {

struct BranchesWidget : ModuleWidget {
BranchesWidget(Branches *module) : ModuleWidget(module) {
box.size = Vec(15*6, 380);
{
Panel *panel = new LightPanel();
panel->backgroundImage = Image::load(assetPlugin(plugin, "res/Branches.png"));
panel->box.size = box.size;
addChild(panel);
}
setPanel(SVG::load(assetPlugin(plugin, "res/Branches.svg")));

addChild(Widget::create<ScrewSilver>(Vec(15, 0)));
addChild(Widget::create<ScrewSilver>(Vec(15, 365)));


+ 1
- 7
src/Clouds.cpp View File

@@ -310,13 +310,7 @@ struct CloudsWidget : ModuleWidget {
ParamWidget *reverbParam;

CloudsWidget(Clouds *module) : ModuleWidget(module) {
box.size = Vec(15*18, 380);
{
Panel *panel = new LightPanel();
panel->backgroundImage = Image::load(assetPlugin(plugin, "res/Clouds.png"));
panel->box.size = box.size;
addChild(panel);
}
setPanel(SVG::load(assetPlugin(plugin, "res/Clouds.svg")));

addChild(Widget::create<ScrewSilver>(Vec(15, 0)));
addChild(Widget::create<ScrewSilver>(Vec(240, 0)));


+ 1
- 7
src/Elements.cpp View File

@@ -229,13 +229,7 @@ struct ElementsModalItem : MenuItem {

struct ElementsWidget : ModuleWidget {
ElementsWidget(Elements *module) : ModuleWidget(module) {
box.size = Vec(15*34, 380);
{
Panel *panel = new LightPanel();
panel->backgroundImage = Image::load(assetPlugin(plugin, "res/Elements.png"));
panel->box.size = box.size;
addChild(panel);
}
setPanel(SVG::load(assetPlugin(plugin, "res/Elements.svg")));

addChild(Widget::create<ScrewSilver>(Vec(15, 0)));
addChild(Widget::create<ScrewSilver>(Vec(480, 0)));


+ 1
- 7
src/Frames.cpp View File

@@ -287,13 +287,7 @@ struct CKSSRot : SVGSwitch, ToggleSwitch {

struct FramesWidget : ModuleWidget {
FramesWidget(Frames *module) : ModuleWidget(module) {
box.size = Vec(15*18, 380);
{
Panel *panel = new LightPanel();
panel->backgroundImage = Image::load(assetPlugin(plugin, "res/Frames.png"));
panel->box.size = box.size;
addChild(panel);
}
setPanel(SVG::load(assetPlugin(plugin, "res/Frames.svg")));

addChild(Widget::create<ScrewSilver>(Vec(15, 0)));
addChild(Widget::create<ScrewSilver>(Vec(box.size.x-30, 0)));


+ 1
- 7
src/Kinks.cpp View File

@@ -70,13 +70,7 @@ void Kinks::step() {

struct KinksWidget : ModuleWidget {
KinksWidget(Kinks *module) : ModuleWidget(module) {
box.size = Vec(15*4, 380);
{
Panel *panel = new LightPanel();
panel->backgroundImage = Image::load(assetPlugin(plugin, "res/Kinks.png"));
panel->box.size = box.size;
addChild(panel);
}
setPanel(SVG::load(assetPlugin(plugin, "res/Kinks.svg")));

addChild(Widget::create<ScrewSilver>(Vec(15, 0)));
addChild(Widget::create<ScrewSilver>(Vec(15, 365)));


+ 1
- 7
src/Links.cpp View File

@@ -58,13 +58,7 @@ void Links::step() {

struct LinksWidget : ModuleWidget {
LinksWidget(Links *module) : ModuleWidget(module) {
box.size = Vec(15*4, 380);
{
Panel *panel = new LightPanel();
panel->backgroundImage = Image::load(assetPlugin(plugin, "res/Links.png"));
panel->box.size = box.size;
addChild(panel);
}
setPanel(SVG::load(assetPlugin(plugin, "res/Links.svg")));

addChild(Widget::create<ScrewSilver>(Vec(15, 0)));
addChild(Widget::create<ScrewSilver>(Vec(15, 365)));


+ 1
- 7
src/Rings.cpp View File

@@ -248,13 +248,7 @@ void Rings::step() {

struct RingsWidget : ModuleWidget {
RingsWidget(Rings *module) : ModuleWidget(module) {
box.size = Vec(15*14, 380);
{
Panel *panel = new LightPanel();
panel->backgroundImage = Image::load(assetPlugin(plugin, "res/Rings.png"));
panel->box.size = box.size;
addChild(panel);
}
setPanel(SVG::load(assetPlugin(plugin, "res/Rings.svg")));

addChild(Widget::create<ScrewSilver>(Vec(15, 0)));
addChild(Widget::create<ScrewSilver>(Vec(180, 0)));


+ 1
- 7
src/Shades.cpp View File

@@ -62,13 +62,7 @@ void Shades::step() {

struct ShadesWidget : ModuleWidget {
ShadesWidget(Shades *module) : ModuleWidget(module) {
box.size = Vec(15*6, 380);
{
Panel *panel = new LightPanel();
panel->backgroundImage = Image::load(assetPlugin(plugin, "res/Shades.png"));
panel->box.size = box.size;
addChild(panel);
}
setPanel(SVG::load(assetPlugin(plugin, "res/Shades.svg")));

addChild(Widget::create<ScrewSilver>(Vec(15, 0)));
addChild(Widget::create<ScrewSilver>(Vec(15, 365)));


+ 6
- 6
src/Tides.cpp View File

@@ -205,20 +205,20 @@ struct TidesSheepItem : MenuItem {


struct TidesWidget : ModuleWidget {
Panel *tidesPanel;
Panel *sheepPanel;
SVGPanel *tidesPanel;
SVGPanel *sheepPanel;

TidesWidget(Tides *module) : ModuleWidget(module) {
box.size = Vec(15*14, 380);
{
tidesPanel = new LightPanel();
tidesPanel->backgroundImage = Image::load(assetPlugin(plugin, "res/Tides.png"));
tidesPanel = new SVGPanel();
tidesPanel->setBackground(SVG::load(assetPlugin(plugin, "res/Tides.svg")));
tidesPanel->box.size = box.size;
addChild(tidesPanel);
}
{
sheepPanel = new LightPanel();
sheepPanel->backgroundImage = Image::load(assetPlugin(plugin, "res/Sheep.png"));
sheepPanel = new SVGPanel();
sheepPanel->setBackground(SVG::load(assetPlugin(plugin, "res/Sheep.svg")));
sheepPanel->box.size = box.size;
addChild(sheepPanel);
}


+ 5
- 11
src/Veils.cpp View File

@@ -70,13 +70,7 @@ void Veils::step() {

struct VeilsWidget : ModuleWidget {
VeilsWidget(Veils *module) : ModuleWidget(module) {
box.size = Vec(15*12, 380);
{
Panel *panel = new LightPanel();
panel->backgroundImage = Image::load(assetPlugin(plugin, "res/Veils.png"));
panel->box.size = box.size;
addChild(panel);
}
setPanel(SVG::load(assetPlugin(plugin, "res/Veils.svg")));

addChild(Widget::create<ScrewSilver>(Vec(15, 0)));
addChild(Widget::create<ScrewSilver>(Vec(150, 0)));
@@ -108,10 +102,10 @@ struct VeilsWidget : ModuleWidget {
addOutput(Port::create<PJ301MPort>(Vec(144, 198), Port::OUTPUT, module, Veils::OUT3_OUTPUT));
addOutput(Port::create<PJ301MPort>(Vec(144, 277), Port::OUTPUT, module, Veils::OUT4_OUTPUT));

addChild(ModuleLightWidget::create<MediumLight<GreenRedLight>>(Vec(150, 87), module, Veils::OUT1_POS_LIGHT));
addChild(ModuleLightWidget::create<MediumLight<GreenRedLight>>(Vec(150, 166), module, Veils::OUT2_POS_LIGHT));
addChild(ModuleLightWidget::create<MediumLight<GreenRedLight>>(Vec(150, 245), module, Veils::OUT3_POS_LIGHT));
addChild(ModuleLightWidget::create<MediumLight<GreenRedLight>>(Vec(150, 324), module, Veils::OUT4_POS_LIGHT));
addChild(ModuleLightWidget::create<MediumLight<GreenRedLight>>(Vec(152, 87), module, Veils::OUT1_POS_LIGHT));
addChild(ModuleLightWidget::create<MediumLight<GreenRedLight>>(Vec(152, 166), module, Veils::OUT2_POS_LIGHT));
addChild(ModuleLightWidget::create<MediumLight<GreenRedLight>>(Vec(152, 245), module, Veils::OUT3_POS_LIGHT));
addChild(ModuleLightWidget::create<MediumLight<GreenRedLight>>(Vec(152, 324), module, Veils::OUT4_POS_LIGHT));
}
};



+ 2
- 8
src/Warps.cpp View File

@@ -128,13 +128,7 @@ struct AlgorithmLight : RedGreenBlueLight {

struct WarpsWidget : ModuleWidget {
WarpsWidget(Warps *module) : ModuleWidget(module) {
box.size = Vec(15*10, 380);
{
Panel *panel = new LightPanel();
panel->backgroundImage = Image::load(assetPlugin(plugin, "res/Warps.png"));
panel->box.size = box.size;
addChild(panel);
}
setPanel(SVG::load(assetPlugin(plugin, "res/Warps.svg")));

addChild(Widget::create<ScrewSilver>(Vec(15, 0)));
addChild(Widget::create<ScrewSilver>(Vec(120, 0)));
@@ -158,7 +152,7 @@ struct WarpsWidget : ModuleWidget {
addOutput(Port::create<PJ301MPort>(Vec(80, 316), Port::OUTPUT, module, Warps::MODULATOR_OUTPUT));
addOutput(Port::create<PJ301MPort>(Vec(116, 316), Port::OUTPUT, module, Warps::AUX_OUTPUT));

addChild(ModuleLightWidget::create<SmallLight<GreenRedLight>>(Vec(20, 167), module, Warps::CARRIER_GREEN_LIGHT));
addChild(ModuleLightWidget::create<SmallLight<GreenRedLight>>(Vec(21, 167), module, Warps::CARRIER_GREEN_LIGHT));

addChild(ModuleLightWidget::create<AlgorithmLight>(Vec(40, 63), module, Warps::ALGORITHM_LIGHT));
}


Loading…
Cancel
Save