fix sync delay

This commit is contained in:
Armin 2026-08-15 13:54:42 +02:00
commit 2e85d45983
4 changed files with 35 additions and 3 deletions

View file

@ -57,6 +57,22 @@ public:
panKnob.setValueTextFunction ([] (double v) { return juce::String (juce::roundToInt (v * 100.0)) + "%"; });
onToggle.setInverted (true);
syncToggle.onClick = [this]
{
if (syncToggle.getToggleState())
return;
const int index = juce::roundToInt (proc.apvts.getRawParameterValue (ParameterIDs::timeSync)->load());
const float ms = mindball::DelayEngine::syncTimeMs (index, proc.getCurrentBpm());
if (auto* timeParam = proc.apvts.getParameter (ParameterIDs::time))
{
timeParam->beginChangeGesture();
timeParam->setValueNotifyingHost (timeParam->convertTo0to1 (juce::roundToInt (ms)));
timeParam->endChangeGesture();
}
};
buildInfo.setJustificationType (juce::Justification::centredRight);
buildInfo.setFont (juce::Font (juce::Font::getDefaultMonospacedFontName(), 9.0f, 0));