@@ -127,8 +127,13 @@ else: | |||||
# Set label (optional) | # Set label (optional) | ||||
if len(sys.argv) > arg: | if len(sys.argv) > arg: | ||||
if FORMAT in ("internal", "lv2"): | |||||
if FORMAT == "internal": | |||||
print("label/uri already set, ignoring 2nd label") | 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: | else: | ||||
LABEL = sys.argv[arg] | LABEL = sys.argv[arg] | ||||
arg += 1 | arg += 1 | ||||
@@ -169,8 +169,18 @@ public: | |||||
if (! File::isAbsolutePath(gProjectFilename)) | if (! File::isAbsolutePath(gProjectFilename)) | ||||
gProjectFilename = File::getCurrentWorkingDirectory().getChildFile(gProjectFilename).getFullPathName(); | 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; | gIsInitiated = true; | ||||
@@ -1327,11 +1327,12 @@ File File::getCurrentWorkingDirectory() | |||||
char localBuffer [1024]; | char localBuffer [1024]; | ||||
char* cwd = getcwd (localBuffer, sizeof (localBuffer) - 1); | char* cwd = getcwd (localBuffer, sizeof (localBuffer) - 1); | ||||
size_t bufferSize = 4096; | |||||
size_t bufferSize = 4096; | |||||
while (cwd == nullptr && errno == ERANGE) | while (cwd == nullptr && errno == ERANGE) | ||||
{ | { | ||||
heapBuffer.malloc (bufferSize); | |||||
CARLA_SAFE_ASSERT_RETURN(heapBuffer.malloc (bufferSize), File()); | |||||
cwd = getcwd (heapBuffer, bufferSize - 1); | cwd = getcwd (heapBuffer, bufferSize - 1); | ||||
bufferSize += 1024; | bufferSize += 1024; | ||||
} | } | ||||