Cleanup; Separate ildaeil jacks
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
454943f2cf
commit
ee7ce3b8e2
5 changed files with 24 additions and 25 deletions
|
@ -53,11 +53,11 @@ struct CardinalExpanderForInputMIDI : CardinalExpanderFromCVToCarlaMIDI {
|
||||||
CardinalExpanderForInputMIDI() {
|
CardinalExpanderForInputMIDI() {
|
||||||
static_assert(NUM_INPUTS == kNumInputs, "Invalid input configuration");
|
static_assert(NUM_INPUTS == kNumInputs, "Invalid input configuration");
|
||||||
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
|
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
|
||||||
configInput(PITCH_INPUT, "Pitch (1V/oct)");
|
configInput(PITCH_INPUT, "1V/octave pitch");
|
||||||
configInput(GATE_INPUT, "Gate");
|
configInput(GATE_INPUT, "Gate");
|
||||||
configInput(VEL_INPUT, "Velocity");
|
configInput(VEL_INPUT, "Velocity");
|
||||||
configInput(AFT_INPUT, "Aftertouch");
|
configInput(AFT_INPUT, "Aftertouch");
|
||||||
configInput(PW_INPUT, "Pitch wheel");
|
configInput(PW_INPUT, "Pitchbend");
|
||||||
configInput(MW_INPUT, "Mod wheel");
|
configInput(MW_INPUT, "Mod wheel");
|
||||||
onReset();
|
onReset();
|
||||||
}
|
}
|
||||||
|
@ -258,7 +258,7 @@ struct CardinalExpanderForInputMIDIWidget : ModuleWidgetWithSideScrews<> {
|
||||||
nvgText(args.vg, box.size.x * 0.666f, startY + padding * 1 - 4.0f, "Gate", nullptr);
|
nvgText(args.vg, box.size.x * 0.666f, startY + padding * 1 - 4.0f, "Gate", nullptr);
|
||||||
nvgText(args.vg, box.size.x * 0.666f, startY + padding * 2 - 4.0f, "Vel", nullptr);
|
nvgText(args.vg, box.size.x * 0.666f, startY + padding * 2 - 4.0f, "Vel", nullptr);
|
||||||
nvgText(args.vg, box.size.x * 0.666f, startY + padding * 3 - 4.0f, "Aft", nullptr);
|
nvgText(args.vg, box.size.x * 0.666f, startY + padding * 3 - 4.0f, "Aft", nullptr);
|
||||||
nvgText(args.vg, box.size.x * 0.666f, startY + padding * 4 - 4.0f, "PW", nullptr);
|
nvgText(args.vg, box.size.x * 0.666f, startY + padding * 4 - 4.0f, "Pb", nullptr);
|
||||||
nvgText(args.vg, box.size.x * 0.666f, startY + padding * 5 - 4.0f, "MW", nullptr);
|
nvgText(args.vg, box.size.x * 0.666f, startY + padding * 5 - 4.0f, "MW", nullptr);
|
||||||
|
|
||||||
ModuleWidgetWithSideScrews::draw(args);
|
ModuleWidgetWithSideScrews::draw(args);
|
||||||
|
|
|
@ -224,6 +224,8 @@ struct HostAudioWidget : ModuleWidgetWith8HP {
|
||||||
|
|
||||||
if (numIO == 2)
|
if (numIO == 2)
|
||||||
{
|
{
|
||||||
|
// FIXME
|
||||||
|
const float middleX = box.size.x * 0.5f;
|
||||||
addParam(createParamCentered<NanoKnob>(Vec(middleX, 310.0f), m, 0));
|
addParam(createParamCentered<NanoKnob>(Vec(middleX, 310.0f), m, 0));
|
||||||
|
|
||||||
HostAudioNanoMeter<numIO>* const meter = new HostAudioNanoMeter<numIO>(m);
|
HostAudioNanoMeter<numIO>* const meter = new HostAudioNanoMeter<numIO>(m);
|
||||||
|
|
|
@ -705,7 +705,7 @@ struct HostMIDIWidget : ModuleWidgetWith9HP {
|
||||||
drawTextLine(args.vg, 2, "Velocity");
|
drawTextLine(args.vg, 2, "Velocity");
|
||||||
drawTextLine(args.vg, 3, "Aftertouch");
|
drawTextLine(args.vg, 3, "Aftertouch");
|
||||||
drawTextLine(args.vg, 4, "Pitchbend");
|
drawTextLine(args.vg, 4, "Pitchbend");
|
||||||
drawTextLine(args.vg, 5, "ModWheel");
|
drawTextLine(args.vg, 5, "Mod Wheel");
|
||||||
drawTextLine(args.vg, 6, "Start");
|
drawTextLine(args.vg, 6, "Start");
|
||||||
drawTextLine(args.vg, 7, "Stop");
|
drawTextLine(args.vg, 7, "Stop");
|
||||||
drawTextLine(args.vg, 8, "Cont");
|
drawTextLine(args.vg, 8, "Cont");
|
||||||
|
|
|
@ -1520,7 +1520,7 @@ static void projectLoadedFromDSP(void* const ui)
|
||||||
|
|
||||||
// --------------------------------------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
struct IldaeilModuleWidget : ModuleWidgetWithSideScrews<> {
|
struct IldaeilModuleWidget : ModuleWidgetWithSideScrews<26> {
|
||||||
bool hasLeftSideExpander = false;
|
bool hasLeftSideExpander = false;
|
||||||
IldaeilWidget* ildaeilWidget = nullptr;
|
IldaeilWidget* ildaeilWidget = nullptr;
|
||||||
|
|
||||||
|
@ -1528,29 +1528,27 @@ struct IldaeilModuleWidget : ModuleWidgetWithSideScrews<> {
|
||||||
{
|
{
|
||||||
setModule(module);
|
setModule(module);
|
||||||
setPanel(APP->window->loadSvg(asset::plugin(pluginInstance, "res/Ildaeil.svg")));
|
setPanel(APP->window->loadSvg(asset::plugin(pluginInstance, "res/Ildaeil.svg")));
|
||||||
|
createAndAddScrews();
|
||||||
|
|
||||||
if (module == nullptr || module->pcontext != nullptr)
|
if (module == nullptr || module->pcontext != nullptr)
|
||||||
{
|
{
|
||||||
ildaeilWidget = new IldaeilWidget(module);
|
ildaeilWidget = new IldaeilWidget(module);
|
||||||
ildaeilWidget->box.pos = Vec(2 * RACK_GRID_WIDTH, 0);
|
ildaeilWidget->box.pos = Vec(3 * RACK_GRID_WIDTH, 0);
|
||||||
ildaeilWidget->box.size = Vec(box.size.x - 2 * RACK_GRID_WIDTH, box.size.y);
|
ildaeilWidget->box.size = Vec(box.size.x - 6 * RACK_GRID_WIDTH, box.size.y);
|
||||||
addChild(ildaeilWidget);
|
addChild(ildaeilWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
addChild(createWidget<ScrewBlack>(Vec(0, 0)));
|
for (uint i=0; i<IldaeilModule::NUM_INPUTS; ++i)
|
||||||
addChild(createWidget<ScrewBlack>(Vec(0, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
|
createAndAddInput(i);
|
||||||
addChild(createWidget<ScrewBlack>(Vec(RACK_GRID_WIDTH, 0)));
|
|
||||||
addChild(createWidget<ScrewBlack>(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
|
|
||||||
|
|
||||||
addInput(createInput<PJ301MPort>(Vec(3, 54), module, IldaeilModule::INPUT1));
|
for (uint i=0; i<IldaeilModule::NUM_OUTPUTS; ++i)
|
||||||
addInput(createInput<PJ301MPort>(Vec(3, 54 + 30), module, IldaeilModule::INPUT2));
|
createAndAddOutput(i);
|
||||||
addOutput(createOutput<PJ301MPort>(Vec(3, 54 + 60), module, IldaeilModule::OUTPUT1));
|
|
||||||
addOutput(createOutput<PJ301MPort>(Vec(3, 54 + 90), module, IldaeilModule::OUTPUT2));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void draw(const DrawArgs& args) override
|
void draw(const DrawArgs& args) override
|
||||||
{
|
{
|
||||||
drawBackground(args.vg);
|
drawBackground(args.vg);
|
||||||
|
drawOutputJacksArea(args.vg, 2);
|
||||||
|
|
||||||
if (hasLeftSideExpander)
|
if (hasLeftSideExpander)
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,12 +25,13 @@
|
||||||
|
|
||||||
using namespace rack;
|
using namespace rack;
|
||||||
|
|
||||||
template<int startX_Out = 0>
|
template<int hp = 0>
|
||||||
struct ModuleWidgetWithSideScrews : ModuleWidget {
|
struct ModuleWidgetWithSideScrews : ModuleWidget {
|
||||||
static constexpr const float startX_In = 14.0f;
|
static constexpr const float startX_In = 10.65f;
|
||||||
|
static constexpr const float startX_Out = (hp - 3) * 15 + startX_In;
|
||||||
static constexpr const float startY = 74.0f;
|
static constexpr const float startY = 74.0f;
|
||||||
static constexpr const float padding = 29.0f;
|
static constexpr const float padding = 29.0f;
|
||||||
static constexpr const float middleX = startX_In + (startX_Out - startX_In) * 0.5f + padding * 0.35f;
|
static constexpr const float middleX = startX_In + (startX_Out - startX_In) * 0.5f /*+ padding * 0.35f*/;
|
||||||
|
|
||||||
void createAndAddInput(const uint paramId) {
|
void createAndAddInput(const uint paramId) {
|
||||||
createAndAddInput(paramId, paramId);
|
createAndAddInput(paramId, paramId);
|
||||||
|
@ -49,7 +50,7 @@ struct ModuleWidgetWithSideScrews : ModuleWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
void createAndAddScrews() {
|
void createAndAddScrews() {
|
||||||
if (box.size.x > RACK_GRID_WIDTH * 3) {
|
if (hp > 3) {
|
||||||
addChild(createWidget<ScrewBlack>(Vec(RACK_GRID_WIDTH, 0)));
|
addChild(createWidget<ScrewBlack>(Vec(RACK_GRID_WIDTH, 0)));
|
||||||
addChild(createWidget<ScrewBlack>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0)));
|
addChild(createWidget<ScrewBlack>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0)));
|
||||||
addChild(createWidget<ScrewBlack>(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
|
addChild(createWidget<ScrewBlack>(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
|
||||||
|
@ -81,18 +82,16 @@ struct ModuleWidgetWithSideScrews : ModuleWidget {
|
||||||
const float y = startY + posY * padding;
|
const float y = startY + posY * padding;
|
||||||
nvgBeginPath(vg);
|
nvgBeginPath(vg);
|
||||||
nvgFillColor(vg, color::WHITE);
|
nvgFillColor(vg, color::WHITE);
|
||||||
nvgText(vg, middleX, y + 16, text, nullptr);
|
nvgText(vg, box.size.x * 0.5f, y + 16, text, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupTextLines(NVGcontext* const vg) {
|
void setupTextLines(NVGcontext* const vg) {
|
||||||
nvgBeginPath(vg);
|
|
||||||
nvgRect(vg, startX_Out - 2.5f, startY - 2.0f, padding, padding);
|
|
||||||
nvgFontFaceId(vg, 0);
|
nvgFontFaceId(vg, 0);
|
||||||
nvgFontSize(vg, 11);
|
nvgFontSize(vg, 11);
|
||||||
nvgTextAlign(vg, NVG_ALIGN_CENTER);
|
nvgTextAlign(vg, NVG_ALIGN_CENTER);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef ModuleWidgetWithSideScrews<0> ModuleWidgetWith3HP;
|
typedef ModuleWidgetWithSideScrews<3> ModuleWidgetWith3HP;
|
||||||
typedef ModuleWidgetWithSideScrews<81> ModuleWidgetWith8HP;
|
typedef ModuleWidgetWithSideScrews<8> ModuleWidgetWith8HP;
|
||||||
typedef ModuleWidgetWithSideScrews<96> ModuleWidgetWith9HP;
|
typedef ModuleWidgetWithSideScrews<9> ModuleWidgetWith9HP;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue