LMMS
Loading...
Searching...
No Matches
NativePlugin Class Reference
Inheritance diagram for NativePlugin:

Classes

struct  FixedVstEvents

Public Member Functions

 NativePlugin (const NativePluginDescriptor *const desc, const double sampleRate, const char *const bundlePath, const LV2_Feature *const *const features)
 ~NativePlugin ()
bool init ()
void lv2_activate ()
void lv2_deactivate ()
void lv2_cleanup ()
void lv2_run (const uint32_t frames)
const LV2_Program_Descriptorlv2_get_program (const uint32_t index)
void lv2_select_program (uint32_t bank, uint32_t program)
void cleanupLastProjectPath ()
void saveLastProjectPathIfPossible (const LV2_Feature *const *const features)
LV2_State_Status lv2_save (const LV2_State_Store_Function store, const LV2_State_Handle handle, const uint32_t, const LV2_Feature *const *const features)
LV2_State_Status lv2_restore (const LV2_State_Retrieve_Function retrieve, const LV2_State_Handle handle, uint32_t flags, const LV2_Feature *const *const features)
LV2_Worker_Status lv2_work (LV2_Worker_Respond_Function, LV2_Worker_Respond_Handle, uint32_t, const void *data)
LV2_Worker_Status lv2_work_resp (uint32_t, const void *)
const LV2_Inline_Display_Image_Surfacelv2_idisp_render (const uint32_t width, const uint32_t height)
void lv2ui_instantiate (LV2UI_Write_Function writeFunction, LV2UI_Controller controller, LV2UI_Widget *widget, const LV2_Feature *const *features)
void lv2ui_port_event (uint32_t portIndex, uint32_t bufferSize, uint32_t format, const void *buffer) const
void lv2ui_select_program (uint32_t bank, uint32_t program) const
 NativePlugin (AEffect *const effect, const NativePluginDescriptor *desc)
 ~NativePlugin ()
bool init ()
const NativePluginDescriptorgetDescriptor () const noexcept
intptr_t vst_dispatcher (const int32_t opcode, const int32_t index, const intptr_t value, void *const ptr, const float opt)
float vst_getParameter (const int32_t index)
void vst_setParameter (const int32_t index, const float value)
void vst_processReplacing (float **const inputs, float **const outputs, const int32_t sampleFrames)

Static Public Attributes

static const uint32_t kMaxMidiEvents = 512

Protected Member Functions

void handleUiRun () const override
void handleUiShow () override
void handleUiHide () override
void handleParameterValueChanged (const uint32_t index, const float value) override
void handleBufferSizeChanged (const uint32_t bufferSize) override
void handleSampleRateChanged (const double sampleRate) override
bool handleWriteMidiEvent (const NativeMidiEvent *const event)
void handleUiParameterChanged (const uint32_t index, const float value) const
void handleUiParameterTouch (const uint32_t index, const bool touch) const
void handleUiResize (const uint32_t, const uint32_t) const
void handlePreviewBufferData (const char type, const uint32_t size, const void *const buffer) noexcept
void handleUiCustomDataChanged (const char *const key, const char *const value) const
void handleUiClosed ()
const char * handleUiOpenFile (const bool, const char *const, const char *const) const
const char * handleUiSaveFile (const bool, const char *const, const char *const) const
intptr_t handleDispatcher (const NativeHostDispatcherOpcode opcode, const int32_t index, const intptr_t value, void *const ptr, const float opt)
void updateParameterOutputs ()
bool handleWriteMidiEvent (const NativeMidiEvent *const event)
void handleUiParameterChanged (const uint32_t index, const float value) const
void handleUiParameterTouch (const uint32_t index, const bool touch) const
void handleUiResize (const int16_t width, const int16_t height)
void handleUiCustomDataChanged (const char *const, const char *const) const
void handleUiClosed ()
const char * handleUiOpenFile (const bool, const char *const, const char *const) const
const char * handleUiSaveFile (const bool, const char *const, const char *const) const
intptr_t handleDispatcher (const NativeHostDispatcherOpcode opcode, const int32_t index, const intptr_t value, void *const ptr, const float opt)

Private Types

enum  HostType { kHostTypeNull = 0 , kHostTypeArdour , kHostTypeBitwig }

Private Member Functions

intptr_t hostCallback (const int32_t opcode, const int32_t index=0, const intptr_t value=0, void *const ptr=nullptr, const float opt=0.0f) const

Static Private Member Functions

static uint32_t host_get_buffer_size (NativeHostHandle handle)
static double host_get_sample_rate (NativeHostHandle handle)
static bool host_is_offline (NativeHostHandle handle)
static const NativeTimeInfohost_get_time_info (NativeHostHandle handle)
static bool host_write_midi_event (NativeHostHandle handle, const NativeMidiEvent *event)
static void host_ui_parameter_changed (NativeHostHandle handle, uint32_t index, float value)
static void host_ui_parameter_touch (NativeHostHandle handle, uint32_t index, bool touch)
static void host_ui_custom_data_changed (NativeHostHandle handle, const char *key, const char *value)
static void host_ui_closed (NativeHostHandle handle)
static const char * host_ui_open_file (NativeHostHandle handle, bool isDir, const char *title, const char *filter)
static const char * host_ui_save_file (NativeHostHandle handle, bool isDir, const char *title, const char *filter)
static intptr_t host_dispatcher (NativeHostHandle handle, NativeHostDispatcherOpcode opcode, int32_t index, intptr_t value, void *ptr, float opt)
static uint32_t host_get_buffer_size (NativeHostHandle handle)
static double host_get_sample_rate (NativeHostHandle handle)
static bool host_is_offline (NativeHostHandle)
static const NativeTimeInfohost_get_time_info (NativeHostHandle handle)
static bool host_write_midi_event (NativeHostHandle handle, const NativeMidiEvent *event)
static void host_ui_parameter_changed (NativeHostHandle handle, uint32_t index, float value)
static void host_ui_custom_data_changed (NativeHostHandle handle, const char *key, const char *value)
static void host_ui_closed (NativeHostHandle handle)
static const char * host_ui_open_file (NativeHostHandle handle, bool isDir, const char *title, const char *filter)
static const char * host_ui_save_file (NativeHostHandle handle, bool isDir, const char *title, const char *filter)
static intptr_t host_dispatcher (NativeHostHandle handle, NativeHostDispatcherOpcode opcode, int32_t index, intptr_t value, void *ptr, float opt)

Private Attributes

NativePluginHandle fHandle
NativeHostDescriptor fHost
const NativePluginDescriptor *const fDescriptor
LV2_Program_Descriptor fProgramDesc
const bool kIgnoreParameters
LV2_Atom_Forge fAtomForge
uint32_t fMidiEventCount
NativeMidiEvent fMidiEvents [kMaxMidiEvents]
CarlaString fLastProjectPath
CarlaString fLoadedFile
PreviewData fPreviewData
volatile bool fNeedsNotifyFileChanged
volatile int fPluginNeedsIdle
int fWorkerUISignal
AEffect *const fEffect
uint32_t fBufferSize
double fSampleRate
bool fIsActive
char fProgramName [32+1]
NativeTimeInfo fTimeInfo
VstRect fVstRect
CarlaUILauncherfUiLauncher
HostType fHostType
struct NativePlugin::FixedVstEvents fMidiOutEvents
char * fStateChunk

Member Enumeration Documentation

◆ HostType

enum NativePlugin::HostType
private
Enumerator
kHostTypeNull 
kHostTypeArdour 
kHostTypeBitwig 

Constructor & Destructor Documentation

◆ NativePlugin() [1/2]

NativePlugin::NativePlugin ( const NativePluginDescriptor *const desc,
const double sampleRate,
const char *const bundlePath,
const LV2_Feature *const *const features )
inline

◆ ~NativePlugin() [1/2]

NativePlugin::~NativePlugin ( )
inline

◆ NativePlugin() [2/2]

NativePlugin::NativePlugin ( AEffect *const effect,
const NativePluginDescriptor * desc )
inline

◆ ~NativePlugin() [2/2]

NativePlugin::~NativePlugin ( )
inline

Member Function Documentation

◆ cleanupLastProjectPath()

void NativePlugin::cleanupLastProjectPath ( )
inline

◆ getDescriptor()

const NativePluginDescriptor * NativePlugin::getDescriptor ( ) const
inlinenoexcept

◆ handleBufferSizeChanged()

void NativePlugin::handleBufferSizeChanged ( const uint32_t bufferSize)
inlineoverrideprotected

◆ handleDispatcher() [1/2]

intptr_t NativePlugin::handleDispatcher ( const NativeHostDispatcherOpcode opcode,
const int32_t index,
const intptr_t value,
void *const ptr,
const float opt )
inlineprotected

◆ handleDispatcher() [2/2]

intptr_t NativePlugin::handleDispatcher ( const NativeHostDispatcherOpcode opcode,
const int32_t index,
const intptr_t value,
void *const ptr,
const float opt )
inlineprotected

◆ handleParameterValueChanged()

void NativePlugin::handleParameterValueChanged ( const uint32_t index,
const float value )
inlineoverrideprotected

◆ handlePreviewBufferData()

void NativePlugin::handlePreviewBufferData ( const char type,
const uint32_t size,
const void *const buffer )
inlineprotectednoexcept

◆ handleSampleRateChanged()

void NativePlugin::handleSampleRateChanged ( const double sampleRate)
inlineoverrideprotected

◆ handleUiClosed() [1/2]

void NativePlugin::handleUiClosed ( )
inlineprotected

◆ handleUiClosed() [2/2]

void NativePlugin::handleUiClosed ( )
inlineprotected

◆ handleUiCustomDataChanged() [1/2]

void NativePlugin::handleUiCustomDataChanged ( const char *const key,
const char *const value ) const
inlineprotected

◆ handleUiCustomDataChanged() [2/2]

void NativePlugin::handleUiCustomDataChanged ( const char * const ,
const char * const  ) const
inlineprotected

◆ handleUiHide()

void NativePlugin::handleUiHide ( )
inlineoverrideprotected

◆ handleUiOpenFile() [1/2]

const char * NativePlugin::handleUiOpenFile ( const bool ,
const char * const ,
const char * const  ) const
inlineprotected

◆ handleUiOpenFile() [2/2]

const char * NativePlugin::handleUiOpenFile ( const bool ,
const char * const ,
const char * const  ) const
inlineprotected

◆ handleUiParameterChanged() [1/2]

void NativePlugin::handleUiParameterChanged ( const uint32_t index,
const float value ) const
inlineprotected

◆ handleUiParameterChanged() [2/2]

void NativePlugin::handleUiParameterChanged ( const uint32_t index,
const float value ) const
inlineprotected

◆ handleUiParameterTouch() [1/2]

void NativePlugin::handleUiParameterTouch ( const uint32_t index,
const bool touch ) const
inlineprotected

◆ handleUiParameterTouch() [2/2]

void NativePlugin::handleUiParameterTouch ( const uint32_t index,
const bool touch ) const
inlineprotected

◆ handleUiResize() [1/2]

void NativePlugin::handleUiResize ( const int16_t width,
const int16_t height )
inlineprotected

◆ handleUiResize() [2/2]

void NativePlugin::handleUiResize ( const uint32_t ,
const uint32_t  ) const
inlineprotected

◆ handleUiRun()

void NativePlugin::handleUiRun ( ) const
inlineoverrideprotected

◆ handleUiSaveFile() [1/2]

const char * NativePlugin::handleUiSaveFile ( const bool ,
const char * const ,
const char * const  ) const
inlineprotected

◆ handleUiSaveFile() [2/2]

const char * NativePlugin::handleUiSaveFile ( const bool ,
const char * const ,
const char * const  ) const
inlineprotected

◆ handleUiShow()

void NativePlugin::handleUiShow ( )
inlineoverrideprotected

◆ handleWriteMidiEvent() [1/2]

bool NativePlugin::handleWriteMidiEvent ( const NativeMidiEvent *const event)
inlineprotected

◆ handleWriteMidiEvent() [2/2]

bool NativePlugin::handleWriteMidiEvent ( const NativeMidiEvent *const event)
inlineprotected

◆ host_dispatcher() [1/2]

intptr_t NativePlugin::host_dispatcher ( NativeHostHandle handle,
NativeHostDispatcherOpcode opcode,
int32_t index,
intptr_t value,
void * ptr,
float opt )
inlinestaticprivate

◆ host_dispatcher() [2/2]

intptr_t NativePlugin::host_dispatcher ( NativeHostHandle handle,
NativeHostDispatcherOpcode opcode,
int32_t index,
intptr_t value,
void * ptr,
float opt )
inlinestaticprivate

◆ host_get_buffer_size() [1/2]

uint32_t NativePlugin::host_get_buffer_size ( NativeHostHandle handle)
inlinestaticprivate

◆ host_get_buffer_size() [2/2]

uint32_t NativePlugin::host_get_buffer_size ( NativeHostHandle handle)
inlinestaticprivate

◆ host_get_sample_rate() [1/2]

double NativePlugin::host_get_sample_rate ( NativeHostHandle handle)
inlinestaticprivate

◆ host_get_sample_rate() [2/2]

double NativePlugin::host_get_sample_rate ( NativeHostHandle handle)
inlinestaticprivate

◆ host_get_time_info() [1/2]

const NativeTimeInfo * NativePlugin::host_get_time_info ( NativeHostHandle handle)
inlinestaticprivate

◆ host_get_time_info() [2/2]

const NativeTimeInfo * NativePlugin::host_get_time_info ( NativeHostHandle handle)
inlinestaticprivate

◆ host_is_offline() [1/2]

bool NativePlugin::host_is_offline ( NativeHostHandle handle)
inlinestaticprivate

◆ host_is_offline() [2/2]

bool NativePlugin::host_is_offline ( NativeHostHandle )
inlinestaticprivate

◆ host_ui_closed() [1/2]

void NativePlugin::host_ui_closed ( NativeHostHandle handle)
inlinestaticprivate

◆ host_ui_closed() [2/2]

void NativePlugin::host_ui_closed ( NativeHostHandle handle)
inlinestaticprivate

◆ host_ui_custom_data_changed() [1/2]

void NativePlugin::host_ui_custom_data_changed ( NativeHostHandle handle,
const char * key,
const char * value )
inlinestaticprivate

◆ host_ui_custom_data_changed() [2/2]

void NativePlugin::host_ui_custom_data_changed ( NativeHostHandle handle,
const char * key,
const char * value )
inlinestaticprivate

◆ host_ui_open_file() [1/2]

const char * NativePlugin::host_ui_open_file ( NativeHostHandle handle,
bool isDir,
const char * title,
const char * filter )
inlinestaticprivate

◆ host_ui_open_file() [2/2]

const char * NativePlugin::host_ui_open_file ( NativeHostHandle handle,
bool isDir,
const char * title,
const char * filter )
inlinestaticprivate

◆ host_ui_parameter_changed() [1/2]

void NativePlugin::host_ui_parameter_changed ( NativeHostHandle handle,
uint32_t index,
float value )
inlinestaticprivate

◆ host_ui_parameter_changed() [2/2]

void NativePlugin::host_ui_parameter_changed ( NativeHostHandle handle,
uint32_t index,
float value )
inlinestaticprivate

◆ host_ui_parameter_touch()

void NativePlugin::host_ui_parameter_touch ( NativeHostHandle handle,
uint32_t index,
bool touch )
inlinestaticprivate

◆ host_ui_save_file() [1/2]

const char * NativePlugin::host_ui_save_file ( NativeHostHandle handle,
bool isDir,
const char * title,
const char * filter )
inlinestaticprivate

◆ host_ui_save_file() [2/2]

const char * NativePlugin::host_ui_save_file ( NativeHostHandle handle,
bool isDir,
const char * title,
const char * filter )
inlinestaticprivate

◆ host_write_midi_event() [1/2]

bool NativePlugin::host_write_midi_event ( NativeHostHandle handle,
const NativeMidiEvent * event )
inlinestaticprivate

◆ host_write_midi_event() [2/2]

bool NativePlugin::host_write_midi_event ( NativeHostHandle handle,
const NativeMidiEvent * event )
inlinestaticprivate

◆ hostCallback()

intptr_t NativePlugin::hostCallback ( const int32_t opcode,
const int32_t index = 0,
const intptr_t value = 0,
void *const ptr = nullptr,
const float opt = 0.0f ) const
inlineprivate

◆ init() [1/2]

bool NativePlugin::init ( )
inline

◆ init() [2/2]

bool NativePlugin::init ( )
inline

◆ lv2_activate()

void NativePlugin::lv2_activate ( )
inline

◆ lv2_cleanup()

void NativePlugin::lv2_cleanup ( )
inline

◆ lv2_deactivate()

void NativePlugin::lv2_deactivate ( )
inline

◆ lv2_get_program()

const LV2_Program_Descriptor * NativePlugin::lv2_get_program ( const uint32_t index)
inline

◆ lv2_idisp_render()

const LV2_Inline_Display_Image_Surface * NativePlugin::lv2_idisp_render ( const uint32_t width,
const uint32_t height )
inline

◆ lv2_restore()

LV2_State_Status NativePlugin::lv2_restore ( const LV2_State_Retrieve_Function retrieve,
const LV2_State_Handle handle,
uint32_t flags,
const LV2_Feature *const *const features )
inline

◆ lv2_run()

void NativePlugin::lv2_run ( const uint32_t frames)
inline

◆ lv2_save()

LV2_State_Status NativePlugin::lv2_save ( const LV2_State_Store_Function store,
const LV2_State_Handle handle,
const uint32_t ,
const LV2_Feature *const *const features )
inline

◆ lv2_select_program()

void NativePlugin::lv2_select_program ( uint32_t bank,
uint32_t program )
inline

◆ lv2_work()

◆ lv2_work_resp()

LV2_Worker_Status NativePlugin::lv2_work_resp ( uint32_t ,
const void *  )
inline

◆ lv2ui_instantiate()

void NativePlugin::lv2ui_instantiate ( LV2UI_Write_Function writeFunction,
LV2UI_Controller controller,
LV2UI_Widget * widget,
const LV2_Feature *const * features )
inline

◆ lv2ui_port_event()

void NativePlugin::lv2ui_port_event ( uint32_t portIndex,
uint32_t bufferSize,
uint32_t format,
const void * buffer ) const
inline

◆ lv2ui_select_program()

void NativePlugin::lv2ui_select_program ( uint32_t bank,
uint32_t program ) const
inline

◆ saveLastProjectPathIfPossible()

void NativePlugin::saveLastProjectPathIfPossible ( const LV2_Feature *const *const features)
inline

◆ updateParameterOutputs()

void NativePlugin::updateParameterOutputs ( )
inlineprotected

◆ vst_dispatcher()

intptr_t NativePlugin::vst_dispatcher ( const int32_t opcode,
const int32_t index,
const intptr_t value,
void *const ptr,
const float opt )
inline

◆ vst_getParameter()

float NativePlugin::vst_getParameter ( const int32_t index)
inline

◆ vst_processReplacing()

void NativePlugin::vst_processReplacing ( float **const inputs,
float **const outputs,
const int32_t sampleFrames )
inline

◆ vst_setParameter()

void NativePlugin::vst_setParameter ( const int32_t index,
const float value )
inline

Member Data Documentation

◆ fAtomForge

LV2_Atom_Forge NativePlugin::fAtomForge
private

◆ fBufferSize

uint32_t NativePlugin::fBufferSize
private

◆ fDescriptor

const NativePluginDescriptor *const NativePlugin::fDescriptor
private

◆ fEffect

AEffect* const NativePlugin::fEffect
private

◆ fHandle

NativePluginHandle NativePlugin::fHandle
private

◆ fHost

NativeHostDescriptor NativePlugin::fHost
private

◆ fHostType

HostType NativePlugin::fHostType
private

◆ fIsActive

bool NativePlugin::fIsActive
private

◆ fLastProjectPath

CarlaString NativePlugin::fLastProjectPath
private

◆ fLoadedFile

CarlaString NativePlugin::fLoadedFile
private

◆ fMidiEventCount

uint32_t NativePlugin::fMidiEventCount
private

◆ fMidiEvents

NativeMidiEvent NativePlugin::fMidiEvents
private

◆ fMidiOutEvents

struct NativePlugin::FixedVstEvents NativePlugin::fMidiOutEvents
private

◆ fNeedsNotifyFileChanged

volatile bool NativePlugin::fNeedsNotifyFileChanged
private

◆ fPluginNeedsIdle

volatile int NativePlugin::fPluginNeedsIdle
private

◆ fPreviewData

PreviewData NativePlugin::fPreviewData
private

◆ fProgramDesc

LV2_Program_Descriptor NativePlugin::fProgramDesc
private

◆ fProgramName

char NativePlugin::fProgramName[32+1]
private

◆ fSampleRate

double NativePlugin::fSampleRate
private

◆ fStateChunk

char* NativePlugin::fStateChunk
private

◆ fTimeInfo

NativeTimeInfo NativePlugin::fTimeInfo
private

◆ fUiLauncher

CarlaUILauncher* NativePlugin::fUiLauncher
private

◆ fVstRect

VstRect NativePlugin::fVstRect
private

◆ fWorkerUISignal

int NativePlugin::fWorkerUISignal
private

◆ kIgnoreParameters

const bool NativePlugin::kIgnoreParameters
private

◆ kMaxMidiEvents

const uint32_t NativePlugin::kMaxMidiEvents = 512
static

The documentation for this class was generated from the following files: