Hi, I’ll be very thankful if anyone can help me.
In my plugin, I’m calculating the envelope of the inputs. And I want the user to be able to visualize the envelope, the input, and the output of the plugin in a meter (I’m using IVMeterControl). I’ve created the input and output meters with IPeakSender, and I’m trying to create the envelope meter with IBufferSender. However, I’m having trouble writing the input parameter of ProcessBlock() for the IBufferSender.
Please tell me what I’m doing wrong or if there’s a better way to create a meter for a value that is calculated while processing the audio:
void MyPlugin::OnIdle()
{
mMeterInSender.TransmitData(*this);
mMeterOutSender.TransmitData(*this);
mMeterEnvSender.TransmitData(*this);
}
void MyPlugin::ProcessBlock(sample * *inputs, sample * *outputs, int nFrames
{
sample\*\* senv; //Initializing sample for the envelope data
for (int s = 0; s < nFrames; s++) {
env= XXXXXX; //calculate envelope
senv[0][s] = env; //update senv with envelope value
outputs[0][s] =XXX; //update outputs
outputs[1][s] = XXX;
}
mMeterInSender.ProcessBlock(inputs, nFrames, kMeterIn);
mMeterEnvSender.ProcessBlock(senv, nFrames, kMeterEnv);
mMeterOutSender.ProcessBlock(outputs, nFrames, kMeterOut);
}
And in my header file:
private:
IPeakSender<1> mMeterInSender;
IPeakSender<1> mMeterOutSender;
IBufferSender<1> mMeterEnvSender;
I can tell that I’m initializing sample** senv wrong but I can’t tell how to do it right.
I’m sorry if it’s a noob question but I’ve been looking through the forums and googling a lot and I just can’t figure it out. I get kinda confused around pointers…
Thanks!