diff options
author | David Robillard <d@drobilla.net> | 2008-11-09 03:45:35 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-11-09 03:45:35 +0000 |
commit | 72ffe8b96f492805b16df8d2ffa452e67046b974 (patch) | |
tree | 4c3e565f34e334c8cc3a58ab052ea2156eb4cfdc /src/client/PluginModel.cpp | |
parent | 5d1f579900182f283a1c21ad4e59daf7f035e219 (diff) | |
download | ingen-72ffe8b96f492805b16df8d2ffa452e67046b974.tar.gz ingen-72ffe8b96f492805b16df8d2ffa452e67046b974.tar.bz2 ingen-72ffe8b96f492805b16df8d2ffa452e67046b974.zip |
Add concept of 'Resource' and make plugins a resource (as well as graph objects).
Get rid of crufty imperative Plugin API.
Loading of plugin data from engine over HTTP.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1713 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client/PluginModel.cpp')
-rw-r--r-- | src/client/PluginModel.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp index 2b824034..16e09414 100644 --- a/src/client/PluginModel.cpp +++ b/src/client/PluginModel.cpp @@ -35,6 +35,21 @@ SLV2Plugins PluginModel::_slv2_plugins = NULL; Redland::World* PluginModel::_rdf_world = NULL; +PluginModel::PluginModel(const string& uri, const string& type_uri) + : ResourceImpl(uri) + , _type(type_from_uri(_rdf_world->prefixes().qualify(type_uri))) +{ + Glib::Mutex::Lock lock(_rdf_world->mutex()); + assert(_rdf_world); + set_property("rdf:type", Raul::Atom(Raul::Atom::URI, this->type_uri())); +#ifdef HAVE_SLV2 + SLV2Value plugin_uri = slv2_value_new_uri(_slv2_world, uri.c_str()); + _slv2_plugin = slv2_plugins_get_by_uri(_slv2_plugins, plugin_uri); + slv2_value_free(plugin_uri); +#endif +} + + string PluginModel::default_node_symbol() { @@ -45,14 +60,20 @@ PluginModel::default_node_symbol() string PluginModel::human_name() { + const Atom& name_atom = get_property("doap:name"); + if (name_atom.type() == Atom::STRING) + return name_atom.get_string(); + #ifdef HAVE_SLV2 if (_slv2_plugin) { SLV2Value name = slv2_plugin_get_name(_slv2_plugin); string ret = slv2_value_as_string(name); slv2_value_free(name); + set_property("doap:name", Raul::Atom(Raul::Atom::STRING, ret.c_str())); return ret; } #endif + return default_node_symbol(); } |