diff options
Diffstat (limited to 'src/client/PluginModel.cpp')
-rw-r--r-- | src/client/PluginModel.cpp | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp index dd22549b..62bed5fb 100644 --- a/src/client/PluginModel.cpp +++ b/src/client/PluginModel.cpp @@ -36,8 +36,8 @@ namespace Ingen { namespace Client { #ifdef HAVE_LILV -LilvWorld PluginModel::_lilv_world = NULL; -LilvPlugins PluginModel::_lilv_plugins = NULL; +LilvWorld* PluginModel::_lilv_world = NULL; +const LilvPlugins* PluginModel::_lilv_plugins = NULL; #endif Sord::World* PluginModel::_rdf_world = NULL; @@ -52,7 +52,7 @@ PluginModel::PluginModel(Shared::LV2URIMap& uris, assert(_rdf_world); add_property("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", this->type_uri()); #ifdef HAVE_LILV - LilvValue plugin_uri = lilv_value_new_uri(_lilv_world, uri.c_str()); + LilvValue* plugin_uri = lilv_value_new_uri(_lilv_world, uri.c_str()); _lilv_plugin = lilv_plugins_get_by_uri(_lilv_plugins, plugin_uri); lilv_value_free(plugin_uri); #endif @@ -100,11 +100,11 @@ PluginModel::get_property(const URI& key) const #ifdef HAVE_LILV if (_lilv_plugin) { boost::optional<Raul::Atom&> ret; - LilvValue lv2_pred = lilv_value_new_uri(_lilv_world, key.str().c_str()); - LilvValues values = lilv_plugin_get_value(_lilv_plugin, lv2_pred); + LilvValue* lv2_pred = lilv_value_new_uri(_lilv_world, key.str().c_str()); + LilvValues* values = lilv_plugin_get_value(_lilv_plugin, lv2_pred); lilv_value_free(lv2_pred); LILV_FOREACH(values, i, values) { - LilvValue val = lilv_values_get(values, i); + const LilvValue* val = lilv_values_get(values, i); if (lilv_value_is_uri(val)) { ret = set_property(key, Atom(Atom::URI, lilv_value_as_uri(val))); break; @@ -173,9 +173,9 @@ PluginModel::port_human_name(uint32_t index) const { #ifdef HAVE_LILV if (_lilv_plugin) { - LilvPort port = lilv_plugin_get_port_by_index(_lilv_plugin, index); - LilvValue name = lilv_port_get_name(_lilv_plugin, port); - string ret = lilv_value_as_string(name); + const LilvPort* port = lilv_plugin_get_port_by_index(_lilv_plugin, index); + LilvValue* name = lilv_port_get_name(_lilv_plugin, port); + const string ret(lilv_value_as_string(name)); lilv_value_free(name); return ret; } @@ -187,8 +187,10 @@ PluginModel::port_human_name(uint32_t index) const bool PluginModel::has_ui() const { - LilvUIs uis = lilv_plugin_get_uis(_lilv_plugin); - return (lilv_values_size(uis) > 0); + LilvUIs* uis = lilv_plugin_get_uis(_lilv_plugin); + const bool ret = (lilv_values_size(uis) > 0); + lilv_uis_free(uis); + return ret; } SharedPtr<PluginUI> @@ -213,16 +215,16 @@ PluginModel::icon_path() const /** RDF world mutex must be held by the caller */ string -PluginModel::get_lv2_icon_path(LilvPlugin plugin) +PluginModel::get_lv2_icon_path(const LilvPlugin* plugin) { string result; - LilvValue svg_icon_pred = lilv_value_new_uri(_lilv_world, + LilvValue* svg_icon_pred = lilv_value_new_uri(_lilv_world, "http://ll-plugins.nongnu.org/lv2/namespace#svgIcon"); - LilvValues paths = lilv_plugin_get_value(plugin, svg_icon_pred); + LilvValues* paths = lilv_plugin_get_value(plugin, svg_icon_pred); if (lilv_values_size(paths) > 0) { - LilvValue value = lilv_values_get_first(paths); + const LilvValue* value = lilv_values_get_first(paths); if (lilv_value_is_uri(value)) result = lilv_uri_to_path(lilv_value_as_string(value)); lilv_values_free(paths); @@ -243,12 +245,12 @@ PluginModel::documentation() const //LilvValue lv2_documentation = lilv_value_new_uri( // _lilv_world, LILV_NAMESPACE_LV2 "documentation"); - LilvValue rdfs_comment = lilv_value_new_uri( + LilvValue* rdfs_comment = lilv_value_new_uri( _lilv_world, "http://www.w3.org/2000/01/rdf-schema#comment"); - LilvValues vals = lilv_plugin_get_value(_lilv_plugin, - rdfs_comment); - LilvValue val = lilv_values_get_first(vals); + LilvValues* vals = lilv_plugin_get_value(_lilv_plugin, + rdfs_comment); + const LilvValue* val = lilv_values_get_first(vals); if (lilv_value_is_string(val)) { doc += lilv_value_as_string(val); } @@ -266,17 +268,17 @@ PluginModel::port_documentation(uint32_t index) const if (!_lilv_plugin) return doc; - LilvPort port = lilv_plugin_get_port_by_index(_lilv_plugin, index); + const LilvPort* port = lilv_plugin_get_port_by_index(_lilv_plugin, index); //LilvValue lv2_documentation = lilv_value_new_uri( // _lilv_world, LILV_NAMESPACE_LV2 "documentation"); - LilvValue rdfs_comment = lilv_value_new_uri( + LilvValue* rdfs_comment = lilv_value_new_uri( _lilv_world, "http://www.w3.org/2000/01/rdf-schema#comment"); - LilvValues vals = lilv_port_get_value(_lilv_plugin, - port, - rdfs_comment); - LilvValue val = lilv_values_get_first(vals); + LilvValues* vals = lilv_port_get_value(_lilv_plugin, + port, + rdfs_comment); + const LilvValue* val = lilv_values_get_first(vals); if (lilv_value_is_string(val)) { doc += lilv_value_as_string(val); } |