mirror of
https://codeberg.org/armin/mindball.git
synced 2026-09-01 03:40:49 +02:00
fix sync delay
This commit is contained in:
parent
482d5c3cbd
commit
2e85d45983
4 changed files with 35 additions and 3 deletions
|
|
@ -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));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue