Web-based UI in a VST
The code at iPlug2/iPlug2/Examples/IPlugWebUI is self-expanatory, you can just check it out, install the dependencies and build it! Here are a couple key takeaways:
An excerpt of the constructor:
IPlugWebUI::IPlugWebUI(const InstanceInfo& info)
: Plugin(info, MakeConfig(kNumParams, kNumPresets))
{
GetParam(kGain)->InitGain("Gain", -70., -70, 0.);
SetEnableDevTools(true);
mEditorInitFunc = [&]() {
LoadFile("index.html", GetBundleID());
EnableScroll(false);
};
MakePreset("One", -70.);
MakePreset("Two", -30.);
MakePreset("Three", 0.);
}
languagecppOn the Javascript side, this is a function for sending a param change event to the plug-in’s backend:
function SPVFUI(paramIdx, value) {
var message = {
"msg": "SPVFUI",
"paramIdx": paramIdx,
"value": value
};
IPlugSendMsg(message);
}
languagejavascript