Browse Source

Remove idle from native api and lv2/vst exported plugin; Cleanup; Misc changes

tags/1.9.6
falkTX 10 years ago
parent
commit
b6594b2fa1
13 changed files with 54 additions and 165 deletions
  1. +11
    -16
      source/backend/CarlaUtils.cpp
  2. +24
    -20
      source/backend/engine/CarlaEngineNative.cpp
  3. +1
    -12
      source/backend/plugin/CarlaPluginNative.cpp
  4. +11
    -13
      source/includes/CarlaNative.h
  5. +0
    -10
      source/includes/CarlaNative.hpp
  6. +1
    -1
      source/native-plugins/distrho-3bandeq.cpp
  7. +1
    -1
      source/native-plugins/distrho-3bandsplitter.cpp
  8. +1
    -1
      source/native-plugins/distrho-mverb.cpp
  9. +1
    -1
      source/native-plugins/distrho-nekobi.cpp
  10. +1
    -1
      source/native-plugins/distrho-pingpongpan.cpp
  11. +0
    -7
      source/plugin/carla-lv2-export.cpp
  12. +1
    -74
      source/plugin/carla-lv2.cpp
  13. +1
    -8
      source/plugin/carla-vst.cpp

+ 11
- 16
source/backend/CarlaUtils.cpp View File

@@ -62,8 +62,7 @@ static const NativePluginDescriptor carlaRackDesc = {
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_SYNTH /* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_SYNTH
|NATIVE_PLUGIN_HAS_UI |NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS
|NATIVE_PLUGIN_NEEDS_SINGLE_THREAD
|NATIVE_PLUGIN_NEEDS_DSP_IDLE
|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD
|NATIVE_PLUGIN_USES_STATE |NATIVE_PLUGIN_USES_STATE
|NATIVE_PLUGIN_USES_TIME), |NATIVE_PLUGIN_USES_TIME),
/* supports */ static_cast<NativePluginSupports>(NATIVE_PLUGIN_SUPPORTS_EVERYTHING), /* supports */ static_cast<NativePluginSupports>(NATIVE_PLUGIN_SUPPORTS_EVERYTHING),
@@ -80,7 +79,7 @@ static const NativePluginDescriptor carlaRackDesc = {
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr
nullptr, nullptr, nullptr, nullptr
}; };


static const NativePluginDescriptor carlaPatchbayDesc = { static const NativePluginDescriptor carlaPatchbayDesc = {
@@ -88,8 +87,7 @@ static const NativePluginDescriptor carlaPatchbayDesc = {
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_SYNTH /* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_SYNTH
|NATIVE_PLUGIN_HAS_UI |NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS
|NATIVE_PLUGIN_NEEDS_SINGLE_THREAD
|NATIVE_PLUGIN_NEEDS_DSP_IDLE
|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD
|NATIVE_PLUGIN_USES_STATE |NATIVE_PLUGIN_USES_STATE
|NATIVE_PLUGIN_USES_TIME), |NATIVE_PLUGIN_USES_TIME),
/* supports */ static_cast<NativePluginSupports>(NATIVE_PLUGIN_SUPPORTS_EVERYTHING), /* supports */ static_cast<NativePluginSupports>(NATIVE_PLUGIN_SUPPORTS_EVERYTHING),
@@ -106,7 +104,7 @@ static const NativePluginDescriptor carlaPatchbayDesc = {
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr
nullptr, nullptr, nullptr, nullptr
}; };


static const NativePluginDescriptor carlaPatchbay3sDesc = { static const NativePluginDescriptor carlaPatchbay3sDesc = {
@@ -114,8 +112,7 @@ static const NativePluginDescriptor carlaPatchbay3sDesc = {
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_SYNTH /* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_SYNTH
|NATIVE_PLUGIN_HAS_UI |NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS
|NATIVE_PLUGIN_NEEDS_SINGLE_THREAD
|NATIVE_PLUGIN_NEEDS_DSP_IDLE
|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD
|NATIVE_PLUGIN_USES_STATE |NATIVE_PLUGIN_USES_STATE
|NATIVE_PLUGIN_USES_TIME), |NATIVE_PLUGIN_USES_TIME),
/* supports */ static_cast<NativePluginSupports>(NATIVE_PLUGIN_SUPPORTS_EVERYTHING), /* supports */ static_cast<NativePluginSupports>(NATIVE_PLUGIN_SUPPORTS_EVERYTHING),
@@ -132,7 +129,7 @@ static const NativePluginDescriptor carlaPatchbay3sDesc = {
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr
nullptr, nullptr, nullptr, nullptr
}; };


static const NativePluginDescriptor carlaPatchbay16Desc = { static const NativePluginDescriptor carlaPatchbay16Desc = {
@@ -140,8 +137,7 @@ static const NativePluginDescriptor carlaPatchbay16Desc = {
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_SYNTH /* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_SYNTH
|NATIVE_PLUGIN_HAS_UI |NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS
|NATIVE_PLUGIN_NEEDS_SINGLE_THREAD
|NATIVE_PLUGIN_NEEDS_DSP_IDLE
|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD
|NATIVE_PLUGIN_USES_STATE |NATIVE_PLUGIN_USES_STATE
|NATIVE_PLUGIN_USES_TIME), |NATIVE_PLUGIN_USES_TIME),
/* supports */ static_cast<NativePluginSupports>(NATIVE_PLUGIN_SUPPORTS_EVERYTHING), /* supports */ static_cast<NativePluginSupports>(NATIVE_PLUGIN_SUPPORTS_EVERYTHING),
@@ -158,7 +154,7 @@ static const NativePluginDescriptor carlaPatchbay16Desc = {
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr
nullptr, nullptr, nullptr, nullptr
}; };


static const NativePluginDescriptor carlaPatchbay32Desc = { static const NativePluginDescriptor carlaPatchbay32Desc = {
@@ -166,8 +162,7 @@ static const NativePluginDescriptor carlaPatchbay32Desc = {
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_SYNTH /* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_SYNTH
|NATIVE_PLUGIN_HAS_UI |NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS
|NATIVE_PLUGIN_NEEDS_SINGLE_THREAD
|NATIVE_PLUGIN_NEEDS_DSP_IDLE
|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD
|NATIVE_PLUGIN_USES_STATE |NATIVE_PLUGIN_USES_STATE
|NATIVE_PLUGIN_USES_TIME), |NATIVE_PLUGIN_USES_TIME),
/* supports */ static_cast<NativePluginSupports>(NATIVE_PLUGIN_SUPPORTS_EVERYTHING), /* supports */ static_cast<NativePluginSupports>(NATIVE_PLUGIN_SUPPORTS_EVERYTHING),
@@ -184,7 +179,7 @@ static const NativePluginDescriptor carlaPatchbay32Desc = {
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr
nullptr, nullptr, nullptr, nullptr
}; };


static LinkedList<const NativePluginDescriptor*> gPluginDescriptors; static LinkedList<const NativePluginDescriptor*> gPluginDescriptors;
@@ -430,7 +425,7 @@ const CarlaCachedPluginInfo* carla_get_cached_plugin_info(CB::PluginType ptype,
info.hints |= CB::PLUGIN_HAS_CUSTOM_UI; info.hints |= CB::PLUGIN_HAS_CUSTOM_UI;
if (desc->hints & NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS) if (desc->hints & NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS)
info.hints |= CB::PLUGIN_NEEDS_FIXED_BUFFERS; info.hints |= CB::PLUGIN_NEEDS_FIXED_BUFFERS;
if (desc->hints & NATIVE_PLUGIN_NEEDS_SINGLE_THREAD)
if (desc->hints & NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD)
info.hints |= CB::PLUGIN_NEEDS_UI_MAIN_THREAD; info.hints |= CB::PLUGIN_NEEDS_UI_MAIN_THREAD;


info.audioIns = desc->audioIns; info.audioIns = desc->audioIns;


+ 24
- 20
source/backend/engine/CarlaEngineNative.cpp View File

@@ -1450,6 +1450,25 @@ protected:


void uiIdle() void uiIdle()
{ {
for (uint i=0; i < pData->curPluginCount; ++i)
{
CarlaPlugin* const plugin(pData->plugins[i].plugin);

if (plugin != nullptr && plugin->isEnabled())
{
const uint hints(plugin->getHints());

if ((hints & PLUGIN_HAS_CUSTOM_UI) != 0 && (hints & PLUGIN_NEEDS_UI_MAIN_THREAD) != 0)
{
try {
plugin->uiIdle();
} CARLA_SAFE_EXCEPTION_CONTINUE("Plugin uiIdle");
}
}
}

pData->osc.idle();

fUiServer.idlePipe(); fUiServer.idlePipe();


if (fUiServer.isPipeRunning()) if (fUiServer.isPipeRunning())
@@ -1584,11 +1603,6 @@ public:
delete handlePtr; delete handlePtr;
} }


static void _idle(NativePluginHandle handle)
{
handlePtr->idle();
}

static uint32_t _get_parameter_count(NativePluginHandle handle) static uint32_t _get_parameter_count(NativePluginHandle handle)
{ {
return handlePtr->getParameterCount(); return handlePtr->getParameterCount();
@@ -1737,8 +1751,7 @@ static const NativePluginDescriptor carlaRackDesc = {
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_SYNTH /* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_SYNTH
|NATIVE_PLUGIN_HAS_UI |NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS
|NATIVE_PLUGIN_NEEDS_SINGLE_THREAD
|NATIVE_PLUGIN_NEEDS_DSP_IDLE
|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD
|NATIVE_PLUGIN_USES_STATE |NATIVE_PLUGIN_USES_STATE
|NATIVE_PLUGIN_USES_TIME), |NATIVE_PLUGIN_USES_TIME),
/* supports */ static_cast<NativePluginSupports>(NATIVE_PLUGIN_SUPPORTS_EVERYTHING), /* supports */ static_cast<NativePluginSupports>(NATIVE_PLUGIN_SUPPORTS_EVERYTHING),
@@ -1754,7 +1767,6 @@ static const NativePluginDescriptor carlaRackDesc = {
/* copyright */ "GNU GPL v2+", /* copyright */ "GNU GPL v2+",
CarlaEngineNative::_instantiateRack, CarlaEngineNative::_instantiateRack,
CarlaEngineNative::_cleanup, CarlaEngineNative::_cleanup,
CarlaEngineNative::_idle,
CarlaEngineNative::_get_parameter_count, CarlaEngineNative::_get_parameter_count,
CarlaEngineNative::_get_parameter_info, CarlaEngineNative::_get_parameter_info,
CarlaEngineNative::_get_parameter_value, CarlaEngineNative::_get_parameter_value,
@@ -1782,8 +1794,7 @@ static const NativePluginDescriptor carlaPatchbayDesc = {
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_SYNTH /* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_SYNTH
|NATIVE_PLUGIN_HAS_UI |NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS
|NATIVE_PLUGIN_NEEDS_SINGLE_THREAD
|NATIVE_PLUGIN_NEEDS_DSP_IDLE
|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD
|NATIVE_PLUGIN_USES_STATE |NATIVE_PLUGIN_USES_STATE
|NATIVE_PLUGIN_USES_TIME), |NATIVE_PLUGIN_USES_TIME),
/* supports */ static_cast<NativePluginSupports>(NATIVE_PLUGIN_SUPPORTS_EVERYTHING), /* supports */ static_cast<NativePluginSupports>(NATIVE_PLUGIN_SUPPORTS_EVERYTHING),
@@ -1799,7 +1810,6 @@ static const NativePluginDescriptor carlaPatchbayDesc = {
/* copyright */ "GNU GPL v2+", /* copyright */ "GNU GPL v2+",
CarlaEngineNative::_instantiatePatchbay, CarlaEngineNative::_instantiatePatchbay,
CarlaEngineNative::_cleanup, CarlaEngineNative::_cleanup,
CarlaEngineNative::_idle,
CarlaEngineNative::_get_parameter_count, CarlaEngineNative::_get_parameter_count,
CarlaEngineNative::_get_parameter_info, CarlaEngineNative::_get_parameter_info,
CarlaEngineNative::_get_parameter_value, CarlaEngineNative::_get_parameter_value,
@@ -1827,8 +1837,7 @@ static const NativePluginDescriptor carlaPatchbay3sDesc = {
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_SYNTH /* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_SYNTH
|NATIVE_PLUGIN_HAS_UI |NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS
|NATIVE_PLUGIN_NEEDS_SINGLE_THREAD
|NATIVE_PLUGIN_NEEDS_DSP_IDLE
|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD
|NATIVE_PLUGIN_USES_STATE |NATIVE_PLUGIN_USES_STATE
|NATIVE_PLUGIN_USES_TIME), |NATIVE_PLUGIN_USES_TIME),
/* supports */ static_cast<NativePluginSupports>(NATIVE_PLUGIN_SUPPORTS_EVERYTHING), /* supports */ static_cast<NativePluginSupports>(NATIVE_PLUGIN_SUPPORTS_EVERYTHING),
@@ -1844,7 +1853,6 @@ static const NativePluginDescriptor carlaPatchbay3sDesc = {
/* copyright */ "GNU GPL v2+", /* copyright */ "GNU GPL v2+",
CarlaEngineNative::_instantiatePatchbay3s, CarlaEngineNative::_instantiatePatchbay3s,
CarlaEngineNative::_cleanup, CarlaEngineNative::_cleanup,
CarlaEngineNative::_idle,
CarlaEngineNative::_get_parameter_count, CarlaEngineNative::_get_parameter_count,
CarlaEngineNative::_get_parameter_info, CarlaEngineNative::_get_parameter_info,
CarlaEngineNative::_get_parameter_value, CarlaEngineNative::_get_parameter_value,
@@ -1872,8 +1880,7 @@ static const NativePluginDescriptor carlaPatchbay16Desc = {
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_SYNTH /* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_SYNTH
|NATIVE_PLUGIN_HAS_UI |NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS
|NATIVE_PLUGIN_NEEDS_SINGLE_THREAD
|NATIVE_PLUGIN_NEEDS_DSP_IDLE
|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD
|NATIVE_PLUGIN_USES_STATE |NATIVE_PLUGIN_USES_STATE
|NATIVE_PLUGIN_USES_TIME), |NATIVE_PLUGIN_USES_TIME),
/* supports */ static_cast<NativePluginSupports>(NATIVE_PLUGIN_SUPPORTS_EVERYTHING), /* supports */ static_cast<NativePluginSupports>(NATIVE_PLUGIN_SUPPORTS_EVERYTHING),
@@ -1889,7 +1896,6 @@ static const NativePluginDescriptor carlaPatchbay16Desc = {
/* copyright */ "GNU GPL v2+", /* copyright */ "GNU GPL v2+",
CarlaEngineNative::_instantiatePatchbay16, CarlaEngineNative::_instantiatePatchbay16,
CarlaEngineNative::_cleanup, CarlaEngineNative::_cleanup,
CarlaEngineNative::_idle,
CarlaEngineNative::_get_parameter_count, CarlaEngineNative::_get_parameter_count,
CarlaEngineNative::_get_parameter_info, CarlaEngineNative::_get_parameter_info,
CarlaEngineNative::_get_parameter_value, CarlaEngineNative::_get_parameter_value,
@@ -1917,8 +1923,7 @@ static const NativePluginDescriptor carlaPatchbay32Desc = {
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_SYNTH /* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_SYNTH
|NATIVE_PLUGIN_HAS_UI |NATIVE_PLUGIN_HAS_UI
|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS
|NATIVE_PLUGIN_NEEDS_SINGLE_THREAD
|NATIVE_PLUGIN_NEEDS_DSP_IDLE
|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD
|NATIVE_PLUGIN_USES_STATE |NATIVE_PLUGIN_USES_STATE
|NATIVE_PLUGIN_USES_TIME), |NATIVE_PLUGIN_USES_TIME),
/* supports */ static_cast<NativePluginSupports>(NATIVE_PLUGIN_SUPPORTS_EVERYTHING), /* supports */ static_cast<NativePluginSupports>(NATIVE_PLUGIN_SUPPORTS_EVERYTHING),
@@ -1934,7 +1939,6 @@ static const NativePluginDescriptor carlaPatchbay32Desc = {
/* copyright */ "GNU GPL v2+", /* copyright */ "GNU GPL v2+",
CarlaEngineNative::_instantiatePatchbay32, CarlaEngineNative::_instantiatePatchbay32,
CarlaEngineNative::_cleanup, CarlaEngineNative::_cleanup,
CarlaEngineNative::_idle,
CarlaEngineNative::_get_parameter_count, CarlaEngineNative::_get_parameter_count,
CarlaEngineNative::_get_parameter_info, CarlaEngineNative::_get_parameter_info,
CarlaEngineNative::_get_parameter_value, CarlaEngineNative::_get_parameter_value,


+ 1
- 12
source/backend/plugin/CarlaPluginNative.cpp View File

@@ -769,17 +769,6 @@ public:
} }
} }


void idle() override
{
CARLA_SAFE_ASSERT_RETURN(fDescriptor != nullptr,);
CARLA_SAFE_ASSERT_RETURN(fHandle != nullptr,);

if (fDescriptor->idle != nullptr && (fDescriptor->hints & ::NATIVE_PLUGIN_NEEDS_DSP_IDLE) != 0)
fDescriptor->idle(fHandle);

CarlaPlugin::idle();
}

void uiIdle() override void uiIdle() override
{ {
CARLA_SAFE_ASSERT_RETURN(fDescriptor != nullptr,); CARLA_SAFE_ASSERT_RETURN(fDescriptor != nullptr,);
@@ -1157,7 +1146,7 @@ public:
pData->hints |= PLUGIN_HAS_CUSTOM_UI; pData->hints |= PLUGIN_HAS_CUSTOM_UI;
if (fDescriptor->hints & NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS) if (fDescriptor->hints & NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS)
pData->hints |= PLUGIN_NEEDS_FIXED_BUFFERS; pData->hints |= PLUGIN_NEEDS_FIXED_BUFFERS;
if (fDescriptor->hints & NATIVE_PLUGIN_NEEDS_SINGLE_THREAD)
if (fDescriptor->hints & NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD)
pData->hints |= PLUGIN_NEEDS_UI_MAIN_THREAD; pData->hints |= PLUGIN_NEEDS_UI_MAIN_THREAD;


// extra plugin hints // extra plugin hints


+ 11
- 13
source/includes/CarlaNative.h View File

@@ -53,18 +53,17 @@ typedef enum {
} NativePluginCategory; } NativePluginCategory;


typedef enum { typedef enum {
NATIVE_PLUGIN_IS_RTSAFE = 1 << 0,
NATIVE_PLUGIN_IS_SYNTH = 1 << 1,
NATIVE_PLUGIN_HAS_UI = 1 << 2,
NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS = 1 << 3,
NATIVE_PLUGIN_NEEDS_SINGLE_THREAD = 1 << 4,
NATIVE_PLUGIN_NEEDS_DSP_IDLE = 1 << 5,
NATIVE_PLUGIN_NEEDS_UI_OPEN_SAVE = 1 << 6,
NATIVE_PLUGIN_USES_MULTI_PROGS = 1 << 7, /** has 1 patch per midi channel */
NATIVE_PLUGIN_USES_PANNING = 1 << 8, /** uses stereo balance if unset (default) */
NATIVE_PLUGIN_USES_STATE = 1 << 9,
NATIVE_PLUGIN_USES_TIME = 1 << 10,
NATIVE_PLUGIN_USES_PARENT_ID = 1 << 11 /** can set transient hint to parent */
NATIVE_PLUGIN_IS_RTSAFE = 1 << 0,
NATIVE_PLUGIN_IS_SYNTH = 1 << 1,
NATIVE_PLUGIN_HAS_UI = 1 << 2,
NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS = 1 << 3,
NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD = 1 << 4,
NATIVE_PLUGIN_NEEDS_UI_OPEN_SAVE = 1 << 6,
NATIVE_PLUGIN_USES_MULTI_PROGS = 1 << 7, /** has 1 patch per midi channel */
NATIVE_PLUGIN_USES_PANNING = 1 << 8, /** uses stereo balance if unset (default) */
NATIVE_PLUGIN_USES_STATE = 1 << 9,
NATIVE_PLUGIN_USES_TIME = 1 << 10,
NATIVE_PLUGIN_USES_PARENT_ID = 1 << 11 /** can set transient hint to parent */
} NativePluginHints; } NativePluginHints;


typedef enum { typedef enum {
@@ -221,7 +220,6 @@ typedef struct _NativePluginDescriptor {


NativePluginHandle (*instantiate)(const NativeHostDescriptor* host); NativePluginHandle (*instantiate)(const NativeHostDescriptor* host);
void (*cleanup)(NativePluginHandle handle); void (*cleanup)(NativePluginHandle handle);
void (*idle)(NativePluginHandle handle);


uint32_t (*get_parameter_count)(NativePluginHandle handle); uint32_t (*get_parameter_count)(NativePluginHandle handle);
const NativeParameter* (*get_parameter_info)(NativePluginHandle handle, uint32_t index); const NativeParameter* (*get_parameter_info)(NativePluginHandle handle, uint32_t index);


+ 0
- 10
source/includes/CarlaNative.hpp View File

@@ -208,10 +208,6 @@ protected:
pHost->dispatcher(pHost->handle, NATIVE_HOST_OPCODE_UI_UNAVAILABLE, 0, 0, nullptr, 0.0f); pHost->dispatcher(pHost->handle, NATIVE_HOST_OPCODE_UI_UNAVAILABLE, 0, 0, nullptr, 0.0f);
} }


// -------------------------------------------------------------------

virtual void idle() {}

// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Plugin parameter calls // Plugin parameter calls


@@ -386,11 +382,6 @@ private:
public: public:
#define handlePtr ((NativePluginClass*)handle) #define handlePtr ((NativePluginClass*)handle)


static void _idle(NativePluginHandle handle)
{
handlePtr->idle();
}

static uint32_t _get_parameter_count(NativePluginHandle handle) static uint32_t _get_parameter_count(NativePluginHandle handle)
{ {
return handlePtr->getParameterCount(); return handlePtr->getParameterCount();
@@ -539,7 +530,6 @@ public: \
#define PluginDescriptorFILL(ClassName) \ #define PluginDescriptorFILL(ClassName) \
ClassName::_instantiate, \ ClassName::_instantiate, \
ClassName::_cleanup, \ ClassName::_cleanup, \
ClassName::_idle, \
ClassName::_get_parameter_count, \ ClassName::_get_parameter_count, \
ClassName::_get_parameter_info, \ ClassName::_get_parameter_info, \
ClassName::_get_parameter_value, \ ClassName::_get_parameter_value, \


+ 1
- 1
source/native-plugins/distrho-3bandeq.cpp View File

@@ -40,7 +40,7 @@ START_NAMESPACE_DISTRHO
static const NativePluginDescriptor _3bandeqDesc = { static const NativePluginDescriptor _3bandeqDesc = {
/* category */ NATIVE_PLUGIN_CATEGORY_EQ, /* category */ NATIVE_PLUGIN_CATEGORY_EQ,
#ifdef HAVE_DGL #ifdef HAVE_DGL
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE|NATIVE_PLUGIN_HAS_UI|NATIVE_PLUGIN_USES_PARENT_ID),
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE|NATIVE_PLUGIN_HAS_UI|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD|NATIVE_PLUGIN_USES_PARENT_ID),
#else #else
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE), /* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE),
#endif #endif


+ 1
- 1
source/native-plugins/distrho-3bandsplitter.cpp View File

@@ -40,7 +40,7 @@ START_NAMESPACE_DISTRHO
static const NativePluginDescriptor _3bandsplitterDesc = { static const NativePluginDescriptor _3bandsplitterDesc = {
/* category */ NATIVE_PLUGIN_CATEGORY_EQ, /* category */ NATIVE_PLUGIN_CATEGORY_EQ,
#ifdef HAVE_DGL #ifdef HAVE_DGL
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE|NATIVE_PLUGIN_HAS_UI|NATIVE_PLUGIN_USES_PARENT_ID),
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE|NATIVE_PLUGIN_HAS_UI|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD|NATIVE_PLUGIN_USES_PARENT_ID),
#else #else
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE), /* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE),
#endif #endif


+ 1
- 1
source/native-plugins/distrho-mverb.cpp View File

@@ -41,7 +41,7 @@ START_NAMESPACE_DISTRHO
static const NativePluginDescriptor _mverbDesc = { static const NativePluginDescriptor _mverbDesc = {
/* category */ NATIVE_PLUGIN_CATEGORY_DELAY, /* category */ NATIVE_PLUGIN_CATEGORY_DELAY,
#ifdef HAVE_DGL #ifdef HAVE_DGL
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE|NATIVE_PLUGIN_HAS_UI|NATIVE_PLUGIN_USES_PARENT_ID),
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE|NATIVE_PLUGIN_HAS_UI|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD|NATIVE_PLUGIN_USES_PARENT_ID),
#else #else
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE), /* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE),
#endif #endif


+ 1
- 1
source/native-plugins/distrho-nekobi.cpp View File

@@ -40,7 +40,7 @@ START_NAMESPACE_DISTRHO
static const NativePluginDescriptor nekobiDesc = { static const NativePluginDescriptor nekobiDesc = {
/* category */ NATIVE_PLUGIN_CATEGORY_SYNTH, /* category */ NATIVE_PLUGIN_CATEGORY_SYNTH,
#ifdef HAVE_DGL #ifdef HAVE_DGL
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE|NATIVE_PLUGIN_IS_SYNTH|NATIVE_PLUGIN_HAS_UI|NATIVE_PLUGIN_USES_PARENT_ID),
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE|NATIVE_PLUGIN_IS_SYNTH|NATIVE_PLUGIN_HAS_UI|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD|NATIVE_PLUGIN_USES_PARENT_ID),
#else #else
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE|NATIVE_PLUGIN_IS_SYNTH), /* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE|NATIVE_PLUGIN_IS_SYNTH),
#endif #endif


+ 1
- 1
source/native-plugins/distrho-pingpongpan.cpp View File

@@ -40,7 +40,7 @@ START_NAMESPACE_DISTRHO
static const NativePluginDescriptor pingpongpanDesc = { static const NativePluginDescriptor pingpongpanDesc = {
/* category */ NATIVE_PLUGIN_CATEGORY_UTILITY, /* category */ NATIVE_PLUGIN_CATEGORY_UTILITY,
#ifdef HAVE_DGL #ifdef HAVE_DGL
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE|NATIVE_PLUGIN_HAS_UI|NATIVE_PLUGIN_USES_PARENT_ID),
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE|NATIVE_PLUGIN_HAS_UI|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD|NATIVE_PLUGIN_USES_PARENT_ID),
#else #else
/* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE), /* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_RTSAFE),
#endif #endif


+ 0
- 7
source/plugin/carla-lv2-export.cpp View File

@@ -31,7 +31,6 @@
#include "lv2/ui.h" #include "lv2/ui.h"
#include "lv2/units.h" #include "lv2/units.h"
#include "lv2/urid.h" #include "lv2/urid.h"
#include "lv2/worker.h"
#include "lv2/lv2_external_ui.h" #include "lv2/lv2_external_ui.h"
#include "lv2/lv2_programs.h" #include "lv2/lv2_programs.h"


@@ -261,9 +260,6 @@ static void writePluginFile(const NativePluginDescriptor* const pluginDesc)
if (pluginDesc->hints & NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS) if (pluginDesc->hints & NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS)
text += " <" LV2_BUF_SIZE__fixedBlockLength "> ,\n"; text += " <" LV2_BUF_SIZE__fixedBlockLength "> ,\n";


if (pluginDesc->hints & NATIVE_PLUGIN_NEEDS_DSP_IDLE)
text += " <" LV2_WORKER__schedule "> ,\n";

text += " <" LV2_OPTIONS__options "> ,\n"; text += " <" LV2_OPTIONS__options "> ,\n";
text += " <" LV2_URID__map "> ;\n"; text += " <" LV2_URID__map "> ;\n";
text += "\n"; text += "\n";
@@ -276,9 +272,6 @@ static void writePluginFile(const NativePluginDescriptor* const pluginDesc)
if (pluginDesc->hints & NATIVE_PLUGIN_USES_STATE) if (pluginDesc->hints & NATIVE_PLUGIN_USES_STATE)
text += " lv2:extensionData <" LV2_STATE__interface "> ;"; text += " lv2:extensionData <" LV2_STATE__interface "> ;";


if (pluginDesc->hints & NATIVE_PLUGIN_NEEDS_DSP_IDLE)
text += " lv2:extensionData <" LV2_WORKER__interface "> ;";

if (pluginDesc->category != NATIVE_PLUGIN_CATEGORY_SYNTH) if (pluginDesc->category != NATIVE_PLUGIN_CATEGORY_SYNTH)
text += " lv2:extensionData <" LV2_PROGRAMS__Interface "> ;\n"; text += " lv2:extensionData <" LV2_PROGRAMS__Interface "> ;\n";




+ 1
- 74
source/plugin/carla-lv2.cpp View File

@@ -83,12 +83,10 @@ public:
fMidiEventCount(0), fMidiEventCount(0),
fTimeInfo(), fTimeInfo(),
fLastTimeSpeed(0.0), fLastTimeSpeed(0.0),
fIsFirstRun(true),
fIsProcessing(false), fIsProcessing(false),
fBufferSize(0), fBufferSize(0),
fSampleRate(sampleRate), fSampleRate(sampleRate),
fUridMap(nullptr), fUridMap(nullptr),
fWorker(nullptr),
fURIs(), fURIs(),
fUI(), fUI(),
fPorts(), fPorts(),
@@ -126,7 +124,6 @@ public:
const LV2_Options_Option* options = nullptr; const LV2_Options_Option* options = nullptr;
const LV2_URID_Map* uridMap = nullptr; const LV2_URID_Map* uridMap = nullptr;
const LV2_URID_Unmap* uridUnmap = nullptr; const LV2_URID_Unmap* uridUnmap = nullptr;
const LV2_Worker_Schedule* worker = nullptr;


for (int i=0; features[i] != nullptr; ++i) for (int i=0; features[i] != nullptr; ++i)
{ {
@@ -136,8 +133,6 @@ public:
uridMap = (const LV2_URID_Map*)features[i]->data; uridMap = (const LV2_URID_Map*)features[i]->data;
else if (std::strcmp(features[i]->URI, LV2_URID__unmap) == 0) else if (std::strcmp(features[i]->URI, LV2_URID__unmap) == 0)
uridUnmap = (const LV2_URID_Unmap*)features[i]->data; uridUnmap = (const LV2_URID_Unmap*)features[i]->data;
else if (std::strcmp(features[i]->URI, LV2_WORKER__schedule) == 0)
worker = (const LV2_Worker_Schedule*)features[i]->data;
} }


if (options == nullptr || uridMap == nullptr) if (options == nullptr || uridMap == nullptr)
@@ -145,11 +140,6 @@ public:
carla_stderr("Host doesn't provide option or urid-map features"); carla_stderr("Host doesn't provide option or urid-map features");
return; return;
} }
if (worker == nullptr && (fDescriptor->hints & NATIVE_PLUGIN_NEEDS_DSP_IDLE) != 0)
{
carla_stderr("Host doesn't provide worker feature");
return;
}


for (int i=0; options[i].key != 0; ++i) for (int i=0; options[i].key != 0; ++i)
{ {
@@ -175,7 +165,6 @@ public:
} }


fUridMap = uridMap; fUridMap = uridMap;
fWorker = worker;


if (fDescriptor->midiIns > 0) if (fDescriptor->midiIns > 0)
fUI.portOffset += desc->midiIns; fUI.portOffset += desc->midiIns;
@@ -245,8 +234,6 @@ public:
fDescriptor->activate(fHandle); fDescriptor->activate(fHandle);


carla_zeroStruct<NativeTimeInfo>(fTimeInfo); carla_zeroStruct<NativeTimeInfo>(fTimeInfo);

fIsFirstRun = true;
} }


void lv2_deactivate() void lv2_deactivate()
@@ -543,17 +530,6 @@ public:
// TODO - midi out // TODO - midi out


updateParameterOutputs(); updateParameterOutputs();

if (! fIsFirstRun)
return;

fIsFirstRun = false;

if (fDescriptor->hints & NATIVE_PLUGIN_NEEDS_DSP_IDLE)
{
CARLA_SAFE_ASSERT_RETURN(fWorker != nullptr,);
fWorker->schedule_work(fWorker->handle, 5, "idle");
}
} }


// ------------------------------------------------------------------- // -------------------------------------------------------------------
@@ -674,38 +650,6 @@ public:
return LV2_STATE_SUCCESS; return LV2_STATE_SUCCESS;
} }


// This is called from the LV2 worker thread (non-RT), as requested from the "run()" function.
LV2_Worker_Status lv2_work(const LV2_Worker_Respond_Function respond, const LV2_Worker_Respond_Handle handle, const uint32_t size, const void* const data)
{
CARLA_SAFE_ASSERT_RETURN(size == 5, LV2_WORKER_ERR_UNKNOWN);
CARLA_SAFE_ASSERT_RETURN(data != nullptr, LV2_WORKER_ERR_UNKNOWN);
CARLA_SAFE_ASSERT_RETURN(respond != nullptr, LV2_WORKER_ERR_UNKNOWN);

const char* const msg((const char*)data);
CARLA_SAFE_ASSERT_RETURN(std::strcmp(msg, "idle") == 0, LV2_WORKER_ERR_UNKNOWN);

if (fDescriptor->idle != nullptr)
fDescriptor->idle(fHandle);

respond(handle, 6, "idled");

return LV2_WORKER_SUCCESS;
}

// This is called from the LV2 process thread (RT)
LV2_Worker_Status lv2_work_response(const uint32_t size, const void* const body)
{
CARLA_SAFE_ASSERT_RETURN(size == 6, LV2_WORKER_ERR_UNKNOWN);
CARLA_SAFE_ASSERT_RETURN(body != nullptr, LV2_WORKER_ERR_UNKNOWN);

const char* const msg((const char*)body);
CARLA_SAFE_ASSERT_RETURN(std::strcmp(msg, "idled") == 0, LV2_WORKER_ERR_UNKNOWN);

fWorker->schedule_work(fWorker->handle, 5, "idle");

return LV2_WORKER_SUCCESS;
}

// ------------------------------------------------------------------- // -------------------------------------------------------------------


void lv2ui_instantiate(LV2UI_Write_Function writeFunction, LV2UI_Controller controller, LV2UI_Widget* widget, const LV2_Feature* const* features) void lv2ui_instantiate(LV2UI_Write_Function writeFunction, LV2UI_Controller controller, LV2UI_Widget* widget, const LV2_Feature* const* features)
@@ -987,15 +931,13 @@ private:
NativeTimeInfo fTimeInfo; NativeTimeInfo fTimeInfo;
double fLastTimeSpeed; double fLastTimeSpeed;


bool fIsFirstRun; // first run after activate
bool fIsProcessing; bool fIsProcessing;


// Lv2 host data // Lv2 host data
uint32_t fBufferSize; uint32_t fBufferSize;
double fSampleRate; double fSampleRate;


const LV2_URID_Map* fUridMap;
const LV2_Worker_Schedule* fWorker;
const LV2_URID_Map* fUridMap;


struct URIDs { struct URIDs {
LV2_URID atomBlank; LV2_URID atomBlank;
@@ -1467,18 +1409,6 @@ static LV2_State_Status lv2_restore(LV2_Handle instance, LV2_State_Retrieve_Func
return instancePtr->lv2_restore(retrieve, handle, flags, features); return instancePtr->lv2_restore(retrieve, handle, flags, features);
} }


static LV2_Worker_Status lv2_work(LV2_Handle instance, LV2_Worker_Respond_Function respond, LV2_Worker_Respond_Handle handle, uint32_t size, const void* data)
{
carla_debug("lv2_work(%p, %p, %p, %i, %p)", instance, respond, handle, size, data);
return instancePtr->lv2_work(respond, handle, size, data);
}

static LV2_Worker_Status lv2_work_response(LV2_Handle instance, uint32_t size, const void* body)
{
carla_debug("lv2_work_response(%p, %i, %p)", instance, size, body);
return instancePtr->lv2_work_response(size, body);
}

static const void* lv2_extension_data(const char* uri) static const void* lv2_extension_data(const char* uri)
{ {
carla_debug("lv2_extension_data(\"%s\")", uri); carla_debug("lv2_extension_data(\"%s\")", uri);
@@ -1486,7 +1416,6 @@ static const void* lv2_extension_data(const char* uri)
static const LV2_Options_Interface options = { lv2_get_options, lv2_set_options }; static const LV2_Options_Interface options = { lv2_get_options, lv2_set_options };
static const LV2_Programs_Interface programs = { lv2_get_program, lv2_select_program }; static const LV2_Programs_Interface programs = { lv2_get_program, lv2_select_program };
static const LV2_State_Interface state = { lv2_save, lv2_restore }; static const LV2_State_Interface state = { lv2_save, lv2_restore };
static const LV2_Worker_Interface worker = { lv2_work, lv2_work_response, nullptr };


if (std::strcmp(uri, LV2_OPTIONS__interface) == 0) if (std::strcmp(uri, LV2_OPTIONS__interface) == 0)
return &options; return &options;
@@ -1494,8 +1423,6 @@ static const void* lv2_extension_data(const char* uri)
return &programs; return &programs;
if (std::strcmp(uri, LV2_STATE__interface) == 0) if (std::strcmp(uri, LV2_STATE__interface) == 0)
return &state; return &state;
if (std::strcmp(uri, LV2_WORKER__interface) == 0)
return &worker;


return nullptr; return nullptr;
} }


+ 1
- 8
source/plugin/carla-vst.cpp View File

@@ -44,7 +44,6 @@ namespace juce {
#define effGetChunk 23 #define effGetChunk 23
#define effSetChunk 24 #define effSetChunk 24
#define effGetPlugCategory 35 #define effGetPlugCategory 35
#define effIdle 53
#define kPlugCategEffect 1 #define kPlugCategEffect 1
#define kPlugCategSynth 2 #define kPlugCategSynth 2
#define kVstVersion 2400 #define kVstVersion 2400
@@ -185,11 +184,6 @@ public:


switch (opcode) switch (opcode)
{ {
case effIdle:
if (fDescriptor->idle != nullptr)
fDescriptor->idle(fHandle);
break;

case effSetSampleRate: case effSetSampleRate:
if (carla_compareFloats(fSampleRate, static_cast<double>(opt))) if (carla_compareFloats(fSampleRate, static_cast<double>(opt)))
return 0; return 0;
@@ -216,8 +210,7 @@ public:
fMidiEventCount = 0; fMidiEventCount = 0;
carla_zeroStruct<NativeTimeInfo>(fTimeInfo); carla_zeroStruct<NativeTimeInfo>(fTimeInfo);


// tell host we want idle and MIDI events
fAudioMaster(fEffect, audioMasterNeedIdle, 0, 0, nullptr, 0.0f);
// tell host we want MIDI events
fAudioMaster(fEffect, audioMasterWantMidi, 0, 0, nullptr, 0.0f); fAudioMaster(fEffect, audioMasterWantMidi, 0, 0, nullptr, 0.0f);


CARLA_SAFE_ASSERT_BREAK(! fIsActive); CARLA_SAFE_ASSERT_BREAK(! fIsActive);


Loading…
Cancel
Save