Browse Source

Misc lv2 fixing

tags/1.9.4
falkTX 11 years ago
parent
commit
15e86f09b2
3 changed files with 47 additions and 40 deletions
  1. +3
    -3
      source/backend/plugin/Lv2Plugin.cpp
  2. +17
    -14
      source/modules/lilv/lilv-0.16.0/lilv/lilvmm.hpp
  3. +27
    -23
      source/utils/CarlaLv2Utils.hpp

+ 3
- 3
source/backend/plugin/Lv2Plugin.cpp View File

@@ -130,7 +130,7 @@ const uint32_t kFeatureIdWorker = 19;
const uint32_t kFeatureCountPlugin = 20;
const uint32_t kFeatureIdUiDataAccess = 20;
const uint32_t kFeatureIdUiInstanceAccess = 21;
const uint32_t kFeatureIdUiIdle = 22;
const uint32_t kFeatureIdUiIdleInterface = 22;
const uint32_t kFeatureIdUiFixedSize = 23;
const uint32_t kFeatureIdUiMakeResident = 24;
const uint32_t kFeatureIdUiNoUserResize = 25;
@@ -4658,8 +4658,8 @@ public:
fFeatures[kFeatureIdUiInstanceAccess]->URI = LV2_INSTANCE_ACCESS_URI;
fFeatures[kFeatureIdUiInstanceAccess]->data = fHandle;

fFeatures[kFeatureIdUiIdle]->URI = LV2_UI__idle;
fFeatures[kFeatureIdUiIdle]->data = nullptr;
fFeatures[kFeatureIdUiIdleInterface]->URI = LV2_UI__idleInterface;
fFeatures[kFeatureIdUiIdleInterface]->data = nullptr;

fFeatures[kFeatureIdUiFixedSize]->URI = LV2_UI__fixedSize;
fFeatures[kFeatureIdUiFixedSize]->data = nullptr;


+ 17
- 14
source/modules/lilv/lilv-0.16.0/lilv/lilvmm.hpp View File

@@ -35,6 +35,9 @@ uri_to_path(const char* uri) {
#define LILV_WRAP0(RT, prefix, name) \
inline RT name() { return lilv_ ## prefix ## _ ## name (me); }

#define LILV_WRAP0_CONST(RT, prefix, name) \
inline RT name() const { return lilv_ ## prefix ## _ ## name (me); }

#define LILV_WRAP0_VOID(prefix, name) \
inline void name() { lilv_ ## prefix ## _ ## name(me); }

@@ -74,20 +77,20 @@ struct Node {

LILV_WRAP_CONVERSION(LilvNode);

LILV_WRAP0(char*, node, get_turtle_token);
LILV_WRAP0(bool, node, is_uri);
LILV_WRAP0(const char*, node, as_uri);
LILV_WRAP0(bool, node, is_blank);
LILV_WRAP0(const char*, node, as_blank);
LILV_WRAP0(bool, node, is_literal);
LILV_WRAP0(bool, node, is_string);
LILV_WRAP0(const char*, node, as_string);
LILV_WRAP0(bool, node, is_float);
LILV_WRAP0(float, node, as_float);
LILV_WRAP0(bool, node, is_int);
LILV_WRAP0(int, node, as_int);
LILV_WRAP0(bool, node, is_bool);
LILV_WRAP0(bool, node, as_bool);
LILV_WRAP0_CONST(char*, node, get_turtle_token);
LILV_WRAP0_CONST(bool, node, is_uri);
LILV_WRAP0_CONST(const char*, node, as_uri);
LILV_WRAP0_CONST(bool, node, is_blank);
LILV_WRAP0_CONST(const char*, node, as_blank);
LILV_WRAP0_CONST(bool, node, is_literal);
LILV_WRAP0_CONST(bool, node, is_string);
LILV_WRAP0_CONST(const char*, node, as_string);
LILV_WRAP0_CONST(bool, node, is_float);
LILV_WRAP0_CONST(float, node, as_float);
LILV_WRAP0_CONST(bool, node, is_int);
LILV_WRAP0_CONST(int, node, as_int);
LILV_WRAP0_CONST(bool, node, is_bool);
LILV_WRAP0_CONST(bool, node, as_bool);

LilvNode* me;
};


+ 27
- 23
source/utils/CarlaLv2Utils.hpp View File

@@ -78,7 +78,6 @@
#define LV2_MIDI_LL__MidiPort "http://ll-plugins.nongnu.org/lv2/ext/MidiPort"

#define LV2_UI__Qt5UI LV2_UI_PREFIX "Qt5UI"
#define LV2_UI__idle LV2_UI_PREFIX "idle"
#define LV2_UI__makeResident LV2_UI_PREFIX "makeResident"

// -----------------------------------------------------------------------
@@ -610,32 +609,37 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri, const bool /*fillPreset

Lilv::Nodes bufferTypeNodes(lilvPort.get_value(lv2World.atom_bufferType));

if (bufferTypeNodes.contains(lv2World.atom_sequence))
rdfPort->Types |= LV2_PORT_ATOM_SEQUENCE;
else
carla_stderr("lv2_rdf_new(\"%s\") - port '%s' uses an unknown atom buffer type", uri, rdfPort->Name);
for (LilvIter* it = lilv_nodes_begin(bufferTypeNodes.me); ! lilv_nodes_is_end(bufferTypeNodes.me, it); it = lilv_nodes_next(bufferTypeNodes.me, it))
{
const Lilv::Node node(lilv_nodes_get(bufferTypeNodes.me, it));
CARLA_SAFE_ASSERT_CONTINUE(node.is_uri());

if (node.equals(lv2World.atom_sequence))
rdfPort->Types |= LV2_PORT_ATOM_SEQUENCE;
else
carla_stderr("lv2_rdf_new(\"%s\") - port '%s' uses an unknown atom buffer type '%s'", uri, rdfPort->Name, node.as_uri());
}

Lilv::Nodes supportNodes(lilvPort.get_value(lv2World.atom_supports));
bool supported = false;

if (supportNodes.contains(lv2World.midi_event))
for (LilvIter* it = lilv_nodes_begin(supportNodes.me); ! lilv_nodes_is_end(supportNodes.me, it); it = lilv_nodes_next(supportNodes.me, it))
{
rdfPort->Types |= LV2_PORT_DATA_MIDI_EVENT;
supported = true;
}
if (supportNodes.contains(lv2World.patch_message))
{
rdfPort->Types |= LV2_PORT_DATA_PATCH_MESSAGE;
supported = true;
}
if (supportNodes.contains(lv2World.time_position))
{
rdfPort->Types |= LV2_PORT_DATA_TIME_POSITION;
supported = true;
}
const Lilv::Node node(lilv_nodes_get(supportNodes.me, it));
CARLA_SAFE_ASSERT_CONTINUE(node.is_uri());

if (! supported)
carla_stderr("lv2_rdf_new(\"%s\") - port '%s' is of atom type but has unsupported data", uri, rdfPort->Name);
if (node.equals(lv2World.midi_event))
rdfPort->Types |= LV2_PORT_DATA_MIDI_EVENT;

else if (node.equals(lv2World.patch_message))
rdfPort->Types |= LV2_PORT_DATA_PATCH_MESSAGE;

else if (node.equals(lv2World.time_position))
rdfPort->Types |= LV2_PORT_DATA_TIME_POSITION;

// something new we don't support yet?
else if (std::strstr(node.as_uri(), "lv2plug.in/") != nullptr)
carla_stderr("lv2_rdf_new(\"%s\") - port '%s' is of atom type but has unsupported data '%s'", uri, rdfPort->Name, node.as_uri());
}
}
else if (lilvPort.is_a(lv2World.port_event))
{
@@ -1354,7 +1358,7 @@ bool is_lv2_ui_feature_supported(const LV2_URI uri)
#endif
if (std::strcmp(uri, LV2_UI__fixedSize) == 0)
return true;
if (std::strcmp(uri, LV2_UI__idle) == 0)
if (std::strcmp(uri, LV2_UI__idleInterface) == 0)
return true;
if (std::strcmp(uri, LV2_UI__makeResident) == 0)
return true;


Loading…
Cancel
Save