Browse Source

Small correction to the check if LV2 UI is bridgeable

tags/1.9.7
falkTX 9 years ago
parent
commit
dfc8b60e84
4 changed files with 18 additions and 21 deletions
  1. +13
    -9
      source/backend/plugin/CarlaPluginLV2.cpp
  2. +1
    -1
      source/discovery/carla-discovery.cpp
  3. +2
    -9
      source/includes/lv2_rdf.hpp
  4. +2
    -2
      source/utils/CarlaLv2Utils.hpp

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

@@ -4057,19 +4057,23 @@ public:
#ifndef LV2_UIS_ONLY_INPROCESS
const LV2_RDF_UI* const rdfUI(&fRdfDescriptor->UIs[uiId]);

// Calf UIs are mostly useless without their special graphs
// but they can be crashy under certain conditions, so follow user preferences
if (std::strstr(rdfUI->URI, "http://calf.sourceforge.net/plugins/gui/") != nullptr)
return pData->engine->getOptions().preferUiBridges;

for (uint32_t i=0; i < rdfUI->FeatureCount; ++i)
{
if (std::strcmp(rdfUI->Features[i].URI, LV2_INSTANCE_ACCESS_URI) == 0)
const LV2_RDF_Feature& feat(rdfUI->Features[i]);

if (! feat.Required)
continue;
if (std::strcmp(feat.URI, LV2_INSTANCE_ACCESS_URI) == 0)
return false;
if (std::strcmp(rdfUI->Features[i].URI, LV2_DATA_ACCESS_URI) == 0)
if (std::strcmp(feat.URI, LV2_DATA_ACCESS_URI) == 0)
return false;
}

// Calf UIs are mostly useless without their special graphs
// but they can be crashy under certain conditions, so follow user preferences
if (std::strstr(rdfUI->URI, "http://calf.sourceforge.net/plugins/gui/") != nullptr)
return pData->engine->getOptions().preferUiBridges;

return true;
#else
return false;
@@ -4812,7 +4816,7 @@ public:
{
carla_stderr("Plugin DSP wants UI feature '%s', ignoring this", feature.URI);
}
else if (LV2_IS_FEATURE_REQUIRED(feature.Type) && ! is_lv2_feature_supported(feature.URI))
else if (feature.Required && ! is_lv2_feature_supported(feature.URI))
{
CarlaString msg("Plugin wants a feature that is not supported:\n");
msg += feature.URI;
@@ -5208,7 +5212,7 @@ public:
{
carla_stderr("Plugin UI requires a feature that is not supported:\n%s", uri);

if (LV2_IS_FEATURE_REQUIRED(fUI.rdfDescriptor->Features[i].Type))
if (fUI.rdfDescriptor->Features[i].Required)
{
canContinue = false;
break;


+ 1
- 1
source/discovery/carla-discovery.cpp View File

@@ -1032,7 +1032,7 @@ static void do_lv2_check(const char* const bundle, const bool doInit)
{
DISCOVERY_OUT("warning", "Plugin '" << rdfDescriptor->URI << "' DSP wants UI feature '" << feature.URI << "', ignoring this");
}
else if (LV2_IS_FEATURE_REQUIRED(feature.Type) && ! is_lv2_feature_supported(feature.URI))
else if (feature.Required && ! is_lv2_feature_supported(feature.URI))
{
DISCOVERY_OUT("error", "Plugin '" << rdfDescriptor->URI << "' requires a non-supported feature '" << feature.URI << "'");
supported = false;


+ 2
- 9
source/includes/lv2_rdf.hpp View File

@@ -204,13 +204,6 @@ typedef uint32_t LV2_Property;
#define LV2_IS_PORT_DESIGNATION_TIME_TICKS_PER_BEAT(x) ((x) == LV2_PORT_DESIGNATION_TIME_TICKS_PER_BEAT)
#define LV2_IS_PORT_DESIGNATION_TIME(x) ((x) >= LV2_PORT_DESIGNATION_TIME_BAR && (x) <= LV2_PORT_DESIGNATION_TIME_TICKS_PER_BEAT)

// Feature Types
#define LV2_FEATURE_OPTIONAL 1
#define LV2_FEATURE_REQUIRED 2

#define LV2_IS_FEATURE_OPTIONAL(x) ((x) == LV2_FEATURE_OPTIONAL)
#define LV2_IS_FEATURE_REQUIRED(x) ((x) == LV2_FEATURE_REQUIRED)

// UI Types
#define LV2_UI_GTK2 1
#define LV2_UI_GTK3 2
@@ -463,11 +456,11 @@ struct LV2_RDF_Preset {

// Feature
struct LV2_RDF_Feature {
LV2_Property Type;
bool Required;
LV2_URI URI;

LV2_RDF_Feature() noexcept
: Type(0),
: Required(false),
URI(nullptr) {}

~LV2_RDF_Feature() noexcept


+ 2
- 2
source/utils/CarlaLv2Utils.hpp View File

@@ -1210,7 +1210,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri, const bool loadPresets)
Lilv::Node lilvFeatureNode(lilvFeatureNodes.get(it));
LV2_RDF_Feature* const rdfFeature(&rdfDescriptor->Features[h++]);

rdfFeature->Type = lilvFeatureNodesR.contains(lilvFeatureNode) ? LV2_FEATURE_REQUIRED : LV2_FEATURE_OPTIONAL;
rdfFeature->Required = lilvFeatureNodesR.contains(lilvFeatureNode);

if (const char* const featureURI = lilvFeatureNode.as_uri())
rdfFeature->URI = carla_strdup(featureURI);
@@ -1339,7 +1339,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri, const bool loadPresets)
Lilv::Node lilvFeatureNode(lilvFeatureNodes.get(it2));
LV2_RDF_Feature* const rdfFeature(&rdfUI->Features[h2++]);

rdfFeature->Type = lilvFeatureNodesR.contains(lilvFeatureNode) ? LV2_FEATURE_REQUIRED : LV2_FEATURE_OPTIONAL;
rdfFeature->Required = lilvFeatureNodesR.contains(lilvFeatureNode);

if (const char* const featureURI = lilvFeatureNode.as_uri())
rdfFeature->URI = carla_strdup(featureURI);


Loading…
Cancel
Save