Browse Source

Disable try-transient code in plugin bridges

tags/1.9.8
falkTX 8 years ago
parent
commit
8f5de5e0fe
9 changed files with 34 additions and 6 deletions
  1. +2
    -0
      source/backend/plugin/CarlaPlugin.cpp
  2. +5
    -1
      source/backend/plugin/CarlaPluginBridge.cpp
  3. +5
    -1
      source/backend/plugin/CarlaPluginDSSI.cpp
  4. +5
    -1
      source/backend/plugin/CarlaPluginInternal.cpp
  5. +3
    -1
      source/backend/plugin/CarlaPluginInternal.hpp
  6. +4
    -0
      source/backend/plugin/CarlaPluginLV2.cpp
  7. +5
    -1
      source/backend/plugin/CarlaPluginNative.cpp
  8. +2
    -0
      source/utils/CarlaPluginUI.cpp
  9. +3
    -1
      source/utils/CarlaPluginUI.hpp

+ 2
- 0
source/backend/plugin/CarlaPlugin.cpp View File

@@ -2198,6 +2198,7 @@ void CarlaPlugin::uiIdle()
pData->postUiEvents.data.clear();
}

#ifndef BUILD_BRIDGE
if (pData->transientTryCounter == 0)
return;
if (++pData->transientTryCounter % 10 != 0)
@@ -2216,6 +2217,7 @@ void CarlaPlugin::uiIdle()
pData->transientTryCounter = 0;
pData->transientFirstTry = false;
}
#endif
}

void CarlaPlugin::uiParameterChange(const uint32_t index, const float value) noexcept


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

@@ -1,6 +1,6 @@
/*
* Carla Plugin Bridge
* Copyright (C) 2011-2017 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2011-2018 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -391,9 +391,11 @@ public:
{
carla_debug("CarlaPluginBridge::~CarlaPluginBridge()");

#ifndef BUILD_BRIDGE
// close UI
if (pData->hints & PLUGIN_HAS_CUSTOM_UI)
pData->transientTryCounter = 0;
#endif

pData->singleMutex.lock();
pData->masterMutex.lock();
@@ -2175,7 +2177,9 @@ public:
break;

case kPluginBridgeNonRtServerUiClosed:
#ifndef BUILD_BRIDGE
pData->transientTryCounter = 0;
#endif
pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, pData->id, 0, 0, 0.0f, nullptr);
break;



+ 5
- 1
source/backend/plugin/CarlaPluginDSSI.cpp View File

@@ -1,6 +1,6 @@
/*
* Carla Plugin, DSSI implementation
* Copyright (C) 2011-2017 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2011-2018 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -669,7 +669,9 @@ public:
}
else
{
#ifndef BUILD_BRIDGE
pData->transientTryCounter = 0;
#endif

if (fOscData.target != nullptr)
{
@@ -2333,8 +2335,10 @@ public:
for (uint32_t i=0; i < pData->param.count; ++i)
osc_send_control(fOscData, pData->param.data[i].rindex, getParameterValue(i));

#ifndef BUILD_BRIDGE
if (pData->engine->getOptions().frontendWinId != 0)
pData->transientTryCounter = 1;
#endif

carla_stdout("CarlaPluginDSSI::updateOscData() - done");
}


+ 5
- 1
source/backend/plugin/CarlaPluginInternal.cpp View File

@@ -1,6 +1,6 @@
/*
* Carla Plugin
* Copyright (C) 2011-2014 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2011-2018 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -591,8 +591,10 @@ CarlaPlugin::ProtectedData::ProtectedData(CarlaEngine* const eng, const uint idx
uiLib(nullptr),
ctrlChannel(0),
extraHints(0x0),
#ifndef BUILD_BRIDGE
transientTryCounter(0),
transientFirstTry(true),
#endif
name(nullptr),
filename(nullptr),
iconName(nullptr),
@@ -620,7 +622,9 @@ CarlaPlugin::ProtectedData::ProtectedData(CarlaEngine* const eng, const uint idx
CarlaPlugin::ProtectedData::~ProtectedData() noexcept
{
CARLA_SAFE_ASSERT(! (active && needsReset));
#ifndef BUILD_BRIDGE
CARLA_SAFE_ASSERT(transientTryCounter == 0);
#endif

{
// mutex MUST have been locked before


+ 3
- 1
source/backend/plugin/CarlaPluginInternal.hpp View File

@@ -1,6 +1,6 @@
/*
* Carla Plugin
* Copyright (C) 2011-2014 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2011-2018 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -227,8 +227,10 @@ struct CarlaPlugin::ProtectedData {
// misc
int8_t ctrlChannel;
uint extraHints;
#ifndef BUILD_BRIDGE
uint transientTryCounter;
bool transientFirstTry;
#endif

// data 1
const char* name;


+ 4
- 0
source/backend/plugin/CarlaPluginLV2.cpp View File

@@ -1284,8 +1284,10 @@ public:

const uintptr_t frontendWinId(pData->engine->getOptions().frontendWinId);

#ifndef BUILD_BRIDGE
if (! yesNo)
pData->transientTryCounter = 0;
#endif

if (fUI.type == UI::TYPE_BRIDGE)
{
@@ -1575,7 +1577,9 @@ public:
fPipeServer.stopPipeServer(2000);
// fall through
case CarlaPipeServerLV2::UiCrashed:
#ifndef BUILD_BRIDGE
pData->transientTryCounter = 0;
#endif
pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, pData->id, 0, 0, 0.0f, nullptr);
break;
}


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

@@ -1,6 +1,6 @@
/*
* Carla Native Plugin
* Copyright (C) 2012-2017 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2012-2018 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -229,7 +229,9 @@ public:
if (fIsUiVisible && fDescriptor != nullptr && fDescriptor->ui_show != nullptr && fHandle != nullptr)
fDescriptor->ui_show(fHandle, false);

#ifndef BUILD_BRIDGE
pData->transientTryCounter = 0;
#endif
}

pData->singleMutex.lock();
@@ -751,7 +753,9 @@ public:

if (! yesNo)
{
#ifndef BUILD_BRIDGE
pData->transientTryCounter = 0;
#endif
return;
}



+ 2
- 0
source/utils/CarlaPluginUI.cpp View File

@@ -853,6 +853,7 @@ LRESULT CALLBACK wndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)

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

#ifndef BUILD_BRIDGE
bool CarlaPluginUI::tryTransientWinIdMatch(const uintptr_t pid, const char* const uiTitle, const uintptr_t winId, const bool centerUI)
{
CARLA_SAFE_ASSERT_RETURN(uiTitle != nullptr && uiTitle[0] != '\0', true);
@@ -1140,6 +1141,7 @@ bool CarlaPluginUI::tryTransientWinIdMatch(const uintptr_t pid, const char* cons
return true;
(void)pid; (void)centerUI;
}
#endif // BUILD_BRIDGE

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



+ 3
- 1
source/utils/CarlaPluginUI.hpp View File

@@ -1,6 +1,6 @@
/*
* Carla Plugin UI
* Copyright (C) 2014 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2014-2018 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -46,7 +46,9 @@ public:
virtual void* getDisplay() const noexcept = 0;
#endif

#ifndef BUILD_BRIDGE
static bool tryTransientWinIdMatch(const uintptr_t pid, const char* const uiTitle, const uintptr_t winId, const bool centerUI);
#endif

#ifdef CARLA_OS_MAC
static CarlaPluginUI* newCocoa(Callback*, uintptr_t, bool);


Loading…
Cancel
Save