Browse Source

Define CUSTOM_DATA_TYPE_PATH and allow it for LV2 as custom data

tags/v2.4.2
falkTX 2 years ago
parent
commit
1dbaf85816
3 changed files with 28 additions and 2 deletions
  1. +5
    -0
      source/backend/CarlaBackend.h
  2. +13
    -0
      source/backend/plugin/CarlaPluginLV2.cpp
  3. +10
    -2
      source/backend/plugin/CarlaPluginNative.cpp

+ 5
- 0
source/backend/CarlaBackend.h View File

@@ -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.
*/


+ 13
- 0
source/backend/plugin/CarlaPluginLV2.cpp View File

@@ -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);



+ 10
- 2
source/backend/plugin/CarlaPluginNative.cpp View File

@@ -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)
{


Loading…
Cancel
Save