Beispiel #1
0
EHost IPlugVST::GetHost()
{
  EHost host = IPlugBase::GetHost();

  if (host == kHostUninit)
  {
    char productStr[256];
    productStr[0] = '\0';
    int version = 0;
    mHostCallback(&mAEffect, audioMasterGetProductString, 0, 0, productStr, 0.0f);

    if (CSTR_NOT_EMPTY(productStr))
    {
      int decVer = mHostCallback(&mAEffect, audioMasterGetVendorVersion, 0, 0, 0, 0.0f);
      int ver = decVer / 10000;
      int rmaj = (decVer - 10000 * ver) / 100;
      int rmin = (decVer - 10000 * ver - 100 * rmaj);
      version = (ver << 16) + (rmaj << 8) + rmin;
    }

    SetHost(productStr, version);
    host = IPlugBase::GetHost();
  }

  return host;
}
Beispiel #2
0
void IPlugVST::VSTPrepProcess(SAMPLETYPE** inputs, SAMPLETYPE** outputs, VstInt32 nFrames)
{
  if (DoesMIDI()) {
    mHostCallback(&mAEffect, __audioMasterWantMidiDeprecated, 0, 0, 0, 0.0f);
  }
  AttachInputBuffers(0, NInChannels(), inputs, nFrames);
  AttachOutputBuffers(0, NOutChannels(), outputs);
}
Beispiel #3
0
void IPlugVST::BeginDelayedInformHostOfParamChange(int idx)
{
  IMutexLock lock(this);

  if (idx != mParamChangeIdx) {
    EndDelayedInformHostOfParamChange();
    mHostCallback(&mAEffect, audioMasterBeginEdit, idx, 0, 0, 0.0f);
  }
}
Beispiel #4
0
bool IPlugVST::SendVSTEvent(VstEvent* pEvent)
{
  // It would be more efficient to bundle these and send at the end of a processed block,
  // but that would require writing OnBlockEnd and making sure it always gets called,
  // and who cares anyway, midi events aren't that dense.
  VstEvents events;
  memset(&events, 0, sizeof(VstEvents));
  events.numEvents = 1;
  events.events[0] = pEvent;
  return (mHostCallback(&mAEffect, audioMasterProcessEvents, 0, 0, &events, 0.0f) == 1);
}
Beispiel #5
0
void IPlugVST::InformHostOfParamChange(int idx, double normalizedValue)
{
  mHostCallback(&mAEffect, audioMasterAutomate, idx, 0, 0, (float) normalizedValue);
}
Beispiel #6
0
void IPlugVST::BeginInformHostOfParamChange(int idx)
{
  mHostCallback(&mAEffect, audioMasterBeginEdit, idx, 0, 0, 0.0f);
}
Beispiel #7
0
bool IPlugVST::IsRenderingOffline()
{
  return mHostCallback(&mAEffect, audioMasterGetCurrentProcessLevel, 0, 0, 0, 0.0f) == kVstProcessLevelOffline;
}
Beispiel #8
0
void IPlugVST::InformHostOfProgramChange()
{
  mHostCallback(&mAEffect, audioMasterUpdateDisplay, 0, 0, 0, 0.0f);
}