summaryrefslogtreecommitdiffstats
path: root/src/client/PluginModel.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-03-12 06:59:48 +0000
committerDavid Robillard <d@drobilla.net>2012-03-12 06:59:48 +0000
commit81e9fb3245bd461ebfee4cfa16d1792e48533f9e (patch)
treeeb1b30d79cba70dda9d832100dd7c14b08085b03 /src/client/PluginModel.cpp
parente9d9569271ee962c09ab66c6babed1ca5655a6c6 (diff)
downloadingen-81e9fb3245bd461ebfee4cfa16d1792e48533f9e.tar.gz
ingen-81e9fb3245bd461ebfee4cfa16d1792e48533f9e.tar.bz2
ingen-81e9fb3245bd461ebfee4cfa16d1792e48533f9e.zip
Centralise atom creation in forge object.
Aside from being more greppable and making realtime violations more obvious, this is a step towards using LV2 atoms internally (which needs a factory since the type numbers are dynamic). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4054 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client/PluginModel.cpp')
-rw-r--r--src/client/PluginModel.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp
index 72326dd0..09a5abfb 100644
--- a/src/client/PluginModel.cpp
+++ b/src/client/PluginModel.cpp
@@ -51,14 +51,16 @@ PluginModel::PluginModel(Shared::URIs& uris,
add_properties(properties);
assert(_rdf_world);
- add_property("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", this->type_uri());
+ add_property("http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
+ this->type_uri());
LilvNode* plugin_uri = lilv_new_uri(_lilv_world, uri.c_str());
_lilv_plugin = lilv_plugins_get_by_uri(_lilv_plugins, plugin_uri);
lilv_node_free(plugin_uri);
- if (_type == Internal)
+ if (_type == Internal) {
set_property("http://usefulinc.com/ns/doap#name",
- Atom(uri.substr(uri.find_last_of('#') + 1).c_str()));
+ uris.forge.alloc(uri.substr(uri.find_last_of('#') + 1)));
+ }
}
const Atom&
@@ -93,7 +95,8 @@ PluginModel::get_property(const URI& key) const
else
symbol = uri.str().substr(first_delim + 1, last_delim - first_delim - 1);
}
- set_property("http://lv2plug.in/ns/lv2core#symbol", symbol);
+ set_property("http://lv2plug.in/ns/lv2core#symbol",
+ _uris.forge.alloc(symbol));
return get_property(key);
}
@@ -105,16 +108,20 @@ PluginModel::get_property(const URI& key) const
LILV_FOREACH(nodes, i, values) {
const LilvNode* val = lilv_nodes_get(values, i);
if (lilv_node_is_uri(val)) {
- ret = set_property(key, Atom(Atom::URI, lilv_node_as_uri(val)));
+ ret = set_property(
+ key, _uris.forge.alloc(Atom::URI, lilv_node_as_uri(val)));
break;
} else if (lilv_node_is_string(val)) {
- ret = set_property(key, lilv_node_as_string(val));
+ ret = set_property(key,
+ _uris.forge.alloc(lilv_node_as_string(val)));
break;
} else if (lilv_node_is_float(val)) {
- ret = set_property(key, Atom(lilv_node_as_float(val)));
+ ret = set_property(key,
+ _uris.forge.make(lilv_node_as_float(val)));
break;
} else if (lilv_node_is_int(val)) {
- ret = set_property(key, Atom(lilv_node_as_int(val)));
+ ret = set_property(key,
+ _uris.forge.make(lilv_node_as_int(val)));
break;
}
}