Fake parameter change when clicking host parameter module

This commit is contained in:
falkTX 2021-12-09 20:23:26 +00:00
parent 75aad04bb8
commit 28d3ca2d68
4 changed files with 42 additions and 1 deletions

View file

@ -180,6 +180,21 @@ void CardinalPluginContext::removeIdleCallback(IdleCallback* const cb)
ui->removeIdleCallback(cb);
}
void handleHostParameterDrag(CardinalPluginContext* pcontext, uint index, bool started)
{
DISTRHO_SAFE_ASSERT_RETURN(pcontext->ui != nullptr,);
if (started)
{
pcontext->ui->editParameter(index, true);
pcontext->ui->setParameterValue(index, pcontext->parameters[index]);
}
else
{
pcontext->ui->editParameter(index, false);
}
}
// -----------------------------------------------------------------------------------------------------------
class CardinalUI : public CardinalBaseUI,

View file

@ -95,6 +95,10 @@ struct CardinalPluginContext : rack::Context {
#endif
};
#ifndef HEADLESS
void handleHostParameterDrag(CardinalPluginContext* pcontext, uint index, bool started);
#endif
// -----------------------------------------------------------------------------------------------------------
struct CardinalAudioDevice;