Hi,
I’m trying to implement a message system from my process block to my custom control class. So far working from the example IPlug Controls project etc I have the following code:
MyPlugin.h
class MyPlugin final : public Plugin
{
public:
MyPlugin(const InstanceInfo& info);#if IPLUG_DSP // Distributed Plugins · iPlug2/iPlug2 Wiki · GitHub
void ProcessBlock(sample** inputs, sample** outputs, int nFrames) override;
void OnIdle() override;private:
IBufferSender<2> mSender;
#endif
};
MyPlugin.cpp
#if IPLUG_DSP
void MyPlugin::ProcessBlock(sample** inputs, sample** outputs, int nFrames)
{
const double gain = GetParam(pGainIn)->Value() / 100.;
const int nChans = NOutChansConnected();mSender.ProcessBlock(outputs, nFrames, pScope, 2);
for (int s = 0; s < nFrames; s++) {
for (int c = 0; c < nChans; c++) {
outputs[c][s] = inputs[c][s] * gain;
}
}
}void Saturator::OnIdle()
{
mSender.TransmitData(*this);
}
#endif
My Control Class
class MyControlClass: public IControl, public IVectorBase
{public:
MyControlClass(const IRECT& bounds, int paramIdx)
: IControl(bounds, paramIdx)
, IVectorBase(false, false)
{
}void OnMsgFromDelegate(int msgTag, int dataSize, const void* pData) override
{}
private:
ISenderData<2, std::array<float, 128>> mBuf;};
Even though I’ve not got as far as doing anything with the sent data, my plugin is already crashing, and giving the following error:
Assertion Error
Program: MyPlugin.vst3\Contents\x86… Line 90
Expression: pControl
I can’t for the life of me work out where I might have gone wrong?
Thanks,
James