Carla Backend
|
#include <CarlaPlugin.hpp>
Classes | |
class | ScopedDisabler |
class | ScopedSingleProcessLocker |
Public Member Functions | |
virtual | ~CarlaPlugin () |
virtual PluginType | getType () const noexcept=0 |
uint | getId () const noexcept |
uint | getHints () const noexcept |
uint | getOptionsEnabled () const noexcept |
bool | isEnabled () const noexcept |
const char * | getName () const noexcept |
const char * | getFilename () const noexcept |
const char * | getIconName () const noexcept |
virtual PluginCategory | getCategory () const noexcept |
virtual int64_t | getUniqueId () const noexcept |
virtual uint32_t | getLatencyInFrames () const noexcept |
uint32_t | getAudioInCount () const noexcept |
uint32_t | getAudioOutCount () const noexcept |
uint32_t | getCVInCount () const noexcept |
uint32_t | getCVOutCount () const noexcept |
virtual uint32_t | getMidiInCount () const noexcept |
virtual uint32_t | getMidiOutCount () const noexcept |
uint32_t | getParameterCount () const noexcept |
virtual uint32_t | getParameterScalePointCount (uint32_t parameterId) const noexcept |
uint32_t | getProgramCount () const noexcept |
uint32_t | getMidiProgramCount () const noexcept |
uint32_t | getCustomDataCount () const noexcept |
int32_t | getCurrentProgram () const noexcept |
int32_t | getCurrentMidiProgram () const noexcept |
const ParameterData & | getParameterData (uint32_t parameterId) const noexcept |
const ParameterRanges & | getParameterRanges (uint32_t parameterId) const noexcept |
bool | isParameterOutput (uint32_t parameterId) const noexcept |
const MidiProgramData & | getMidiProgramData (uint32_t index) const noexcept |
const CustomData & | getCustomData (uint32_t index) const noexcept |
virtual std::size_t | getChunkData (void **dataPtr) noexcept |
virtual uint | getOptionsAvailable () const noexcept |
virtual float | getParameterValue (uint32_t parameterId) const noexcept |
virtual float | getParameterScalePointValue (uint32_t parameterId, uint32_t scalePointId) const noexcept |
__attribute__ ((warn_unused_result)) virtual bool getLabel(char *strBuf) const noexcept | |
__attribute__ ((warn_unused_result)) virtual bool getMaker(char *strBuf) const noexcept | |
__attribute__ ((warn_unused_result)) virtual bool getCopyright(char *strBuf) const noexcept | |
__attribute__ ((warn_unused_result)) virtual bool getRealName(char *strBuf) const noexcept | |
__attribute__ ((warn_unused_result)) virtual bool getParameterName(uint32_t parameterId | |
__attribute__ ((warn_unused_result)) virtual bool getParameterSymbol(uint32_t parameterId | |
__attribute__ ((warn_unused_result)) virtual bool getParameterText(uint32_t parameterId | |
__attribute__ ((warn_unused_result)) virtual bool getParameterUnit(uint32_t parameterId | |
__attribute__ ((warn_unused_result)) virtual bool getParameterComment(uint32_t parameterId | |
__attribute__ ((warn_unused_result)) virtual bool getParameterGroupName(uint32_t parameterId | |
__attribute__ ((warn_unused_result)) virtual bool getParameterScalePointLabel(uint32_t parameterId | |
float | getInternalParameterValue (int32_t parameterId) const noexcept |
__attribute__ ((warn_unused_result)) bool getProgramName(uint32_t index | |
__attribute__ ((warn_unused_result)) bool getMidiProgramName(uint32_t index | |
void | getParameterCountInfo (uint32_t &ins, uint32_t &outs) const noexcept |
virtual void | prepareForSave (bool temporary) |
virtual void | resetParameters () noexcept |
virtual void | randomizeParameters () noexcept |
const CarlaStateSave & | getStateSave (bool callPrepareForSave=true) |
void | loadStateSave (const CarlaStateSave &stateSave) |
bool | saveStateToFile (const char *filename) |
bool | loadStateFromFile (const char *filename) |
bool | exportAsLV2 (const char *lv2path) |
virtual void | setId (uint newId) noexcept |
virtual void | setName (const char *newName) |
virtual void | setOption (uint option, bool yesNo, bool sendCallback) |
void | setEnabled (bool yesNo) noexcept |
void | setActive (bool active, bool sendOsc, bool sendCallback) noexcept |
void | setDryWet (float value, bool sendOsc, bool sendCallback) noexcept |
void | setVolume (float value, bool sendOsc, bool sendCallback) noexcept |
void | setBalanceLeft (float value, bool sendOsc, bool sendCallback) noexcept |
void | setBalanceRight (float value, bool sendOsc, bool sendCallback) noexcept |
void | setPanning (float value, bool sendOsc, bool sendCallback) noexcept |
void | setDryWetRT (float value, bool sendCallbackLater) noexcept |
void | setVolumeRT (float value, bool sendCallbackLater) noexcept |
void | setBalanceLeftRT (float value, bool sendCallbackLater) noexcept |
void | setBalanceRightRT (float value, bool sendCallbackLater) noexcept |
void | setPanningRT (float value, bool sendCallbackLater) noexcept |
virtual void | setCtrlChannel (int8_t channel, bool sendOsc, bool sendCallback) noexcept |
virtual void | setParameterValue (uint32_t parameterId, float value, bool sendGui, bool sendOsc, bool sendCallback) noexcept |
virtual void | setParameterValueRT (uint32_t parameterId, float value, bool sendCallbackLater) noexcept |
void | setParameterValueByRealIndex (int32_t rindex, float value, bool sendGui, bool sendOsc, bool sendCallback) noexcept |
virtual void | setParameterMidiChannel (uint32_t parameterId, uint8_t channel, bool sendOsc, bool sendCallback) noexcept |
virtual void | setParameterMappedControlIndex (uint32_t parameterId, int16_t index, bool sendOsc, bool sendCallback, bool reconfigureNow) noexcept |
virtual void | setParameterMappedRange (uint32_t parameterId, float minimum, float maximum, bool sendOsc, bool sendCallback) noexcept |
virtual void | setCustomData (const char *type, const char *key, const char *value, bool sendGui) |
virtual void | setChunkData (const void *data, std::size_t dataSize) |
virtual void | setProgram (int32_t index, bool sendGui, bool sendOsc, bool sendCallback, bool doingInit=false) noexcept |
virtual void | setMidiProgram (int32_t index, bool sendGui, bool sendOsc, bool sendCallback, bool doingInit=false) noexcept |
void | setMidiProgramById (uint32_t bank, uint32_t program, bool sendGui, bool sendOsc, bool sendCallback) noexcept |
virtual void | setProgramRT (uint32_t index, bool sendCallbackLater) noexcept |
virtual void | setMidiProgramRT (uint32_t index, bool sendCallbackLater) noexcept |
virtual void | reload ()=0 |
virtual void | reloadPrograms (bool doInit) |
virtual void | process (const float *const *audioIn, float **audioOut, const float *const *cvIn, float **cvOut, uint32_t frames)=0 |
virtual void | bufferSizeChanged (uint32_t newBufferSize) |
virtual void | sampleRateChanged (double newSampleRate) |
virtual void | offlineModeChanged (bool isOffline) |
virtual void | idle () |
bool | tryLock (bool forcedOffline) noexcept |
void | unlock () noexcept |
virtual void | initBuffers () const noexcept |
virtual void | clearBuffers () noexcept |
virtual void | handleOscMessage (const char *method, int argc, const void *argv, const char *types, lo_message msg) |
void | sendMidiSingleNote (uint8_t channel, uint8_t note, uint8_t velo, bool sendGui, bool sendOsc, bool sendCallback) |
void | postponeRtAllNotesOff () |
virtual void | setCustomUITitle (const char *title) noexcept |
virtual void | showCustomUI (bool yesNo) |
virtual void * | embedCustomUI (void *ptr) |
virtual void | uiIdle () |
virtual void | uiParameterChange (uint32_t index, float value) noexcept |
virtual void | uiProgramChange (uint32_t index) noexcept |
virtual void | uiMidiProgramChange (uint32_t index) noexcept |
virtual void | uiNoteOn (uint8_t channel, uint8_t note, uint8_t velo) noexcept |
virtual void | uiNoteOff (uint8_t channel, uint8_t note) noexcept |
CarlaEngine * | getEngine () const noexcept |
CarlaEngineClient * | getEngineClient () const noexcept |
CarlaEngineAudioPort * | getAudioInPort (uint32_t index) const noexcept |
CarlaEngineAudioPort * | getAudioOutPort (uint32_t index) const noexcept |
CarlaEngineCVPort * | getCVInPort (uint32_t index) const noexcept |
CarlaEngineCVPort * | getCVOutPort (uint32_t index) const noexcept |
CarlaEngineEventPort * | getDefaultEventInPort () const noexcept |
CarlaEngineEventPort * | getDefaultEventOutPort () const noexcept |
void | checkForMidiLearn (EngineEvent &event) noexcept |
virtual void * | getNativeHandle () const noexcept |
virtual const void * | getNativeDescriptor () const noexcept |
virtual uintptr_t | getUiBridgeProcessId () const noexcept |
uint32_t | getPatchbayNodeId () const noexcept |
void | setPatchbayNodeId (uint32_t nodeId) noexcept |
virtual BinaryType | getBinaryType () const noexcept |
virtual const void * | getExtraStuff () const noexcept |
Public Attributes | |
char *const strBuf | noexcept |
char *strBuf | noexcept |
uint32_t | scalePointId |
uint32_t char *const strBuf | noexcept |
Protected Member Functions | |
CarlaPlugin (CarlaEngine *engine, uint id) | |
virtual void | activate () noexcept |
virtual void | deactivate () noexcept |
virtual void | cloneLV2Files (const CarlaPlugin &other) |
virtual void | restoreLV2State (bool temporary) noexcept |
virtual void | prepareForDeletion () noexcept |
virtual void | waitForBridgeSaveSignal () noexcept |
Protected Attributes | |
ProtectedData *const | pData |
Friends | |
class | CarlaEngine |
class | CarlaEngineBridge |
Carla Backend base plugin class
This is the base class for all available plugin types available in Carla Backend. All virtual calls are implemented in this class as fallback (except reload and process), so it's safe to only override needed calls.
|
protected |
This is the constructor of the base plugin class.
engine | The engine which this plugin belongs to, must not be null |
id | The 'id' of this plugin, must be between 0 and CarlaEngine::maxPluginNumber() |
|
virtual |
This is the destructor of the base plugin class.
|
pure virtualnoexcept |
Get the plugin's type (a subclass of CarlaPlugin).
|
noexcept |
Get the plugin's id (as passed in the constructor).
|
noexcept |
Get the plugin's hints.
|
noexcept |
Get the plugin's options (currently in use).
|
noexcept |
Check if the plugin is enabled. When a plugin is disabled, it will never be processed or managed in any way.
|
noexcept |
Get the plugin's internal name. This name is unique within all plugins in an engine.
|
noexcept |
Get the currently loaded DLL filename for this plugin. (Sound kits return their exact filename).
|
noexcept |
Get the plugins's icon name.
|
virtualnoexcept |
Get the plugin's category (delay, filter, synth, etc).
|
virtualnoexcept |
Get the plugin's native unique Id. May return 0 on plugin types that don't support Ids.
|
virtualnoexcept |
Get the plugin's latency, in sample frames.
|
noexcept |
Get the number of audio inputs.
|
noexcept |
Get the number of audio outputs.
|
noexcept |
Get the number of CV inputs.
|
noexcept |
Get the number of CV outputs.
|
virtualnoexcept |
Get the number of MIDI inputs.
|
virtualnoexcept |
Get the number of MIDI outputs.
|
noexcept |
Get the number of parameters. To know the number of parameter inputs and outputs separately use getParameterCountInfo() instead.
|
virtualnoexcept |
Get the number of scalepoints for parameter parameterId.
|
noexcept |
Get the number of programs.
|
noexcept |
Get the number of MIDI programs.
|
noexcept |
Get the number of custom data sets.
|
noexcept |
Get the current program number (-1 if unset).
|
noexcept |
Get the current MIDI program number (-1 if unset).
|
noexcept |
Get the parameter data of parameterId.
|
noexcept |
Get the parameter ranges of parameterId.
|
noexcept |
Check if parameter parameterId is of output type.
|
noexcept |
Get the MIDI program at index.
|
noexcept |
Get the custom data set at index.
|
virtualnoexcept |
Get the complete plugin chunk data into dataPtr.
|
virtualnoexcept |
Get the plugin available options.
|
virtualnoexcept |
Get the current parameter value of parameterId.
|
virtualnoexcept |
Get the scalepoint scalePointId value of the parameter parameterId.
|
noexcept |
Get the plugin's label (URI for LV2 plugins).
|
noexcept |
Get the plugin's maker.
|
noexcept |
Get the plugin's copyright/license.
|
noexcept |
CarlaPlugin::__attribute__ | ( | (warn_unused_result) | ) |
Get the name of the parameter parameterId.
CarlaPlugin::__attribute__ | ( | (warn_unused_result) | ) |
Get the symbol of the parameter parameterId.
CarlaPlugin::__attribute__ | ( | (warn_unused_result) | ) |
Get the custom text of the parameter parameterId.
CarlaPlugin::__attribute__ | ( | (warn_unused_result) | ) |
Get the unit of the parameter parameterId.
CarlaPlugin::__attribute__ | ( | (warn_unused_result) | ) |
Get the comment (documentation) of the parameter parameterId.
CarlaPlugin::__attribute__ | ( | (warn_unused_result) | ) |
Get the group name of the parameter parameterId.
CarlaPlugin::__attribute__ | ( | (warn_unused_result) | ) |
Get the scalepoint scalePointId label of the parameter parameterId.
|
noexcept |
Get the current parameter value of parameterId. parameterId can be negative to allow internal parameters.
CarlaPlugin::__attribute__ | ( | (warn_unused_result) | ) |
Get the name of the program at index.
CarlaPlugin::__attribute__ | ( | (warn_unused_result) | ) |
Get the name of the MIDI program at index.
|
noexcept |
Get information about the plugin's parameter count. This is used to check how many input, output and total parameters are available.
|
virtual |
Tell the plugin to prepare for save.
temporary | Wherever we are saving into a temporary location (for duplication, renaming or similar) |
|
virtualnoexcept |
Reset all possible parameters.
|
virtualnoexcept |
Randomize all possible parameters.
const CarlaStateSave& CarlaPlugin::getStateSave | ( | bool | callPrepareForSave = true | ) |
Get the plugin's save state. The plugin will automatically call prepareForSave() if requested.
void CarlaPlugin::loadStateSave | ( | const CarlaStateSave & | stateSave | ) |
Get the plugin's save state.
bool CarlaPlugin::saveStateToFile | ( | const char * | filename | ) |
Save the current plugin state to filename.
bool CarlaPlugin::loadStateFromFile | ( | const char * | filename | ) |
Save the plugin state from filename.
bool CarlaPlugin::exportAsLV2 | ( | const char * | lv2path | ) |
Export this plugin as LV2.
|
virtualnoexcept |
|
virtual |
Set the plugin's name to newName.
|
virtual |
Set a plugin's option.
|
noexcept |
Enable or disable the plugin according to yesNo. When a plugin is disabled, it will never be processed or managed in any way.
|
noexcept |
Set plugin as active according to active.
sendOsc | Send message change over OSC |
sendCallback | Send message change to registered callback |
|
noexcept |
Set the plugin's dry/wet signal value to value. value must be between 0.0 and 1.0.
sendOsc | Send message change over OSC |
sendCallback | Send message change to registered callback |
|
noexcept |
Set the plugin's output volume to value. value must be between 0.0 and 1.27.
sendOsc | Send message change over OSC |
sendCallback | Send message change to registered callback |
|
noexcept |
Set the plugin's output left balance value to value. value must be between -1.0 and 1.0.
sendOsc | Send message change over OSC |
sendCallback | Send message change to registered callback |
|
noexcept |
Set the plugin's output right balance value to value. value must be between -1.0 and 1.0.
sendOsc | Send message change over OSC |
sendCallback | Send message change to registered callback |
|
noexcept |
Set the plugin's output panning value to value. value must be between -1.0 and 1.0.
sendOsc | Send message change over OSC |
sendCallback | Send message change to registered callback |
|
noexcept |
Overloaded functions, to be called from within RT context only.
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
virtualnoexcept |
Set the plugin's midi control channel.
sendOsc | Send message change over OSC |
sendCallback | Send message change to registered callback |
|
virtualnoexcept |
Set a plugin's parameter value.
parameterId | The parameter to change |
value | The new parameter value, must be within the parameter's range |
sendGui | Send message change to plugin's custom GUI, if any |
sendOsc | Send message change over OSC |
sendCallback | Send message change to registered callback |
|
virtualnoexcept |
Overloaded function, to be called from within RT context only.
|
noexcept |
Set a plugin's parameter value, including internal parameters. rindex can be negative to allow internal parameters change (as defined in InternalParametersIndex).
|
virtualnoexcept |
Set parameter's parameterId MIDI channel to channel. channel must be between 0 and 15.
|
virtualnoexcept |
Set parameter's parameterId mapped control index to index.
|
virtualnoexcept |
Set parameter's parameterId mapped range to minimum and maximum.
|
virtual |
Add a custom data set. If key already exists, its current value will be swapped with value.
type | Type of data used in value. |
key | A key identifying this data set. |
value | The value of the data set, of type type. |
sendGui | Send message change to plugin's custom GUI, if any |
|
virtual |
Set the complete chunk data as data.
|
virtualnoexcept |
Change the current plugin program to index.
If index is negative the plugin's program will be considered unset. The plugin's default parameter values will be updated when this function is called.
index | New program index to use |
sendGui | Send message change to plugin's custom GUI, if any |
sendOsc | Send message change over OSC |
sendCallback | Send message change to registered callback |
|
virtualnoexcept |
Change the current MIDI plugin program to index.
If index is negative the plugin's program will be considered unset. The plugin's default parameter values will be updated when this function is called.
index | New program index to use |
sendGui | Send message change to plugin's custom GUI, if any |
sendOsc | Send message change over OSC |
sendCallback | Send message change to registered callback |
|
noexcept |
This is an overloaded call to setMidiProgram(). It changes the current MIDI program using bank and program values instead of index.
|
virtualnoexcept |
Overloaded functions, to be called from within RT context only.
|
virtualnoexcept |
|
pure virtual |
Reload the plugin's entire state (including programs). The plugin will be disabled during this call.
|
virtual |
Reload the plugin's programs state.
|
protectedvirtualnoexcept |
Plugin activate call.
|
protectedvirtualnoexcept |
Plugin activate call.
|
pure virtual |
Plugin process call.
|
virtual |
Tell the plugin the current buffer size changed.
|
virtual |
Tell the plugin the current sample rate changed.
|
virtual |
Tell the plugin the current offline mode changed.
|
virtual |
Idle function (non-UI), called at regular intervals.
|
noexcept |
Try to lock the plugin's master mutex.
forcedOffline | When true, always locks and returns true |
|
noexcept |
Unlock the plugin's master mutex.
|
virtualnoexcept |
Initialize all RT buffers of the plugin.
|
virtualnoexcept |
Delete and clear all RT buffers.
|
virtual |
Handle an OSC message. FIXME
void CarlaPlugin::sendMidiSingleNote | ( | uint8_t | channel, |
uint8_t | note, | ||
uint8_t | velo, | ||
bool | sendGui, | ||
bool | sendOsc, | ||
bool | sendCallback | ||
) |
Send a single midi note to be processed in the next audio callback. A note with 0 velocity means note-off.
void CarlaPlugin::postponeRtAllNotesOff | ( | ) |
Send all midi notes off to the host callback. This doesn't send the actual MIDI All-Notes-Off event, but 128 note-offs instead (IFF ctrlChannel is valid).
|
virtualnoexcept |
Set a custom title for the plugin UI window created by Carla.
|
virtual |
Show (or hide) the plugin's custom UI according to yesNo. This function is always called from the main thread.
|
virtual |
Embed the plugin's custom UI to the system pointer ptr. This function is always called from the main thread.
|
virtual |
UI idle function, called at regular intervals. This function is only called from the main thread if PLUGIN_NEEDS_UI_MAIN_THREAD is set.
|
virtualnoexcept |
Tell the UI a parameter has changed.
|
virtualnoexcept |
Tell the UI the current program has changed.
|
virtualnoexcept |
Tell the UI the current midi program has changed.
|
virtualnoexcept |
Tell the UI a note has been pressed.
|
virtualnoexcept |
Tell the UI a note has been released.
|
noexcept |
Get the plugin's engine, as passed in the constructor.
|
noexcept |
Get the plugin's engine client.
|
noexcept |
Get a plugin's audio input port.
|
noexcept |
Get a plugin's audio output port.
|
noexcept |
Get a plugin's CV input port.
|
noexcept |
Get a plugin's CV output port.
|
noexcept |
Get the plugin's default event input port.
|
noexcept |
Get the plugin's default event output port.
|
noexcept |
Check if the plugin is interested on MIDI learn, and if so, map this event to the parameter that wants it. Event MUST be of control type and not have been handled before.
|
virtualnoexcept |
Get the plugin's type native handle. This will be LADSPA_Handle, LV2_Handle, etc.
|
virtualnoexcept |
Get the plugin's type native descriptor. This will be LADSPA_Descriptor, DSSI_Descriptor, LV2_Descriptor, AEffect, etc.
|
virtualnoexcept |
Get the plugin UI bridge process Id.
|
noexcept |
Get the plugin's patchbay nodeId.
|
noexcept |
Set the plugin's patchbay nodeId.
|
inlinevirtualnoexcept |
Get a plugin's binary type. This is always BINARY_NATIVE unless the plugin is a bridge.
|
inlinevirtualnoexcept |
Handy function required by CarlaEngine::clonePlugin().
|
protectedvirtual |
Clone/copy files from another LV2 plugin into this one..
|
protectedvirtualnoexcept |
Call LV2 restore.
temporary | Wherever we are saving into a temporary location (for duplication, renaming or similar) |
|
protectedvirtualnoexcept |
Allow engine to signal that plugin will be deleted soon.
|
protectedvirtualnoexcept |
Give plugin bridges a change to update their custom data sets.
|
friend |
|
friend |
char *const strBuf CarlaPlugin::noexcept |
char* strBuf CarlaPlugin::noexcept |
uint32_t CarlaPlugin::scalePointId |
uint32_t char* const strBuf CarlaPlugin::noexcept |
|
protected |