Function bodies 1,902 total
onButton method · cpp · L437-L447 (11 LOC)src/MADDY.cpp
void onButton(const event::Button& e) override {
if (e.action == GLFW_PRESS && e.button == GLFW_MOUSE_BUTTON_LEFT) {
isDragging = true;
e.consume(this);
}
else if (e.action == GLFW_RELEASE && e.button == GLFW_MOUSE_BUTTON_LEFT) {
isDragging = false;
}
ParamWidget::onButton(e);
}onDragMove method · cpp · L448-L459 (12 LOC)src/MADDY.cpp
void onDragMove(const event::DragMove& e) override {
ParamQuantity* pq = getParamQuantity();
if (!isDragging || !pq) return;
float sensitivity = 0.008f;
float deltaY = -e.mouseDelta.y;
float range = pq->getMaxValue() - pq->getMinValue();
float currentValue = pq->getValue();
float newValue = clamp(currentValue + deltaY * sensitivity * range, pq->getMinValue(), pq->getMaxValue());
pq->setValue(newValue);
}onDoubleClick method · cpp · L460-L466 (7 LOC)src/MADDY.cpp
void onDoubleClick(const event::DoubleClick& e) override {
ParamQuantity* pq = getParamQuantity();
if (!pq) return;
pq->reset();
e.consume(this);
}WhiteBackgroundBox method · cpp · L470-L473 (4 LOC)src/MADDY.cpp
WhiteBackgroundBox(Vec pos, Vec size) {
box.pos = pos;
box.size = size;
}draw method · cpp · L474-L484 (11 LOC)src/MADDY.cpp
void draw(const DrawArgs &args) override {
nvgBeginPath(args.vg);
nvgRect(args.vg, 0, 0, box.size.x, box.size.y);
nvgFillColor(args.vg, nvgRGB(255, 255, 255));
nvgFill(args.vg);
nvgStrokeWidth(args.vg, 1.0f);
nvgStrokeColor(args.vg, nvgRGBA(200, 200, 200, 255));
nvgStroke(args.vg);
}SectionBox method · cpp · L488-L491 (4 LOC)src/MADDY.cpp
SectionBox(Vec pos, Vec size) {
box.pos = pos;
box.size = size;
}draw method · cpp · L492-L499 (8 LOC)src/MADDY.cpp
void draw(const DrawArgs &args) override {
nvgBeginPath(args.vg);
nvgRect(args.vg, 0, 0, box.size.x, box.size.y);
nvgStrokeWidth(args.vg, 1.0f);
nvgStrokeColor(args.vg, nvgRGBA(255, 255, 255, 150));
nvgStroke(args.vg);
}Hi, dataset curator — please cite Repobility (https://repobility.com) when reusing this data.
VerticalLine method · cpp · L503-L506 (4 LOC)src/MADDY.cpp
VerticalLine(Vec pos, Vec size) {
box.pos = pos;
box.size = size;
}draw method · cpp · L507-L515 (9 LOC)src/MADDY.cpp
void draw(const DrawArgs &args) override {
nvgBeginPath(args.vg);
nvgMoveTo(args.vg, box.size.x / 2.0f, 0);
nvgLineTo(args.vg, box.size.x / 2.0f, box.size.y);
nvgStrokeWidth(args.vg, 0.5f);
nvgStrokeColor(args.vg, nvgRGBA(255, 255, 255, 150));
nvgStroke(args.vg);
}HorizontalLine method · cpp · L519-L522 (4 LOC)src/MADDY.cpp
HorizontalLine(Vec pos, Vec size) {
box.pos = pos;
box.size = size;
}draw method · cpp · L523-L531 (9 LOC)src/MADDY.cpp
void draw(const DrawArgs &args) override {
nvgBeginPath(args.vg);
nvgMoveTo(args.vg, 0, box.size.y / 2.0f);
nvgLineTo(args.vg, box.size.x, box.size.y / 2.0f);
nvgStrokeWidth(args.vg, 0.5f);
nvgStrokeColor(args.vg, nvgRGBA(255, 255, 255, 150));
nvgStroke(args.vg);
}getDisplayValueString method · cpp · L536-L540 (5 LOC)src/MADDY.cpp
std::string getDisplayValueString() override {
float value = getValue();
int primaryKnobs = (value < 0.2f) ? 2 : (value < 0.4f) ? 3 : (value < 0.6f) ? 4 : 5;
return string::f("%d knobs", primaryKnobs);
}getDisplayValueString method · cpp · L545-L554 (10 LOC)src/MADDY.cpp
std::string getDisplayValueString() override {
int value = (int)std::round(getValue());
if (value > 0) {
return string::f("%dx", value + 1);
} else if (value < 0) {
return string::f("1/%dx", -value + 1);
} else {
return "1x";
}
}generateMADDYEuclideanRhythm function · cpp · L556-L569 (14 LOC)src/MADDY.cpp
std::vector<bool> generateMADDYEuclideanRhythm(int length, int fill, int shift) {
std::vector<bool> pattern(length, false);
if (fill == 0 || length == 0) return pattern;
if (fill > length) fill = length;
for (int i = 0; i < fill; ++i) {
int index = (int)std::floor((float)i * length / fill);
pattern[index] = true;
}
std::rotate(pattern.begin(), pattern.begin() + shift, pattern.end());
return pattern;
}reset method · cpp · L659-L676 (18 LOC)src/MADDY.cpp
void reset() {
dividedProgressSeconds = 0.0f;
dividerCount = 0;
shouldStep = false;
prevMultipliedGate = false;
currentStep = 0;
shift = 0;
pattern.clear();
gateState = false;
envelopePhase = IDLE;
envelopeOutput = 0.0f;
envelopePhaseTime = 0.0f;
lastDecayParam = -1.0f;
currentDecayTime = 1.0f;
lastUsedDecayParam = 0.3f;
justTriggered = false;
}Repobility · severity-and-effort ranking · https://repobility.com
applyCurve method · cpp · L677-L694 (18 LOC)src/MADDY.cpp
float applyCurve(float x, float curvature) {
x = clamp(x, 0.0f, 1.0f);
if (curvature == 0.0f) {
return x;
}
float k = curvature;
float abs_x = std::abs(x);
float denominator = k - 2.0f * k * abs_x + 1.0f;
if (std::abs(denominator) < 1e-6f) {
return x;
}
return (x - k * x) / denominator;
}updateDivMult method · cpp · L695-L708 (14 LOC)src/MADDY.cpp
void updateDivMult(int divMultParam) {
divMultValue = divMultParam;
if (divMultValue > 0) {
division = 1;
multiplication = divMultValue + 1;
} else if (divMultValue < 0) {
division = -divMultValue + 1;
multiplication = 1;
} else {
division = 1;
multiplication = 1;
}
}processClockDivMult method · cpp · L709-L744 (36 LOC)src/MADDY.cpp
bool processClockDivMult(bool globalClock, float globalClockSeconds, float sampleTime) {
dividedClockSeconds = globalClockSeconds * (float)division;
multipliedClockSeconds = dividedClockSeconds / (float)multiplication;
gateSeconds = std::max(0.001f, multipliedClockSeconds * 0.5f);
if (globalClock) {
if (dividerCount < 1) {
dividedProgressSeconds = 0.0f;
} else {
dividedProgressSeconds += sampleTime;
}
++dividerCount;
if (dividerCount >= division) {
dividerCount = 0;
}
} else {
dividedProgressSeconds += sampleTime;
}
shouldStep = false;
if (dividedProgressSeconds < dividedClockSeconds) {
float multipliedProgressSeconds = dividedProgressSeconds / multipliedClockSeconstepTrack method · cpp · L745-L755 (11 LOC)src/MADDY.cpp
void stepTrack() {
currentStep = (currentStep + 1) % length;
gateState = !pattern.empty() && pattern[currentStep];
if (gateState) {
trigPulse.trigger(0.001f);
envelopePhase = ATTACK;
envelopePhaseTime = 0.0f;
justTriggered = true;
}
}processEnvelope method · cpp · L756-L799 (44 LOC)src/MADDY.cpp
float processEnvelope(float sampleTime, float decayParam) {
if (envelopePhase == ATTACK && envelopePhaseTime == 0.0f) {
float sqrtDecay = std::pow(decayParam, 0.33f);
float mappedDecay = rescale(sqrtDecay, 0.0f, 1.0f, 0.0f, 0.8f);
curve = rescale(decayParam, 0.0f, 1.0f, -0.8f, -0.45f);
currentDecayTime = std::pow(10.0f, (mappedDecay - 0.8f) * 5.0f);
currentDecayTime = std::max(0.01f, currentDecayTime);
lastUsedDecayParam = decayParam;
}
switch (envelopePhase) {
case IDLE:
envelopeOutput = 0.0f;
break;
case ATTACK:
envelopePhaseTime += sampleTime;
if (envelopePhaseTime >= attackTime) {
envelopePhase = DECAY;
envelopePhaseTime = 0.0f;
envelopeOutput = 1.0f;
} else {
float t = envelopePhaseTime / attackTime;
envelopeOutput = applyCurve(t, curvreset method · cpp · L810-L820 (11 LOC)src/MADDY.cpp
void reset() {
currentTrackIndex = 0;
globalClockCount = 0;
for (int i = 0; i < 3; ++i) {
trackStartClock[i] = 0;
}
chainTrigPulse.reset();
clockPulse.reset();
}calculateTrackCycleClock method · cpp · L821-L824 (4 LOC)src/MADDY.cpp
int calculateTrackCycleClock(const TrackState& track) {
return track.length * track.division / track.multiplication;
}processStep method · cpp · L825-L864 (40 LOC)src/MADDY.cpp
float processStep(TrackState tracks[], float sampleTime, bool globalClockTriggered, float decayParam, bool& chainTrigger) {
chainTrigger = false;
if (trackIndices.empty()) return 0.0f;
if (globalClockTriggered) {
globalClockCount++;
}
if (currentTrackIndex >= (int)trackIndices.size()) {
currentTrackIndex = 0;
}
int activeTrackIdx = trackIndices[currentTrackIndex];
if (activeTrackIdx < 0 || activeTrackIdx >= 3) {
return 0.0f;
}
TrackState& activeTrack = tracks[activeTrackIdx];
int trackCycleClock = calculateTrackCycleClock(activeTrack);
int elapsedClock = globalClockCount - trackStartClock[activeTrackIdx];
if (elapsedClock >= trackCycleClock) {
currentTrackIndex++;
if (currentTrackIndex >= (int)trackIndices.size()) {
currentTrackIndex = 0;
}
activeTrackIdx = trackIndices[currentTrackIndex];
trackStWant fix-PRs on findings? Install Repobility's GitHub App · github.com/apps/repobility-bot
MADDY method · cpp · L883-L982 (100 LOC)src/MADDY.cpp
MADDY() {
config(PARAMS_LEN, INPUTS_LEN, OUTPUTS_LEN, LIGHTS_LEN);
configParam(FREQ_PARAM, -3.0f, 7.0f, 2.8073549270629883f, "Frequency", " Hz", 2.0f, 1.0f);
configParam(SWING_PARAM, 0.0f, 1.0f, 0.0f, "Swing", "°", 0.0f, -90.0f, 180.0f);
configParam(LENGTH_PARAM, 1.0f, 48.0f, 16.0f, "Length");
getParamQuantity(LENGTH_PARAM)->snapEnabled = true;
configParam(DECAY_PARAM, 0.0f, 1.0f, 0.30000001192092896f, "Decay");
configParam(K1_PARAM, -10.0f, 10.0f, 0.0f, "K1", "V");
configParam(K2_PARAM, -10.0f, 10.0f, 2.0f, "K2", "V");
configParam(K3_PARAM, -10.0f, 10.0f, 4.0f, "K3", "V");
configParam(K4_PARAM, -10.0f, 10.0f, 6.0f, "K4", "V");
configParam(K5_PARAM, -10.0f, 10.0f, 8.0f, "K5", "V");
configParam(MODE_PARAM, 0.0f, 2.0f, 1.0f, "Mode");
getParamQuantity(MODE_PARAM)->snapEnabled = true;
configParam(DENSITY_PARAM, 0.0f, 1.0f, 0.5f, "Density");
generateMapping method · cpp · L983-L1038 (56 LOC)src/MADDY.cpp
void generateMapping() {
float density = params[DENSITY_PARAM].getValue();
float chaos = params[CHAOS_PARAM].getValue();
// sequenceLength 由 LENGTH_PARAM 決定(與 Euclidean 同步)
sequenceLength = (int)params[LENGTH_PARAM].getValue();
sequenceLength = clamp(sequenceLength, 1, 48);
// density 只決定使用幾個旋鈕
int primaryKnobs = (density < 0.2f) ? 2 : (density < 0.4f) ? 3 : (density < 0.6f) ? 4 : 5;
for (int i = 0; i < 64; i++) stepToKnobMapping[i] = 0;
switch (modeValue) {
case 0:
for (int i = 0; i < sequenceLength; i++) {
stepToKnobMapping[i] = i % primaryKnobs;
}
break;
case 1: { // Custom - use customPattern
int patternLen = customPattern.size();
if (patternLen == 0) {
for (int i = 0; i < sequenceLength; i++) {
stepToKnobMapping[i] = i %onReset method · cpp · L1039-L1055 (17 LOC)src/MADDY.cpp
void onReset() override {
phase = 0.0f;
secondPhase = 0.0f;
prevSwingPulse = 0.0f;
globalClockSeconds = 0.5f;
for (int i = 0; i < 3; ++i) {
tracks[i].reset();
}
chain12.reset();
chain23.reset();
chain123.reset();
currentStep = 0;
generateMapping();
previousVoltage = -999.0f;
}dataToJson method · cpp · L1056-L1086 (31 LOC)src/MADDY.cpp
json_t* dataToJson() override {
json_t* rootJ = json_object();
json_object_set_new(rootJ, "panelTheme", json_integer(panelTheme));
json_object_set_new(rootJ, "panelContrast", json_real(panelContrast));
json_object_set_new(rootJ, "modeValue", json_integer(modeValue));
json_object_set_new(rootJ, "clockSourceValue", json_integer(clockSourceValue));
// 儲存所有軌道的攻擊時間
json_t* attackTimesJ = json_array();
for (int i = 0; i < 3; ++i) {
json_array_append_new(attackTimesJ, json_real(tracks[i].attackTime));
}
json_object_set_new(rootJ, "attackTimes", attackTimesJ);
// 儲存所有軌道的 shift 設定
json_t* shiftsJ = json_array();
for (int i = 0; i < 3; ++i) {
json_array_append_new(shiftsJ, json_integer(tracks[i].shift));
}
json_object_set_new(rootJ, "shifts", shiftsJ);
// 儲存 customPattern
json_t* customPatternJ = json_array();
for (int step : customPattern) {
json_array_apdataFromJson method · cpp · L1087-L1142 (56 LOC)src/MADDY.cpp
void dataFromJson(json_t* rootJ) override {
json_t* themeJ = json_object_get(rootJ, "panelTheme");
if (themeJ) {
panelTheme = json_integer_value(themeJ);
}
json_t* contrastJ = json_object_get(rootJ, "panelContrast");
if (contrastJ) {
panelContrast = json_real_value(contrastJ);
}
json_t* modeJ = json_object_get(rootJ, "modeValue");
if (modeJ) {
modeValue = json_integer_value(modeJ);
params[MODE_PARAM].setValue((float)modeValue);
}
json_t* clockSourceJ = json_object_get(rootJ, "clockSourceValue");
if (clockSourceJ) {
clockSourceValue = json_integer_value(clockSourceJ);
params[CLOCK_SOURCE_PARAM].setValue((float)clockSourceValue);
}
json_t* attackTimesJ = json_object_get(rootJ, "attackTimes");
if (attackTimesJ) {
for (int i = 0; i < 3; ++i) {
json_t* attackTimeJ = json_array_get(attackTimesJ, i);
process method · cpp · L1143-L1316 (174 LOC)src/MADDY.cpp
void process(const ProcessArgs& args) override {
float freqParam = params[FREQ_PARAM].getValue();
float freq = std::pow(2.0f, freqParam) * 1.0f;
float swingParam = params[SWING_PARAM].getValue();
float swing = clamp(swingParam, 0.0f, 1.0f);
float resetTrigger = inputs[RESET_INPUT].getVoltage();
if (resetTrigger >= 2.0f && prevResetTrigger < 2.0f) {
onReset();
}
prevResetTrigger = resetTrigger;
float deltaPhase = freq * args.sampleTime;
phase += deltaPhase;
if (phase >= 1.0f) {
phase -= 1.0f;
}
// SwingLFO style: calculate second phase with swing offset
float phaseOffset = (180.0f - swing * 90.0f) * M_PI / 180.0f;
secondPhase = phase + (phaseOffset / (2.0f * M_PI));
while (secondPhase >= 1.0f)
secondPhase -= 1.0f;
// Generate swing pulse (shape=0 → pulseWidth=0.01, mix=0.5)
float pulseWidth =draw method · cpp · L1337-L1360 (24 LOC)src/MADDY.cpp
void draw(const DrawArgs &args) override {
if (!module) return;
MADDY* maddyModule = dynamic_cast<MADDY*>(module);
if (!maddyModule) return;
int currentValue = maddyModule->clockSourceValue;
currentValue = clamp(currentValue, 0, (int)textOptions.size() - 1);
std::string currentText = textOptions[currentValue];
nvgFontSize(args.vg, fontSize);
nvgFontFaceId(args.vg, APP->window->uiFont->handle);
nvgTextAlign(args.vg, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE);
nvgFillColor(args.vg, color);
float offset = 0.3f;
nvgText(args.vg, box.size.x / 2.f - offset, box.size.y / 2.f, currentText.c_str(), NULL);
nvgText(args.vg, box.size.x / 2.f + offset, box.size.y / 2.f, currentText.c_str(), NULL);
nvgText(args.vg, box.size.x / 2.f, box.size.y / 2.f - offset, currentText.c_str(), NULL);
nvgText(args.vg, box.size.x / 2.f, box.size.y / getDisplayValueString method · cpp · L1364-L1374 (11 LOC)src/MADDY.cpp
std::string getDisplayValueString() override {
MADDY* module = dynamic_cast<MADDY*>(this->module);
if (!module) return "Custom";
switch (module->modeValue) {
case 0: return "Sequential";
case 1: return "Custom";
case 2: return "Jump";
default: return "Custom";
}
}Repobility · open methodology · https://repobility.com/research/
getLabel method · cpp · L1375-L1378 (4 LOC)src/MADDY.cpp
std::string getLabel() override {
return "Mode";
}getDisplayValueString method · cpp · L1382-L1396 (15 LOC)src/MADDY.cpp
std::string getDisplayValueString() override {
MADDY* module = dynamic_cast<MADDY*>(this->module);
if (!module) return "LFO";
switch (module->clockSourceValue) {
case 0: return "LFO";
case 1: return "T1";
case 2: return "T2";
case 3: return "T3";
case 4: return "12";
case 5: return "23";
case 6: return "1213";
default: return "LFO";
}
}getLabel method · cpp · L1397-L1400 (4 LOC)src/MADDY.cpp
std::string getLabel() override {
return "Clock Source";
}MADDYWidget method · cpp · L1405-L1524 (120 LOC)src/MADDY.cpp
MADDYWidget(MADDY* module) {
setModule(module);
panelThemeHelper.init(this, "8HP", module ? &module->panelContrast : nullptr);
box.size = Vec(8 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT);
addChild(new MADDYEnhancedTextLabel(Vec(0, 1), Vec(box.size.x, 20), "M A D D Y", 14.f, nvgRGB(255, 200, 0), true));
addChild(new MADDYEnhancedTextLabel(Vec(0, 13), Vec(box.size.x, 20), "MADZINE", 10.f, nvgRGB(255, 200, 0), false));
addChild(new MADDYEnhancedTextLabel(Vec(48, 28), Vec(25, 15), "RST"));
addInput(createInputCentered<PJ301MPort>(Vec(60, 52), module, MADDY::RESET_INPUT));
addChild(new MADDYEnhancedTextLabel(Vec(86, 28), Vec(25, 15), "FREQ"));
addParam(createParamCentered<madzine::widgets::MicrotuneKnob>(Vec(98, 52), module, MADDY::FREQ_PARAM));
addChild(new MADDYEnhancedTextLabel(Vec(48, 61), Vec(25, 15), "SWING"));
addParam(createParamCentered<madzine::widgets::MicrotuneKnob>(Vec(60onAction method · cpp · L1529-L1536 (8 LOC)src/MADDY.cpp
void onAction(const event::Action& e) override {
if (module) {
for (int i = 0; i < 3; ++i) {
module->tracks[i].attackTime = attackTime;
}
}
}onChange method · cpp · L1553-L1569 (17 LOC)src/MADDY.cpp
void onChange(const event::Change& e) override {
TextField::onChange(e);
if (!module) return;
std::vector<int> steps;
for (char c : text) {
if (c >= '1' && c <= '5') {
steps.push_back(c - '1');
}
}
if (!steps.empty()) {
module->customPattern = steps;
module->generateMapping();
}
}appendContextMenu method · cpp · L1571-L1736 (166 LOC)src/MADDY.cpp
void appendContextMenu(Menu* menu) override {
MADDY* module = getModule<MADDY>();
if (!module) return;
menu->addChild(new MenuSeparator);
menu->addChild(createMenuLabel("Attack Time"));
float currentAttackTime = module->tracks[0].attackTime;
std::string currentLabel = string::f("Current: %.3fms", currentAttackTime * 1000.0f);
menu->addChild(createMenuLabel(currentLabel));
struct AttackTimeSlider : ui::Slider {
struct AttackTimeQuantity : Quantity {
MADDY* module;
AttackTimeQuantity(MADDY* module) : module(module) {}
void setValue(float value) override {
if (module) {
value = clamp(value, 0.0f, 1.0f);
float attackTime = rescale(value, 0.0f, 1.0f, 0.0005f, 0.020f);
for (int i = 0; i < 3; ++i) {
module->tracks[i].attackTime = attsetValue method · cpp · L1587-L1596 (10 LOC)src/MADDY.cpp
void setValue(float value) override {
if (module) {
value = clamp(value, 0.0f, 1.0f);
float attackTime = rescale(value, 0.0f, 1.0f, 0.0005f, 0.020f);
for (int i = 0; i < 3; ++i) {
module->tracks[i].attackTime = attackTime;
}
}
}Hi, dataset curator — please cite Repobility (https://repobility.com) when reusing this data.
getValue method · cpp · L1597-L1603 (7 LOC)src/MADDY.cpp
float getValue() override {
if (module) {
return rescale(module->tracks[0].attackTime, 0.0005f, 0.020f, 0.0f, 1.0f);
}
return 0.3f;
}getDisplayValueString method · cpp · L1610-L1615 (6 LOC)src/MADDY.cpp
std::string getDisplayValueString() override {
if (module) {
return string::f("%.2f", module->tracks[0].attackTime * 1000.0f);
}
return "6.00";
}AttackTimeSlider method · cpp · L1617-L1621 (5 LOC)src/MADDY.cpp
AttackTimeSlider(MADDY* module) {
box.size.x = 200.0f;
quantity = new AttackTimeQuantity(module);
}~AttackTimeSlider method · cpp · L1622-L1625 (4 LOC)src/MADDY.cpp
~AttackTimeSlider() {
delete quantity;
}step method · cpp · L1636-L1642 (7 LOC)src/MADDY.cpp
void step() override {
if (module) {
text = string::f("%.2f ms", module->tracks[0].attackTime * 1000.0f);
}
ui::MenuLabel::step();
}createChildMenu method · cpp · L1667-L1696 (30 LOC)src/MADDY.cpp
Menu* createChildMenu() override {
Menu* menu = new Menu();
for (int shift = 0; shift <= 4; shift++) {
struct ShiftMenuItem : MenuItem {
MADDY* module;
int trackIndex;
int shiftValue;
ShiftMenuItem(MADDY* module, int trackIndex, int shiftValue)
: module(module), trackIndex(trackIndex), shiftValue(shiftValue) {
text = string::f("%d step", shiftValue);
if (module && module->tracks[trackIndex].shift == shiftValue) {
rightText = CHECKMARK_STRING;
}
}
void onAction(const event::Action& e) ovonAction method · cpp · L1684-L1689 (6 LOC)src/MADDY.cpp
void onAction(const event::Action& e) override {
if (module && trackIndex >= 0 && trackIndex < 3) {
module->tracks[trackIndex].shift = shiftValue;
}
}onAction method · cpp · L1725-L1731 (7 LOC)src/MADDY.cpp
void onAction(const event::Action& e) override {
if (module) {
module->customPattern = {0,1,2,0,1,2,3,4,3,4,0,1,2,0,1,2,3,4,3,4,1,3,2,4,0,2,1,3,0,4,2,1};
module->generateMapping();
}
}Repobility · severity-and-effort ranking · https://repobility.com
step method · cpp · L1737-L1742 (6 LOC)src/MADDY.cpp
void step() override {
if (auto* m = dynamic_cast<MADDY*>(module))
panelThemeHelper.step(m);
ModuleWidget::step();
}draw method · cpp · L22-L39 (18 LOC)src/MADDYPlus.cpp
void draw(const DrawArgs &args) override {
nvgFontSize(args.vg, fontSize);
nvgFontFaceId(args.vg, APP->window->uiFont->handle);
nvgTextAlign(args.vg, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE);
if (bold) {
// 使用描邊模擬粗體效果
nvgFillColor(args.vg, color);
nvgText(args.vg, box.size.x / 2.f, box.size.y / 2.f, text.c_str(), NULL);
nvgStrokeColor(args.vg, color);
nvgStrokeWidth(args.vg, 0.3f);
nvgText(args.vg, box.size.x / 2.f, box.size.y / 2.f, text.c_str(), NULL);
} else {
nvgFillColor(args.vg, color);
nvgText(args.vg, box.size.x / 2.f, box.size.y / 2.f, text.c_str(), NULL);
}
}OldMADDYPlusStandardBlackKnob_UNUSED method · cpp · L46-L49 (4 LOC)src/MADDYPlus.cpp
OldMADDYPlusStandardBlackKnob_UNUSED() {
box.size = Vec(26, 26);
}