Browse Source

Cleanup; Separate ildaeil jacks

Signed-off-by: falkTX <falktx@falktx.com>
tags/22.02
falkTX 3 years ago
parent
commit
ee7ce3b8e2
5 changed files with 24 additions and 25 deletions
  1. +3
    -3
      plugins/Cardinal/src/Expanders.cpp
  2. +2
    -0
      plugins/Cardinal/src/HostAudio.cpp
  3. +1
    -1
      plugins/Cardinal/src/HostMIDI.cpp
  4. +9
    -11
      plugins/Cardinal/src/Ildaeil.cpp
  5. +9
    -10
      plugins/Cardinal/src/ModuleWidgets.hpp

+ 3
- 3
plugins/Cardinal/src/Expanders.cpp View File

@@ -53,11 +53,11 @@ struct CardinalExpanderForInputMIDI : CardinalExpanderFromCVToCarlaMIDI {
CardinalExpanderForInputMIDI() {
static_assert(NUM_INPUTS == kNumInputs, "Invalid input configuration");
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(VEL_INPUT, "Velocity");
configInput(AFT_INPUT, "Aftertouch");
configInput(PW_INPUT, "Pitch wheel");
configInput(PW_INPUT, "Pitchbend");
configInput(MW_INPUT, "Mod wheel");
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 * 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 * 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);

ModuleWidgetWithSideScrews::draw(args);


+ 2
- 0
plugins/Cardinal/src/HostAudio.cpp View File

@@ -224,6 +224,8 @@ struct HostAudioWidget : ModuleWidgetWith8HP {

if (numIO == 2)
{
// FIXME
const float middleX = box.size.x * 0.5f;
addParam(createParamCentered<NanoKnob>(Vec(middleX, 310.0f), m, 0));

HostAudioNanoMeter<numIO>* const meter = new HostAudioNanoMeter<numIO>(m);


+ 1
- 1
plugins/Cardinal/src/HostMIDI.cpp View File

@@ -705,7 +705,7 @@ struct HostMIDIWidget : ModuleWidgetWith9HP {
drawTextLine(args.vg, 2, "Velocity");
drawTextLine(args.vg, 3, "Aftertouch");
drawTextLine(args.vg, 4, "Pitchbend");
drawTextLine(args.vg, 5, "ModWheel");
drawTextLine(args.vg, 5, "Mod Wheel");
drawTextLine(args.vg, 6, "Start");
drawTextLine(args.vg, 7, "Stop");
drawTextLine(args.vg, 8, "Cont");


+ 9
- 11
plugins/Cardinal/src/Ildaeil.cpp View File

@@ -1520,7 +1520,7 @@ static void projectLoadedFromDSP(void* const ui)

// --------------------------------------------------------------------------------------------------------------------

struct IldaeilModuleWidget : ModuleWidgetWithSideScrews<> {
struct IldaeilModuleWidget : ModuleWidgetWithSideScrews<26> {
bool hasLeftSideExpander = false;
IldaeilWidget* ildaeilWidget = nullptr;

@@ -1528,29 +1528,27 @@ struct IldaeilModuleWidget : ModuleWidgetWithSideScrews<> {
{
setModule(module);
setPanel(APP->window->loadSvg(asset::plugin(pluginInstance, "res/Ildaeil.svg")));
createAndAddScrews();

if (module == nullptr || module->pcontext != nullptr)
{
ildaeilWidget = new IldaeilWidget(module);
ildaeilWidget->box.pos = Vec(2 * RACK_GRID_WIDTH, 0);
ildaeilWidget->box.size = Vec(box.size.x - 2 * RACK_GRID_WIDTH, box.size.y);
ildaeilWidget->box.pos = Vec(3 * RACK_GRID_WIDTH, 0);
ildaeilWidget->box.size = Vec(box.size.x - 6 * RACK_GRID_WIDTH, box.size.y);
addChild(ildaeilWidget);
}

addChild(createWidget<ScrewBlack>(Vec(0, 0)));
addChild(createWidget<ScrewBlack>(Vec(0, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
addChild(createWidget<ScrewBlack>(Vec(RACK_GRID_WIDTH, 0)));
addChild(createWidget<ScrewBlack>(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
for (uint i=0; i<IldaeilModule::NUM_INPUTS; ++i)
createAndAddInput(i);

addInput(createInput<PJ301MPort>(Vec(3, 54), module, IldaeilModule::INPUT1));
addInput(createInput<PJ301MPort>(Vec(3, 54 + 30), module, IldaeilModule::INPUT2));
addOutput(createOutput<PJ301MPort>(Vec(3, 54 + 60), module, IldaeilModule::OUTPUT1));
addOutput(createOutput<PJ301MPort>(Vec(3, 54 + 90), module, IldaeilModule::OUTPUT2));
for (uint i=0; i<IldaeilModule::NUM_OUTPUTS; ++i)
createAndAddOutput(i);
}

void draw(const DrawArgs& args) override
{
drawBackground(args.vg);
drawOutputJacksArea(args.vg, 2);

if (hasLeftSideExpander)
{


+ 9
- 10
plugins/Cardinal/src/ModuleWidgets.hpp View File

@@ -25,12 +25,13 @@

using namespace rack;

template<int startX_Out = 0>
template<int hp = 0>
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 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) {
createAndAddInput(paramId, paramId);
@@ -49,7 +50,7 @@ struct ModuleWidgetWithSideScrews : ModuleWidget {
}

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(box.size.x - 2 * RACK_GRID_WIDTH, 0)));
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;
nvgBeginPath(vg);
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) {
nvgBeginPath(vg);
nvgRect(vg, startX_Out - 2.5f, startY - 2.0f, padding, padding);
nvgFontFaceId(vg, 0);
nvgFontSize(vg, 11);
nvgTextAlign(vg, NVG_ALIGN_CENTER);
}
};

typedef ModuleWidgetWithSideScrews<0> ModuleWidgetWith3HP;
typedef ModuleWidgetWithSideScrews<81> ModuleWidgetWith8HP;
typedef ModuleWidgetWithSideScrews<96> ModuleWidgetWith9HP;
typedef ModuleWidgetWithSideScrews<3> ModuleWidgetWith3HP;
typedef ModuleWidgetWithSideScrews<8> ModuleWidgetWith8HP;
typedef ModuleWidgetWithSideScrews<9> ModuleWidgetWith9HP;

Loading…
Cancel
Save