26#include "IPlugStructs.h"
28#include "NChanDelay.h"
52#pragma mark - Methods you implement in your plug-in class - you do not call these methods
62 virtual void ProcessBlock(sample** inputs, sample** outputs,
int nFrames);
83#pragma mark - Methods you can call - some of which have custom implementations in the API classes, some implemented in IPlugProcessor.cpp
145 virtual void GetBusName(
ERoute direction,
int busIdx,
int nBuses, WDL_String& str)
const;
160 int MaxNBuses(
ERoute direction,
int* pConfigIdxWithTheMostBuses =
nullptr)
const;
180 bool IsChannelConnected(
ERoute direction,
int chIdx)
const {
return (chIdx < mChannelData[direction].GetSize() && mChannelData[direction].Get(chIdx)->mConnected); }
198 bool LegalIO(
int NInputChans,
int NOutputChans)
const;
207 bool IsInstrument()
const {
return mPlugType == EIPlugPluginType::kInstrument; }
210 bool IsMidiEffect()
const {
return mPlugType == EIPlugPluginType::kMIDIEffect; }
254 static int ParseChannelIOStr(
const char* IOStr, WDL_PtrList<IOConfig>& channelIOList,
int& totalNInChans,
int& totalNOutChans,
int& totalNInBuses,
int& totalNOutBuses);
257#pragma mark - Methods called by the API class - you do not call these methods in your plug-in class
258 void SetChannelConnections(
ERoute direction,
int idx,
int n,
bool connected);
259 void InitLatencyDelay();
263 void AttachBuffers(
ERoute direction,
int idx,
int n, PLUG_SAMPLE_DST** ppData,
int nFrames);
264 void AttachBuffers(
ERoute direction,
int idx,
int n, PLUG_SAMPLE_SRC** ppData,
int nFrames);
265 void PassThroughBuffers(PLUG_SAMPLE_SRC type,
int nFrames);
266 void PassThroughBuffers(PLUG_SAMPLE_DST type,
int nFrames);
267 void ProcessBuffers(PLUG_SAMPLE_SRC type,
int nFrames);
268 void ProcessBuffers(PLUG_SAMPLE_DST type,
int nFrames);
269 void ProcessBuffersAccumulating(
int nFrames);
270 void ZeroScratchBuffers();
271 void SetSampleRate(
double sampleRate) { mSampleRate = sampleRate; }
272 void SetBlockSize(
int blockSize);
273 void SetBypassed(
bool bypassed) { mBypassed = bypassed; }
275 void SetRenderingOffline(
bool renderingOffline) { mRenderingOffline = renderingOffline; }
276 const WDL_String& GetChannelLabel(
ERoute direction,
int idx) {
return mChannelData[direction].Get(idx)->mLabel; }
280 EIPlugPluginType mPlugType;
290 double mSampleRate = DEFAULT_SAMPLE_RATE;
296 bool mBypassed =
false;
298 bool mRenderingOffline =
false;
300 WDL_PtrList<IOConfig> mIOConfigs;
302 WDL_TypedBuf<sample*> mScratchData[2];
304 WDL_PtrList<IChannelData<>> mChannelData[2];
306 std::unique_ptr<NChanDelayLine<sample>> mLatencyDelay =
nullptr;
IPlug Constant definitions, Types, magic numbers.
Utility functions and macros.
The base class for IPlug Audio Processing.
virtual bool SendMidiMsgs(WDL_TypedBuf< IMidiMsg > &msgs)
Send a collection of MIDI messages // TODO: info about what thread should this be called on or not ca...
const IOConfig * GetIOConfig(int idx) const
void SetTailSize(int tailSize)
Call this method if you need to update the tail size at runtime, for example if the decay time of you...
virtual bool SendSysEx(const ISysEx &msg)
Send a single MIDI System Exclusive (SysEx) message // TODO: info about what thread should this be ca...
bool GetTransportIsRunning() const
double GetSamplePos() const
virtual void ProcessMidiMsg(const IMidiMsg &msg)
Override this method to handle incoming MIDI messages.
bool LegalIO(int NInputChans, int NOutputChans) const
Check if a certain configuration of input channels and output channels is allowed based on the channe...
int NOutChansConnected() const
Convenience method to find out how many output channels are connected.
bool HasSidechainInput() const
virtual void GetBusName(ERoute direction, int busIdx, int nBuses, WDL_String &str) const
Get the name for a particular bus.
virtual void SetLatency(int latency)
Call this if the latency of your plug-in changes after initialization (perhaps from OnReset() ) This ...
bool IsMidiEffect() const
bool IsInstrument() const
int MaxNBuses(ERoute direction, int *pConfigIdxWithTheMostBuses=nullptr) const
Used to determine the maximum number of input or output buses based on what was specified in the chan...
virtual bool SendMidiMsg(const IMidiMsg &msg)=0
Send a single MIDI message // TODO: info about what thread should this be called on or not called on!
bool GetRenderingOffline() const
void SetChannelLabel(ERoute direction, int idx, const char *formatStr, bool zeroBased=false)
This allows you to label input/output channels in supporting VST2 hosts.
int GetAUPluginType() const
int NChannelsConnected(ERoute direction) const
double GetSampleRate() const
bool IsChannelConnected(ERoute direction, int chIdx) const
int GetIOConfigWithChanCounts(std::vector< int > &inputBuses, std::vector< int > &outputBuses)
int MaxNChannelsForBus(ERoute direction, int busIdx) const
For a given input or output bus what is the maximum possible number of channels.
ITimeInfo mTimeInfo
Contains detailed information about the transport state.
bool HasWildcardBus(ERoute direction) const
Check if we have any wildcard characters in the channel I/O configs.
int NInChansConnected() const
Convenience method to find out how many input channels are connected.
int MaxNChannels(ERoute direction) const
void LimitToStereoIO()
This is called by IPlugVST in order to limit a plug-in to stereo I/O for certain picky hosts.
void GetTimeSig(int &numerator, int &denominator) const
virtual void ProcessSysEx(ISysEx &msg)
Override this method to handle incoming MIDI System Exclusive (SysEx) messages.
virtual void OnActivate(bool active)
Override OnActivate() which should be called by the API class when a plug-in is "switched on" by the ...
static int ParseChannelIOStr(const char *IOStr, WDL_PtrList< IOConfig > &channelIOList, int &totalNInChans, int &totalNOutChans, int &totalNInBuses, int &totalNOutBuses)
A static method to parse the config.h channel I/O string.
virtual void OnReset()
Override this method in your plug-in class to do something prior to playback etc.
virtual void ProcessBlock(sample **inputs, sample **outputs, int nFrames)
Override in your plug-in class to process audio In ProcessBlock you are always guaranteed to get vali...
double GetSamplesPerBeat() const
ERoute
Used to identify whether a bus/channel connection is an input or an output.
Encapsulates information about the host transport state.
Encapsulates a MIDI message and provides helper functions.
An IOConfig is used to store bus info for each input/output configuration defined in the channel io s...
A struct for dealing with SysEx messages.