@@ -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"; | 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. | * Property type URI. | ||||
*/ | */ | ||||
@@ -1536,6 +1536,19 @@ public: | |||||
CARLA_SAFE_ASSERT_RETURN(value != nullptr,); | CARLA_SAFE_ASSERT_RETURN(value != nullptr,); | ||||
carla_debug("CarlaPluginLV2::setCustomData(%s, %s, %s, %s)", type, key, value, bool2str(sendGui)); | 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) | if (std::strcmp(type, CUSTOM_DATA_TYPE_PROPERTY) == 0) | ||||
return CarlaPlugin::setCustomData(type, key, value, sendGui); | return CarlaPlugin::setCustomData(type, key, value, sendGui); | ||||
@@ -795,8 +795,16 @@ public: | |||||
if (std::strcmp(type, CUSTOM_DATA_TYPE_PROPERTY) == 0) | if (std::strcmp(type, CUSTOM_DATA_TYPE_PROPERTY) == 0) | ||||
return CarlaPlugin::setCustomData(type, key, value, sendGui); | 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) | if (std::strcmp(type, CUSTOM_DATA_TYPE_CHUNK) == 0) | ||||
{ | { | ||||