|
@@ -1,6 +1,6 @@ |
|
|
/* |
|
|
/* |
|
|
* Carla Plugin Host |
|
|
* Carla Plugin Host |
|
|
* Copyright (C) 2011-2022 Filipe Coelho <falktx@falktx.com> |
|
|
|
|
|
|
|
|
* Copyright (C) 2011-2023 Filipe Coelho <falktx@falktx.com> |
|
|
* |
|
|
* |
|
|
* This program is free software; you can redistribute it and/or |
|
|
* This program is free software; you can redistribute it and/or |
|
|
* modify it under the terms of the GNU General Public License as |
|
|
* modify it under the terms of the GNU General Public License as |
|
@@ -147,6 +147,7 @@ public: |
|
|
fClosingDown(false), |
|
|
fClosingDown(false), |
|
|
fIsOffline(false), |
|
|
fIsOffline(false), |
|
|
fFirstIdle(true), |
|
|
fFirstIdle(true), |
|
|
|
|
|
fBridgeVersion(0), |
|
|
fLastPingTime(-1) |
|
|
fLastPingTime(-1) |
|
|
{ |
|
|
{ |
|
|
carla_debug("CarlaEngineBridge::CarlaEngineBridge(\"%s\", \"%s\", \"%s\", \"%s\")", audioPoolBaseName, rtClientBaseName, nonRtClientBaseName, nonRtServerBaseName); |
|
|
carla_debug("CarlaEngineBridge::CarlaEngineBridge(\"%s\", \"%s\", \"%s\", \"%s\")", audioPoolBaseName, rtClientBaseName, nonRtClientBaseName, nonRtServerBaseName); |
|
@@ -436,6 +437,8 @@ public: |
|
|
fShmNonRtServerControl.commitWrite(); |
|
|
fShmNonRtServerControl.commitWrite(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fShmNonRtServerControl.waitIfDataIsReachingLimit(); |
|
|
|
|
|
|
|
|
// kPluginBridgeNonRtServerAudioCount |
|
|
// kPluginBridgeNonRtServerAudioCount |
|
|
{ |
|
|
{ |
|
|
const uint32_t aIns = plugin->getAudioInCount(); |
|
|
const uint32_t aIns = plugin->getAudioInCount(); |
|
@@ -830,9 +833,9 @@ public: |
|
|
break; |
|
|
break; |
|
|
|
|
|
|
|
|
case kPluginBridgeNonRtClientVersion: { |
|
|
case kPluginBridgeNonRtClientVersion: { |
|
|
const uint apiVersion = fShmNonRtServerControl.readUInt(); |
|
|
|
|
|
CARLA_SAFE_ASSERT_UINT2(apiVersion >= CARLA_PLUGIN_BRIDGE_API_VERSION_MINIMUM, |
|
|
|
|
|
apiVersion, CARLA_PLUGIN_BRIDGE_API_VERSION_MINIMUM); |
|
|
|
|
|
|
|
|
fBridgeVersion = fShmNonRtServerControl.readUInt(); |
|
|
|
|
|
CARLA_SAFE_ASSERT_UINT2(fBridgeVersion >= CARLA_PLUGIN_BRIDGE_API_VERSION_MINIMUM, |
|
|
|
|
|
fBridgeVersion, CARLA_PLUGIN_BRIDGE_API_VERSION_MINIMUM); |
|
|
} break; |
|
|
} break; |
|
|
|
|
|
|
|
|
case kPluginBridgeNonRtClientPing: { |
|
|
case kPluginBridgeNonRtClientPing: { |
|
@@ -918,6 +921,8 @@ public: |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
case kPluginBridgeNonRtClientSetCustomData: { |
|
|
case kPluginBridgeNonRtClientSetCustomData: { |
|
|
|
|
|
const uint32_t maxLocalValueLen = fBridgeVersion >= 10 ? 4096 : 16384; |
|
|
|
|
|
|
|
|
// type |
|
|
// type |
|
|
const BridgeTextReader type(fShmNonRtClientControl); |
|
|
const BridgeTextReader type(fShmNonRtClientControl); |
|
|
|
|
|
|
|
@@ -929,7 +934,7 @@ public: |
|
|
|
|
|
|
|
|
if (valueSize > 0) |
|
|
if (valueSize > 0) |
|
|
{ |
|
|
{ |
|
|
if (valueSize > 16384) |
|
|
|
|
|
|
|
|
if (valueSize > maxLocalValueLen) |
|
|
{ |
|
|
{ |
|
|
const BridgeTextReader bigValueFilePathTry(fShmNonRtClientControl, valueSize); |
|
|
const BridgeTextReader bigValueFilePathTry(fShmNonRtClientControl, valueSize); |
|
|
|
|
|
|
|
@@ -1081,6 +1086,8 @@ public: |
|
|
|
|
|
|
|
|
plugin->prepareForSave(false); |
|
|
plugin->prepareForSave(false); |
|
|
|
|
|
|
|
|
|
|
|
const uint32_t maxLocalValueLen = fBridgeVersion >= 10 ? 4096 : 16384; |
|
|
|
|
|
|
|
|
for (uint32_t i=0, count=plugin->getCustomDataCount(); i<count; ++i) |
|
|
for (uint32_t i=0, count=plugin->getCustomDataCount(); i<count; ++i) |
|
|
{ |
|
|
{ |
|
|
const CustomData& cdata(plugin->getCustomData(i)); |
|
|
const CustomData& cdata(plugin->getCustomData(i)); |
|
@@ -1092,12 +1099,12 @@ public: |
|
|
const uint32_t keyLen = static_cast<uint32_t>(std::strlen(cdata.key)); |
|
|
const uint32_t keyLen = static_cast<uint32_t>(std::strlen(cdata.key)); |
|
|
const uint32_t valueLen = static_cast<uint32_t>(std::strlen(cdata.value)); |
|
|
const uint32_t valueLen = static_cast<uint32_t>(std::strlen(cdata.value)); |
|
|
|
|
|
|
|
|
if (valueLen > 16384) |
|
|
|
|
|
fShmNonRtServerControl.waitIfDataIsReachingLimit(); |
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
{ |
|
|
const CarlaMutexLocker _cml(fShmNonRtServerControl.mutex); |
|
|
const CarlaMutexLocker _cml(fShmNonRtServerControl.mutex); |
|
|
|
|
|
|
|
|
|
|
|
if (valueLen > maxLocalValueLen) |
|
|
|
|
|
fShmNonRtServerControl.waitIfDataIsReachingLimit(); |
|
|
|
|
|
|
|
|
fShmNonRtServerControl.writeOpcode(kPluginBridgeNonRtServerSetCustomData); |
|
|
fShmNonRtServerControl.writeOpcode(kPluginBridgeNonRtServerSetCustomData); |
|
|
|
|
|
|
|
|
fShmNonRtServerControl.writeUInt(typeLen); |
|
|
fShmNonRtServerControl.writeUInt(typeLen); |
|
@@ -1110,7 +1117,7 @@ public: |
|
|
|
|
|
|
|
|
if (valueLen > 0) |
|
|
if (valueLen > 0) |
|
|
{ |
|
|
{ |
|
|
if (valueLen > 16384) |
|
|
|
|
|
|
|
|
if (valueLen > maxLocalValueLen) |
|
|
{ |
|
|
{ |
|
|
String filePath(File::getSpecialLocation(File::tempDirectory).getFullPathName()); |
|
|
String filePath(File::getSpecialLocation(File::tempDirectory).getFullPathName()); |
|
|
|
|
|
|
|
@@ -1136,9 +1143,8 @@ public: |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
fShmNonRtServerControl.commitWrite(); |
|
|
fShmNonRtServerControl.commitWrite(); |
|
|
|
|
|
fShmNonRtServerControl.waitIfDataIsReachingLimit(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
fShmNonRtServerControl.waitIfDataIsReachingLimit(); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (plugin->getOptionsEnabled() & PLUGIN_OPTION_USE_CHUNKS) |
|
|
if (plugin->getOptionsEnabled() & PLUGIN_OPTION_USE_CHUNKS) |
|
@@ -1678,6 +1684,7 @@ private: |
|
|
bool fClosingDown; |
|
|
bool fClosingDown; |
|
|
bool fIsOffline; |
|
|
bool fIsOffline; |
|
|
bool fFirstIdle; |
|
|
bool fFirstIdle; |
|
|
|
|
|
uint32_t fBridgeVersion; |
|
|
int64_t fLastPingTime; |
|
|
int64_t fLastPingTime; |
|
|
|
|
|
|
|
|
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CarlaEngineBridge) |
|
|
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CarlaEngineBridge) |
|
|