Browse Source

Fixes for carla-single under ladish, print state messages on start

tags/v1.9.9
falkTX 6 years ago
parent
commit
3e126f2592
3 changed files with 21 additions and 5 deletions
  1. +6
    -1
      data/carla-single
  2. +12
    -2
      source/bridges-plugin/CarlaBridgePlugin.cpp
  3. +3
    -2
      source/modules/water/files/File.cpp

+ 6
- 1
data/carla-single View File

@@ -127,8 +127,13 @@ else:
# Set label (optional)

if len(sys.argv) > arg:
if FORMAT in ("internal", "lv2"):
if FORMAT == "internal":
print("label/uri already set, ignoring 2nd label")
elif FORMAT == "lv2":
newpwd = sys.argv[arg]
if os.path.exists(newpwd):
print("using path hack for lv2 plugin")
os.chdir(newpwd)
else:
LABEL = sys.argv[arg]
arg += 1


+ 12
- 2
source/bridges-plugin/CarlaBridgePlugin.cpp View File

@@ -169,8 +169,18 @@ public:
if (! File::isAbsolutePath(gProjectFilename))
gProjectFilename = File::getCurrentWorkingDirectory().getChildFile(gProjectFilename).getFullPathName();

if (File(gProjectFilename).existsAsFile() && ! carla_load_plugin_state(0, gProjectFilename.toRawUTF8()))
carla_stderr("Plugin preset load failed, error was:\n%s", carla_get_last_error());
if (File(gProjectFilename).existsAsFile())
{
if (carla_load_plugin_state(0, gProjectFilename.toRawUTF8()))
carla_stdout("Plugin state loaded sucessfully");
else
carla_stderr("Plugin state load failed, error was:\n%s", carla_get_last_error());
}
else
{
carla_stdout("Previous plugin state in '%s' is non-existent, will start from default state",
gProjectFilename.toRawUTF8());
}
}

gIsInitiated = true;


+ 3
- 2
source/modules/water/files/File.cpp View File

@@ -1327,11 +1327,12 @@ File File::getCurrentWorkingDirectory()
char localBuffer [1024];
char* cwd = getcwd (localBuffer, sizeof (localBuffer) - 1);
size_t bufferSize = 4096;
size_t bufferSize = 4096;
while (cwd == nullptr && errno == ERANGE)
{
heapBuffer.malloc (bufferSize);
CARLA_SAFE_ASSERT_RETURN(heapBuffer.malloc (bufferSize), File());
cwd = getcwd (heapBuffer, bufferSize - 1);
bufferSize += 1024;
}


Loading…
Cancel
Save