Browse Source

Add update rate to menu

pull/46/head
hemmer 1 year ago
parent
commit
d0a2dffbb9
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      src/MidiThing.cpp

+ 5
- 2
src/MidiThing.cpp View File

@@ -239,7 +239,7 @@ struct MidiThing : Module {

// debug only
bool setFrame = true;
int numActiveChannels = 0;
dsp::BooleanTrigger buttonTrigger;
dsp::Timer rateLimiterTimer;
PORTMODE_t portModes[NUM_INPUTS] = {};
@@ -283,7 +283,7 @@ struct MidiThing : Module {
activeChannels.push_back(c);
}
}
const int numActiveChannels = activeChannels.size();
numActiveChannels = activeChannels.size();
// we're done if no channels are active
if (numActiveChannels == 0) {
return;
@@ -769,6 +769,9 @@ struct MidiThingWidget : ModuleWidget {
&module->updateRateIdx));

menu->addChild(createBoolPtrMenuItem("Set frame", "", &module->setFrame));

float updateRate = module->updateRates[module->updateRateIdx] / module->numActiveChannels;
menu->addChild(createMenuLabel(string::f("Midi Update rate: %.3g Hz", updateRate)));
}
};



Loading…
Cancel
Save