summaryrefslogtreecommitdiffstats
path: root/src/server/LV2Node.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-08-12 15:56:21 +0000
committerDavid Robillard <d@drobilla.net>2012-08-12 15:56:21 +0000
commit21b1e2e485d9fa954ca742965d000f3273fcb862 (patch)
tree8f316c5adbf6d387d64ee895b862dae21614524a /src/server/LV2Node.cpp
parent65a81eec8943dc0504b8b8755f9866ee4993372c (diff)
downloadingen-21b1e2e485d9fa954ca742965d000f3273fcb862.tar.gz
ingen-21b1e2e485d9fa954ca742965d000f3273fcb862.tar.bz2
ingen-21b1e2e485d9fa954ca742965d000f3273fcb862.zip
Stricter symbol construction and conversion.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4670 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/LV2Node.cpp')
-rw-r--r--src/server/LV2Node.cpp28
1 files changed, 11 insertions, 17 deletions
diff --git a/src/server/LV2Node.cpp b/src/server/LV2Node.cpp
index 2a8fb03d..646a8bbf 100644
--- a/src/server/LV2Node.cpp
+++ b/src/server/LV2Node.cpp
@@ -49,12 +49,12 @@ namespace Server {
* Object is not usable until instantiate() is called with success.
* (It _will_ crash!)
*/
-LV2Node::LV2Node(LV2Plugin* plugin,
- const string& name,
- bool polyphonic,
- PatchImpl* parent,
- SampleRate srate)
- : NodeImpl(plugin, name, polyphonic, parent, srate)
+LV2Node::LV2Node(LV2Plugin* plugin,
+ const Raul::Symbol& symbol,
+ bool polyphonic,
+ PatchImpl* parent,
+ SampleRate srate)
+ : NodeImpl(plugin, symbol, polyphonic, parent, srate)
, _lv2_plugin(plugin)
, _instances(NULL)
, _prepared_instances(NULL)
@@ -210,16 +210,10 @@ LV2Node::instantiate(BufferFactory& bufs)
for (uint32_t j = 0; j < num_ports; ++j) {
const LilvPort* id = lilv_plugin_get_port_by_index(plug, j);
- // LV2 port symbols are guaranteed to be unique, valid C identifiers
- const std::string port_sym = lilv_node_as_string(
- lilv_port_get_symbol(plug, id));
-
- if (!Raul::Symbol::is_valid(port_sym)) {
- Raul::error(Raul::fmt("<%1%> port %2% has invalid symbol `%3'\n")
- % _lv2_plugin->uri() % j % port_sym);
- ret = false;
- break;
- }
+ /* LV2 port symbols are guaranteed to be unique, valid C identifiers,
+ and Lilv guarantees that lilv_port_get_symbol() is valid. */
+ const Raul::Symbol port_sym(
+ lilv_node_as_string(lilv_port_get_symbol(plug, id)));
// Get port type
Raul::Atom val;
@@ -313,7 +307,7 @@ LV2Node::instantiate(BufferFactory& bufs)
if (port_type == PortType::UNKNOWN || direction == UNKNOWN) {
Raul::error(Raul::fmt("<%1%> port %2% has unknown type or direction\n")
- % _lv2_plugin->uri() % port_sym);
+ % _lv2_plugin->uri() % port_sym.c_str());
ret = false;
break;
}