For VST3 client only. Format clients that split the buffers themselves (for automation precision) Need as well to accumulate MIDI output themselves.
Override this method to tell which I/O are legal. The returned slice must be allocated with malloc/mallocSlice.
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.
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.
Override this methods to load/fill presets. This function must return a slice allocated with malloc, that contains presets crteated with mallocEmplace.
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.
Close the plugin UI if one was opened. Note: OBS Studio will happily call effEditClose without having called effEditOpen. Only allowed for client implementation.
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.
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.
For plugin format clients only. Enqueues an incoming MIDI message.
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.
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.
Only allowed for client implementation. This is helpful for some hosts, like OBS and Cubase, but not others like FL Studio.
Only allowed for client implementation.
This creates the GUIGraphics object lazily, and return it without synchronization. Only allowed for client implementation.
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.
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.
Mirror function to release the IGraphics from the audio-thread. Do not call if graphicsAcquire() returned null.
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.
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.
Returns a new default preset. This is intended to be used in buildPresets callback.
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)
Note: openGUI, getGUISize, getGraphics and closeGUI are guaranteed synchronized by the client implementation Only allowed for client implementation.
Process frames audio frames.
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...
Boilerplate function to get the value of a FloatParameter, for use in processAudio.
Boilerplate function to get the value of an IntParameter, for use in processAudio.
Boilerplate function to get the value of an EnumParameter, for use in processAudio.
Boilerplate function to get the value of a BoolParameter,for use in processAudio.
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.
For plugin format clients only. Calls reset(). Must be called by the audio thread.
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.
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.
Send MIDI from inside the UI. Intended to be called from inside an UI event callback.
For plugin format clients only.
Override to set the plugin tail length in seconds.
Requests a resize of the plugin window, notifying the host.
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.
Report the identied host name (DAW).
Gets the plugin format used at runtime. Version identifier may not be enough in the future, in case of unity builds.
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.