diff --git a/source/backend/CarlaBackend.h b/source/backend/CarlaBackend.h index a7fb155cf..0283a1eaf 100644 --- a/source/backend/CarlaBackend.h +++ b/source/backend/CarlaBackend.h @@ -463,6 +463,11 @@ static const char* const CUSTOM_DATA_TYPE_BOOLEAN = "http://kxstudio.sf.net/ns/c */ static const char* const CUSTOM_DATA_TYPE_CHUNK = "http://kxstudio.sf.net/ns/carla/chunk"; +/*! + * Path type URI. + */ +static const char* const CUSTOM_DATA_TYPE_PATH = "http://kxstudio.sf.net/ns/carla/path"; + /*! * Property type URI. */ diff --git a/source/backend/plugin/CarlaPluginLV2.cpp b/source/backend/plugin/CarlaPluginLV2.cpp index 9d38c3161..c54120a66 100644 --- a/source/backend/plugin/CarlaPluginLV2.cpp +++ b/source/backend/plugin/CarlaPluginLV2.cpp @@ -1536,6 +1536,19 @@ public: CARLA_SAFE_ASSERT_RETURN(value != nullptr,); carla_debug("CarlaPluginLV2::setCustomData(%s, %s, %s, %s)", type, key, value, bool2str(sendGui)); + if (std::strcmp(type, CUSTOM_DATA_TYPE_PATH) == 0) + { + if (std::strcmp(key, "file") != 0) + return; + + CARLA_SAFE_ASSERT_RETURN(fFilePathURI.isNotEmpty(),); + CARLA_SAFE_ASSERT_RETURN(value[0] != '\0',); + + carla_stdout("LV2 file path to send: '%s'", value); + writeAtomPath(value, getCustomURID(fFilePathURI)); + return; + } + if (std::strcmp(type, CUSTOM_DATA_TYPE_PROPERTY) == 0) return CarlaPlugin::setCustomData(type, key, value, sendGui); diff --git a/source/backend/plugin/CarlaPluginNative.cpp b/source/backend/plugin/CarlaPluginNative.cpp index a580af754..99cf4df91 100644 --- a/source/backend/plugin/CarlaPluginNative.cpp +++ b/source/backend/plugin/CarlaPluginNative.cpp @@ -795,8 +795,16 @@ public: if (std::strcmp(type, CUSTOM_DATA_TYPE_PROPERTY) == 0) return CarlaPlugin::setCustomData(type, key, value, sendGui); - if (std::strcmp(type, CUSTOM_DATA_TYPE_STRING) != 0 && std::strcmp(type, CUSTOM_DATA_TYPE_CHUNK) != 0) - return carla_stderr2("CarlaPluginNative::setCustomData(\"%s\", \"%s\", \"%s\", %s) - type is invalid", type, key, value, bool2str(sendGui)); + if (std::strcmp(type, CUSTOM_DATA_TYPE_PATH) == 0) + { + CARLA_SAFE_ASSERT_RETURN(std::strcmp(key, "file") == 0,); + CARLA_SAFE_ASSERT_RETURN(value[0] != '\0',); + } + else if (std::strcmp(type, CUSTOM_DATA_TYPE_STRING) != 0 && std::strcmp(type, CUSTOM_DATA_TYPE_CHUNK) != 0) + { + return carla_stderr2("CarlaPluginNative::setCustomData(\"%s\", \"%s\", \"%s\", %s) - type is invalid xa", + type, key, value, bool2str(sendGui)); + } if (std::strcmp(type, CUSTOM_DATA_TYPE_CHUNK) == 0) {