Rack development blog

New Module helper methods in Rack 2 and how to use them:

TSwitchQuantity* configSwitch(int paramId, float minValue, float maxValue,
    float defaultValue, std::string name = "",
    std::vector<std::string> labels = {});
TSwitchQuantity* configButton(int paramId, std::string name = "");
TPortInfo* configInput(int portId, std::string name = "");
TPortInfo* configOutput(int portId, std::string name = "");
TLightInfo* configLight(int lightId, std::string name = "");
void configBypass(int inputId, int outputId);

// Examples:

// Switches and buttons are just Params
configSwitch(POLAR_SWITCH, 0, 2, 0, "Polar mode",
    {"Unipolar", "Bipolar", "Inverse unipolar"});
configButton(TRIG_BUTTON, "Trigger");

// Tooltip text on mouse hover
configInput(AUDIO_INPUT, "Audio");
configOutput(MIX_OUTPUT, "Mix");
configLight(GATE_LIGHT, "Gate");

// Short circuit outputs to inputs when bypassed
configBypass(LEFT_INPUT, LEFT_OUTPUT);
configBypass(RIGHT_INPUT, RIGHT_OUTPUT);
28 Likes