Client

Plugin interface, from the client point of view. This client has no knowledge of thread-safety, it must be handled externally. User plugins derivate from this class. Plugin formats wrappers owns one dplug.plugin.Client as a member.

class Client {
protected nothrow @nogc
IGraphics _graphics;
protected nothrow @nogc
shared(bool) _graphicsIsAvailable;
protected nothrow @nogc
IHostCommand _hostCommand;
protected nothrow @nogc
PluginInfo _info;
}

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Aliases

getPluginVersion
alias getPluginVersion = getPublicVersion

Functions

buildLegalIO
LegalIO[] buildLegalIO()

Override this method to tell which I/O are legal. The returned slice must be allocated with malloc/mallocSlice.

buildParameters
Parameter[] buildParameters()

Override this method to implement parameter creation. This is an optional overload, default implementation declare no parameters. The returned slice must be allocated with malloc/mallocSlice and contains Parameter objects created with mallocEmplace.

buildPluginInfo
PluginInfo buildPluginInfo()

Override this method to tell what plugin you are. Mandatory override, fill the fields with care.

buildPresets
Preset[] buildPresets()

Override this methods to load/fill presets. This function must return a slice allocated with malloc, that contains presets crteated with mallocEmplace.

closeGUI
void closeGUI()
createGraphics
IGraphics createGraphics()

Override if you create a plugin with UI. The returned IGraphics must be allocated with mallocEmplace.

enqueueMIDIFromHost
void enqueueMIDIFromHost(MidiMessage message)

For plugin format clients only. Enqueues an incoming MIDI message.

getNextMidiMessages
const(MidiMessage)[] getNextMidiMessages(int frames)

Should only be called in processAudio. This return a slice of MIDI messages corresponding to the next frames samples. Useful if you don't want to process messages every samples, or every split buffer.

getPluginFullName
void getPluginFullName(char* p, int bufLength)
getPluginUniqueID
char[4] getPluginUniqueID()
graphicsAcquire
IGraphics graphicsAcquire()

Getter for the IGraphics interface This is intended for the audio thread and has acquire semantics. Not reentrant! You can't call this twice without a graphicsRelease first.

graphicsRelease
void graphicsRelease()

Mirror function to release the IGraphics from the audio-thread. Do not call if graphicsAcquire() returned null.

isLegalIO
bool isLegalIO(int numInputChannels, int numOutputChannels)
isValidInputIndex
bool isValidInputIndex(int index)
isValidOutputIndex
bool isValidOutputIndex(int index)
isValidParamIndex
bool isValidParamIndex(int index)
latencySamples
int latencySamples(double sampleRate)

Override to set the plugin latency in samples. Plugin latency can depend on sampleRate but no other value. If you want your latency to depend on a Parameter your only choice is to pessimize the needed latency and compensate in the process callback.

legalIOs
LegalIO[] legalIOs()
makeDefaultPreset
Preset makeDefaultPreset()

Returns a new default preset.

maxFramesInProcess
int maxFramesInProcess()

Override to declare the maximum number of samples to accept If greater, the audio buffers will be splitted up. This splitting have several benefits: - help allocating temporary audio buffers on the stack - keeps memory usage low and reuse it - allow faster-than-buffer-size parameter changes

param
inout(Parameter) param(int index)
params
inout(Parameter[]) params()
presetBank
PresetBank presetBank()
processAudio
void processAudio(const(float*)[] inputs, float*[] outputs, int frames, TimeInfo timeInfo)

Process some audio. Override to make some noise. In processAudio you are always guaranteed to get valid pointers to all the channels the plugin requested. Unconnected input pins are zeroed. This callback is the only place you may call getNextMidiMessages() (it is even required for plugins receiving MIDI).

processAudioFromHost
void processAudioFromHost(float*[] inputs, float*[] outputs, int frames, TimeInfo timeInfo)

For plugin format clients only. Calls processAudio repeatedly, splitting the buffers. Splitting allow to decouple memory requirements from the actual host buffer size. There is few performance penalty above 512 samples.

readBoolParamValue
bool readBoolParamValue(int paramIndex)

Boilerplate function to get the value of a BoolParameter,for use in processAudio.

readFloatParamValue
float readFloatParamValue(int paramIndex)

Boilerplate function to get the value of a FloatParameter, for use in processAudio.

readIntegerParamValue
int readIntegerParamValue(int paramIndex)

Boilerplate function to get the value of an IntParameter, for use in processAudio.

reset
void reset(double sampleRate, int maxFrames, int numInputs, int numOutputs)

Override to clear state (eg: resize and clear delay lines) and allocate buffers. Important: This will be called by the audio thread. So you should not use the GC in this callback.

resetFromHost
void resetFromHost(double sampleRate, int maxFrames, int numInputs, int numOutputs)

For plugin format clients only. Calls reset(). Must be called by the audio thread.

setHostCommand
void setHostCommand(IHostCommand hostCommand)

For plugin format clients only.

tailSizeInSeconds
float tailSizeInSeconds()

Override to set the plugin tail length in seconds. This is the amount of time before silence is reached with a silent input.

Meta