Browse Source

Misc tweaks

tags/1.9.7
falkTX 9 years ago
parent
commit
952edd5aec
2 changed files with 15 additions and 12 deletions
  1. +4
    -1
      source/backend/plugin/CarlaPluginBridge.cpp
  2. +11
    -11
      source/backend/plugin/CarlaPluginVST2.cpp

+ 4
- 1
source/backend/plugin/CarlaPluginBridge.cpp View File

@@ -928,13 +928,16 @@ public:


// TODO: only wait 1 minute for NI plugins // TODO: only wait 1 minute for NI plugins
const uint32_t timeoutEnd(Time::getMillisecondCounter() + 60*1000); // 60 secs, 1 minute const uint32_t timeoutEnd(Time::getMillisecondCounter() + 60*1000); // 60 secs, 1 minute
const bool needsEngineIdle(pData->engine->getType() != kEngineTypePlugin);


carla_stdout("CarlaPluginBridge::waitForSaved() - now waiting..."); carla_stdout("CarlaPluginBridge::waitForSaved() - now waiting...");


for (; Time::getMillisecondCounter() < timeoutEnd && fBridgeThread.isThreadRunning();) for (; Time::getMillisecondCounter() < timeoutEnd && fBridgeThread.isThreadRunning();)
{ {
pData->engine->callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0.0f, nullptr); pData->engine->callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0.0f, nullptr);
pData->engine->idle();

if (needsEngineIdle)
pData->engine->idle();


if (fSaved) if (fSaved)
break; break;


+ 11
- 11
source/backend/plugin/CarlaPluginVST2.cpp View File

@@ -64,6 +64,7 @@ public:
fNeedIdle(false), fNeedIdle(false),
fLastChunk(nullptr), fLastChunk(nullptr),
fIsProcessing(false), fIsProcessing(false),
fMainThread(pthread_self()),
#ifdef PTW32_DLLPORT #ifdef PTW32_DLLPORT
fProcThread({nullptr, 0}), fProcThread({nullptr, 0}),
#else #else
@@ -82,13 +83,6 @@ public:
for (ushort i=0; i < kPluginMaxMidiEvents*2; ++i) for (ushort i=0; i < kPluginMaxMidiEvents*2; ++i)
fEvents.data[i] = (VstEvent*)&fMidiEvents[i]; fEvents.data[i] = (VstEvent*)&fMidiEvents[i];


#ifdef CARLA_OS_WIN
fProcThread.p = nullptr;
fProcThread.x = 0;
#else
fProcThread = 0;
#endif

// make plugin valid // make plugin valid
srand(id); srand(id);
fUnique1 = fUnique2 = rand(); fUnique1 = fUnique2 = rand();
@@ -1733,8 +1727,13 @@ protected:
break; break;


case audioMasterIdle: case audioMasterIdle:
//pData->engine->callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0.0f, nullptr);
//pData->engine->idle();
if (pthread_equal(pthread_self(), fMainThread))
{
pData->engine->callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0.0f, nullptr);

if (pData->engine->getType() != kEngineTypePlugin)
pData->engine->idle();
}
break; break;


#if ! VST_FORCE_DEPRECATED #if ! VST_FORCE_DEPRECATED
@@ -2219,6 +2218,7 @@ private:
void* fLastChunk; void* fLastChunk;


bool fIsProcessing; bool fIsProcessing;
pthread_t fMainThread;
pthread_t fProcThread; pthread_t fProcThread;


struct FixedVstEvents { struct FixedVstEvents {
@@ -2300,9 +2300,9 @@ private:
if (std::strcmp(feature, "startStopProcess") == 0) if (std::strcmp(feature, "startStopProcess") == 0)
return 1; return 1;
if (std::strcmp(feature, "supportShell") == 0) if (std::strcmp(feature, "supportShell") == 0)
return -1;
return 1;
if (std::strcmp(feature, "shellCategory") == 0) if (std::strcmp(feature, "shellCategory") == 0)
return -1;
return 1;


// unimplemented // unimplemented
carla_stderr("carla_vst_hostCanDo(\"%s\") - unknown feature", feature); carla_stderr("carla_vst_hostCanDo(\"%s\") - unknown feature", feature);


Loading…
Cancel
Save