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.

Note: this is an architecture failure since there are 3 users of that interface: 1. the plugin "client" implementation (= product), 2. the format client 3. the UI, directly Those should be splitted cleanly.

class Client : IClient {}

Constructors

this
this()
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

AAXBundleIdentifier
string AAXBundleIdentifier()
Undocumented in source. Be warned that the author may not have intended to support it.
AUBundleIdentifier
string AUBundleIdentifier()
Undocumented in source. Be warned that the author may not have intended to support it.
CLAPIdentifier
string CLAPIdentifier()
Undocumented in source. Be warned that the author may not have intended to support it.
CLAPIdentifierFactory
string CLAPIdentifierFactory()
Undocumented in source. Be warned that the author may not have intended to support it.
VSTBundleIdentifier
string VSTBundleIdentifier()
Undocumented in source. Be warned that the author may not have intended to support it.
accumulateOutputMIDI
void accumulateOutputMIDI(int frames)

For VST3 client only. Format clients that split the buffers themselves (for automation precision) Need as well to accumulate MIDI output themselves.

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. Note: this should not be called by a plugin client implementation directly. Access the content of PluginInfo through the various accessors.

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.

clearAccumulatedOutputMidiMessages
void clearAccumulatedOutputMidiMessages()

For plugin format clients only. Clear MIDI output buffer. Call it before processAudioFromHost or accumulateOutputMIDI. What it also does it get all MIDI message from the UI, and add them to the priority queue, so that they may be accumulated like normal MIDI sent from the process callback.

closeGUI
void closeGUI()

Close the plugin UI if one was opened. Note: OBS Studio will happily call effEditClose without having called effEditOpen. Only allowed for client implementation.

createGraphics
IGraphics createGraphics()

Override if you create a plugin with UI. The returned IGraphics must be allocated with mallocNew. plugin.json needs to have a "hasGUI" key equal to true, else this callback is never called.

defaultStateData
const(ubyte)[] defaultStateData()

Return default state data, to be used in constructing a programmatic preset. Note: It is recommended to use .fbx instead of constructing presets with code. This is intended to be used in buildPresets callback.

enqueueMIDIFromHost
void enqueueMIDIFromHost(MidiMessage message)

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

getAccumulatedOutputMidiMessages
const(MidiMessage)[] getAccumulatedOutputMidiMessages()

For plugin format clients only. This return a slice of MIDI messages to be sent for this (whole unsplit) buffer. Internally, you need to either use split-buffering from this file, or if the format does its own buffer split it needs to call accumulateOutputMIDI itself.

getBufferSplitMaxFrames
int getBufferSplitMaxFrames()

For use by plugin format clients. This gives the buffer split size to use. (0 == no split). This is useful in the cast the format client wants to split buffers by itself.

getDAW
DAW getDAW()
Undocumented in source. Be warned that the author may not have intended to support it.
getDesiredGUISize
bool getDesiredGUISize(int* widthLogicalPixels, int* heightLogicalPixels)

Only allowed for client implementation. This is helpful for some hosts, like OBS and Cubase, but not others like FL Studio.

getGUISize
bool getGUISize(int* widthLogicalPixels, int* heightLogicalPixels)

Only allowed for client implementation.

getGraphics
IGraphics getGraphics()

This creates the GUIGraphics object lazily, and return it without synchronization. Only allowed for client implementation.

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.

getPluginFormat
PluginFormat getPluginFormat()
Undocumented in source. Be warned that the author may not have intended to support it.
getPluginFullName
void getPluginFullName(char* p, int bufLength)
getPluginName
void getPluginName(char* p, int bufLength)
getPluginUniqueID
char[4] getPluginUniqueID()
getPublicVersion
PluginVersion getPublicVersion()
getVendorSupportEmail
string getVendorSupportEmail()
Undocumented in source. Be warned that the author may not have intended to support it.
getVendorUniqueID
char[4] getVendorUniqueID()
Undocumented in source. Be warned that the author may not have intended to support it.
graphicsAcquire
IGraphics graphicsAcquire()

Getter for the IGraphics interface This is intended ONLY for the audio thread inside processing and has acquire semantics. Not reentrant! You can't call this twice without a graphicsRelease first. THIS CAN RETURN NULL EVEN AFTER HAVING RETURNED NON-NULL AT ONE POINT.

graphicsRelease
void graphicsRelease()

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

hasGUI
bool hasGUI()
Undocumented in source. Be warned that the author may not have intended to support it.
hostCommand
IHostCommand hostCommand()
Undocumented in source. Be warned that the author may not have intended to support it.
isLegalIO
bool isLegalIO(int numInputChannels, int numOutputChannels)
isSynth
bool isSynth()
Undocumented in source. Be warned that the author may not have intended to support it.
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()
loadState
bool loadState(const(ubyte)[] chunk)

Read the extra state of your plugin from a chunk, to restore a former save. You would typically deserialize arbitrary stuff with dplug.core.binrange.

makeDefaultPreset
Preset makeDefaultPreset()

Returns a new default preset. This is intended to be used in buildPresets callback.

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 (VST3)

maxInputs
int maxInputs()
Undocumented in source. Be warned that the author may not have intended to support it.
maxOutputs
int maxOutputs()
Undocumented in source. Be warned that the author may not have intended to support it.
notifyResized
bool notifyResized()
Undocumented in source. Be warned that the author may not have intended to support it.
openGUI
void* openGUI(void* parentInfo, void* controlInfo, GraphicsBackend backend)

Note: openGUI, getGUISize, getGraphics and closeGUI are guaranteed synchronized by the client implementation Only allowed for client implementation.

param
inout(Parameter) param(int index)
params
inout(Parameter[]) params()
pluginCategory
PluginCategory pluginCategory()
Undocumented in source. Be warned that the author may not have intended to support it.
pluginHomepage
string pluginHomepage()
Undocumented in source. Be warned that the author may not have intended to support it.
pluginName
string pluginName()
Undocumented in source. Be warned that the author may not have intended to support it.
presetBank
PresetBank presetBank()
processAudio
void processAudio(const(float*)[] inputs, float*[] outputs, int frames, TimeInfo timeInfo)

Process frames audio frames.

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

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. TODO: unclear when using this if inputs.ptr can/should be null in case of zero channels...

readParam
T readParam(int paramIndex)

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

readParam
T readParam(int paramIndex)

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

readParam
T readParam(int paramIndex)

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

readParam
T readParam(int paramIndex)

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

receivesMIDI
bool receivesMIDI()
Undocumented in source. Be warned that the author may not have intended to support it.
requestResize
bool requestResize(int widthLogicalPixels, int heightLogicalPixels)
Undocumented in source. Be warned that the author may not have intended to support it.
reset
void reset(double sampleRate, int maxFrames, int numInputs, int numOutputs)

Override to clear state (eg: resize and clear delay lines) and allocate buffers. Note: reset should not be called directly by plug-in format implementations. Use resetFromHost if you write a new plug-in format client.

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.

saveState
void saveState(Vec!ubyte chunk)

Write the extra state of plugin in a chunk, so that the host can restore that later. You would typically serialize arbitrary stuff with dplug.core.binrange. This is called quite frequently.

sendMIDIMessage
void sendMIDIMessage(MidiMessage message)

Intended from inside the audio thread, in process. Enqueue one MIDI message on the output MIDI priority queue, so that it is eventually sent. Its offset is relative to the current buffer, and you can send messages arbitrarily in the future too.

sendMIDIMessagesFromUI
void sendMIDIMessagesFromUI(const(MidiMessage)[] messages)

Send MIDI from inside the UI. Intended to be called from inside an UI event callback.

sendsMIDI
bool sendsMIDI()
Undocumented in source. Be warned that the author may not have intended to support it.
setHostCommand
void setHostCommand(IHostCommand hostCommand)

For plugin format clients only.

setParameterFromHost
void setParameterFromHost(int index, float value)
Undocumented in source. Be warned that the author may not have intended to support it.
tailSizeInSeconds
float tailSizeInSeconds()

Override to set the plugin tail length in seconds.

vendorName
string vendorName()
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

_graphics
IGraphics _graphics;
Undocumented in source.
_graphicsIsAvailable
shared(bool) _graphicsIsAvailable;
Undocumented in source.
_hostCommand
IHostCommand _hostCommand;
Undocumented in source.
_info
PluginInfo _info;
Undocumented in source.

Inherited Members

From IClient

requestResize
bool requestResize(int widthLogicalPixels, int heightLogicalPixels)

Requests a resize of the plugin window, notifying the host.

notifyResized
bool notifyResized()

Notify AFTER a manual resize of the plugin, so that the host updates its window. Returns true if succeeded. Not needed if requestResize returned true.

getDAW
DAW getDAW()

Report the identied host name (DAW).

getPluginFormat
PluginFormat getPluginFormat()

Gets the plugin format used at runtime. Version identifier may not be enough in the future, in case of unity builds.

Meta