Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
petertools committed Mar 28, 2018
2 parents 1a8d2aa + ee0319b commit 6465e30
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 31 deletions.
16 changes: 6 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SLUG = StellareModular-Link
VERSION = 0.5.2
VERSION = 0.6.0

FLAGS += -DSLUG=$(SLUG) -DVERSION=$(VERSION)
FLAGS += -Imodules/link/include -Imodules/link/modules/asio-standalone/asio/include -Ilink-wrapper
Expand All @@ -24,14 +24,10 @@ ifneq ($(OS),Windows_NT)
SOURCES += $(wildcard link-wrapper/*.cpp)
endif

include ../../plugin.mk
DISTRIBUTABLES += $(wildcard LICENSE*) res

# If RACK_DIR is not defined when calling the Makefile, default to two levels above
RACK_DIR ?= ../..

# Convenience target for packaging files into a ZIP file
.PHONY: dist
dist: all
mkdir -p dist/$(SLUG)
cp LICENSE* dist/$(SLUG)/
cp $(TARGET) dist/$(SLUG)/
cp -R res dist/$(SLUG)/
cd dist && zip -5 -r $(SLUG)-$(VERSION)-$(ARCH).zip $(SLUG)
# Include the VCV Rack plugin Makefile framework
include $(RACK_DIR)/plugin.mk
35 changes: 20 additions & 15 deletions src/Link.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,30 +153,35 @@ void Link::step()
lights[SYNC_LIGHT].setBrightness(m_synced ? 0.0 : 1.0);
}

LinkWidget::LinkWidget()
struct LinkWidget : ModuleWidget
{
LinkWidget(Link*);
};

LinkWidget::LinkWidget(Link* module) : ModuleWidget(module)
{
Link* module = new Link();
setModule(module);
box.size = Vec(60, 380);

SVGPanel* panel = new SVGPanel();
panel->box.size = box.size;
panel->setBackground(SVG::load(assetPlugin(plugin, "res/Link.svg")));
addChild(panel);

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

addParam(createParam<BlueSmallButton>(Vec(22, 42), module, Link::SYNC_PARAM, 0.0, 1.0, 0.0));
addParam(createParam<KnobSimpleWhite>(Vec(16, 93), module, Link::OFFSET_PARAM, -1.0, 1.0, 0.0));
addParam(createParam<KnobSimpleWhite>(Vec(16, 153), module, Link::SWING_PARAM, 0.0, 1.0, 0.0));
addParam(ParamWidget::create<BlueSmallButton>(Vec(22, 42), module, Link::SYNC_PARAM, 0.0, 1.0, 0.0));
addParam(ParamWidget::create<KnobSimpleWhite>(Vec(16, 93), module, Link::OFFSET_PARAM, -1.0, 1.0, 0.0));
addParam(ParamWidget::create<KnobSimpleWhite>(Vec(16, 153), module, Link::SWING_PARAM, 0.0, 1.0, 0.0));

addOutput(createOutput<PJ301MPort>(Vec(17.5, 258), module, Link::CLOCK_OUTPUT_4TH));
addOutput(createOutput<PJ301MPort>(Vec(17.5, 212), module, Link::CLOCK_OUTPUT_2ND));
addOutput(createOutput<PJ301MPort>(Vec(17.5, 304), module, Link::RESET_OUTPUT));
addOutput(Port::create<PJ301MPort>(Vec(17.5, 258), Port::OUTPUT, module, Link::CLOCK_OUTPUT_4TH));
addOutput(Port::create<PJ301MPort>(Vec(17.5, 212), Port::OUTPUT, module, Link::CLOCK_OUTPUT_2ND));
addOutput(Port::create<PJ301MPort>(Vec(17.5, 304), Port::OUTPUT, module, Link::RESET_OUTPUT));

addChild(createLight<SmallLight<BlueLight>>(Vec(17, 253.5), module, Link::CLOCK_LIGHT_4TH));
addChild(createLight<SmallLight<GreenLight>>(Vec(17, 207), module, Link::CLOCK_LIGHT_2ND));
addChild(createLight<SmallLight<YellowLight>>(Vec(17, 300), module, Link::RESET_LIGHT));
addChild(createLight<MediumLight<BlueLight>>(Vec(25.4, 45.4), module, Link::SYNC_LIGHT));
addChild(ModuleLightWidget::create<SmallLight<BlueLight>>(Vec(17, 253.5), module, Link::CLOCK_LIGHT_4TH));
addChild(ModuleLightWidget::create<SmallLight<GreenLight>>(Vec(17, 207), module, Link::CLOCK_LIGHT_2ND));
addChild(ModuleLightWidget::create<SmallLight<YellowLight>>(Vec(17, 300), module, Link::RESET_LIGHT));
addChild(ModuleLightWidget::create<MediumLight<BlueLight>>(Vec(25.4, 45.4), module, Link::SYNC_LIGHT));
}

Model *modelLink = Model::create<Link, LinkWidget>("Stellare Modular", "Link", "Link", CLOCK_TAG);
7 changes: 2 additions & 5 deletions src/Link.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using namespace rack;

extern Plugin* plugin;
extern Model* modelLink;

struct BlueSmallButton : SVGSwitch, MomentarySwitch
{
Expand All @@ -45,10 +46,6 @@ struct KnobSimpleWhite : SVGKnob
maxAngle = 0.82 * M_PI;

setSVG(SVG::load(assetPlugin(plugin, "res/KnobSimpleWhite.svg")));
shadow->opacity = 0.f;
}
};

struct LinkWidget : ModuleWidget
{
LinkWidget();
};
2 changes: 1 addition & 1 deletion src/StellareModular.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ void init(rack::Plugin* p)
p->slug = TOSTRING(SLUG);
p->version = TOSTRING(VERSION);

p->addModel(createModel<LinkWidget>("Stellare Modular", "Link", "Link", CLOCK_TAG));
p->addModel(modelLink);
}

0 comments on commit 6465e30

Please sign in to comment.