Browse Source

Small bridge fixes

Fixes #549
tags/1.9.8
falkTX 7 years ago
parent
commit
07d5360c9e
7 changed files with 40 additions and 19 deletions
  1. +2
    -4
      source/backend/engine/CarlaEngine.cpp
  2. +2
    -3
      source/backend/engine/CarlaEngineBridge.cpp
  3. +1
    -1
      source/backend/plugin/CarlaPluginBridge.cpp
  4. +2
    -0
      source/discovery/carla-discovery.cpp
  5. +21
    -11
      source/modules/water/files/File.cpp
  6. +10
    -0
      source/utils/CarlaBridgeUtils.cpp
  7. +2
    -0
      source/utils/CarlaBridgeUtils.hpp

+ 2
- 4
source/backend/engine/CarlaEngine.cpp View File

@@ -358,15 +358,13 @@ bool CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype,

if (bridgeBinary.isNotEmpty())
{
#ifndef CARLA_OS_WIN
if (btype == BINARY_NATIVE)
{
#ifdef CARLA_OS_WIN
bridgeBinary += CARLA_OS_SEP_STR "carla-bridge-native.exe";
#else
bridgeBinary += CARLA_OS_SEP_STR "carla-bridge-native";
#endif
}
else
#endif
{
switch (btype)
{


+ 2
- 3
source/backend/engine/CarlaEngineBridge.cpp View File

@@ -871,9 +871,8 @@ public:

String filePath(File::getSpecialLocation(File::tempDirectory).getFullPathName());

filePath += CARLA_OS_SEP_STR;
filePath += ".CarlaChunk_";
filePath += fShmNonRtClientControl.filename.buffer() + 24;
filePath += CARLA_OS_SEP_STR ".CarlaChunk_";
filePath += fShmAudioPool.getFilenameSuffix();

if (File(filePath).replaceWithText(dataBase64.buffer()))
{


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

@@ -758,7 +758,7 @@ public:
String filePath(File::getSpecialLocation(File::tempDirectory).getFullPathName());

filePath += CARLA_OS_SEP_STR ".CarlaChunk_";
filePath += fShmAudioPool.filename.buffer() + 18;
filePath += fShmAudioPool.getFilenameSuffix();

if (File(filePath).replaceWithText(dataBase64.buffer()))
{


+ 2
- 0
source/discovery/carla-discovery.cpp View File

@@ -140,6 +140,8 @@ static intptr_t vstHostCanDo(const char* const feature)
return 1;
if (std::strcmp(feature, "shellCategory") == 0)
return 1;
if (std::strcmp(feature, "NIMKPIVendorSpecificCallbacks") == 0)
return -1;

// non-official features found in some plugins:
// "asyncProcessing"


+ 21
- 11
source/modules/water/files/File.cpp View File

@@ -148,16 +148,26 @@ String File::parseAbsolutePath (const String& p)
{
if (path[1] != separator)
{
/* When you supply a raw string to the File object constructor, it must be an absolute path.
If you're trying to parse a string that may be either a relative path or an absolute path,
you MUST provide a context against which the partial path can be evaluated - you can do
this by simply using File::getChildFile() instead of the File constructor. E.g. saying
"File::getCurrentWorkingDirectory().getChildFile (myUnknownPath)" would return an absolute
path if that's what was supplied, or would evaluate a partial path relative to the CWD.
*/
jassertfalse;
// Check if path is valid under Wine
String testpath ("Z:" + path);
path = File::getCurrentWorkingDirectory().getFullPathName().substring (0, 2) + path;
if (File(testpath).exists())
{
path = testpath;
}
else
{
/* When you supply a raw string to the File object constructor, it must be an absolute path.
If you're trying to parse a string that may be either a relative path or an absolute path,
you MUST provide a context against which the partial path can be evaluated - you can do
this by simply using File::getChildFile() instead of the File constructor. E.g. saying
"File::getCurrentWorkingDirectory().getChildFile (myUnknownPath)" would return an absolute
path if that's what was supplied, or would evaluate a partial path relative to the CWD.
*/
carla_safe_assert(testpath.toRawUTF8(), __FILE__, __LINE__);
path = File::getCurrentWorkingDirectory().getFullPathName().substring (0, 2) + path;
}
}
}
else if (! path.containsChar (':'))
@@ -169,7 +179,7 @@ String File::parseAbsolutePath (const String& p)
"File::getCurrentWorkingDirectory().getChildFile (myUnknownPath)" would return an absolute
path if that's what was supplied, or would evaluate a partial path relative to the CWD.
*/
jassertfalse;
carla_safe_assert(path.toRawUTF8(), __FILE__, __LINE__);
return File::getCurrentWorkingDirectory().getChildFile (path).getFullPathName();
}
@@ -746,7 +756,7 @@ bool File::appendText (const String& text,
const bool writeUnicodeHeaderBytes) const
{
FileOutputStream out (*this);
CARLA_SAFE_ASSERT_RETURN(out.failedToOpen(), false);
CARLA_SAFE_ASSERT (out.failedToOpen());
out.writeText (text, asUnicode, writeUnicodeHeaderBytes);
return true;


+ 10
- 0
source/utils/CarlaBridgeUtils.cpp View File

@@ -135,6 +135,16 @@ void BridgeAudioPool::resize(const uint32_t bufferSize, const uint32_t audioPort
std::memset(data, 0, dataSize);
}

const char* BridgeAudioPool::getFilenameSuffix() const noexcept
{
CARLA_SAFE_ASSERT_RETURN(filename.isNotEmpty(), nullptr);

const std::size_t prefixLength(std::strlen(PLUGIN_BRIDGE_NAMEPREFIX_AUDIO_POOL));
CARLA_SAFE_ASSERT_RETURN(filename.length() > prefixLength, nullptr);

return filename.buffer() + prefixLength;
}

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

BridgeRtClientControl::BridgeRtClientControl() noexcept


+ 2
- 0
source/utils/CarlaBridgeUtils.hpp View File

@@ -217,6 +217,8 @@ struct BridgeAudioPool {

void resize(const uint32_t bufferSize, const uint32_t audioPortCount, const uint32_t cvPortCount) noexcept;

const char* getFilenameSuffix() const noexcept;

CARLA_DECLARE_NON_COPY_STRUCT(BridgeAudioPool)
};



Loading…
Cancel
Save