diff options
author | David Robillard <d@drobilla.net> | 2012-08-14 04:23:23 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-08-14 04:23:23 +0000 |
commit | 80fee5c311fdbdeda573ec81f59158a5fc87d0a1 (patch) | |
tree | 8e7e5a6c9bda32bbe0ae8e8c9f6ab23e44c7c181 /src/client | |
parent | 058eaf65642268047a984a5c80d54a1f62a85130 (diff) | |
download | ingen-80fee5c311fdbdeda573ec81f59158a5fc87d0a1.tar.gz ingen-80fee5c311fdbdeda573ec81f59158a5fc87d0a1.tar.bz2 ingen-80fee5c311fdbdeda573ec81f59158a5fc87d0a1.zip |
Update for latest Raul.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4687 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/ClientStore.cpp | 21 | ||||
-rw-r--r-- | src/client/NodeModel.cpp | 2 | ||||
-rw-r--r-- | src/client/ObjectModel.cpp | 2 | ||||
-rw-r--r-- | src/client/PluginModel.cpp | 20 | ||||
-rw-r--r-- | src/client/PortModel.cpp | 4 |
5 files changed, 25 insertions, 24 deletions
diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 2c20ec14..eeaa5430 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -218,7 +218,7 @@ ClientStore::del(const Raul::URI& uri) return; } - const Raul::Path path(uri.str()); + const Raul::Path path(GraphObject::uri_to_path(uri)); SharedPtr<ObjectModel> removed = remove_object(path); removed.reset(); LOG(Raul::debug) << "Removed object " << path @@ -248,11 +248,12 @@ ClientStore::move(const Raul::Path& old_path, const Raul::Path& new_path) assert(Raul::Path::descendant_comparator(old_path, child_old_path)); Raul::Path child_new_path; - if (child_old_path == old_path) + if (child_old_path == old_path) { child_new_path = new_path; - else - child_new_path = new_path.base() - + child_old_path.substr(old_path.length() + 1); + } else { + child_new_path = Raul::Path( + new_path.base() + child_old_path.substr(old_path.length() + 1)); + } LOG(Raul::info)(Raul::fmt("Renamed %1% to %2%\n") % child_old_path.c_str() % child_new_path.c_str()); @@ -284,9 +285,9 @@ ClientStore::put(const Raul::URI& uri, // Check if uri is a plugin Iterator t = properties.find(_uris.rdf_type); if (t != properties.end() && t->second.type() == _uris.forge.URI) { - const Raul::Atom& type = t->second; - const Raul::URI& type_uri = type.get_uri(); - const Plugin::Type plugin_type = Plugin::type_from_uri(type_uri); + const Raul::Atom& type(t->second); + const Raul::URI type_uri(type.get_uri()); + const Plugin::Type plugin_type(Plugin::type_from_uri(type_uri)); if (plugin_type == Plugin::Patch) { is_patch = true; } else if (plugin_type != Plugin::NIL) { @@ -323,12 +324,12 @@ ClientStore::put(const Raul::URI& uri, const Iterator p = properties.find(_uris.ingen_prototype); SharedPtr<PluginModel> plug; if (p->second.is_valid() && p->second.type() == _uris.forge.URI) { - if (!(plug = _plugin(p->second.get_uri()))) { + if (!(plug = _plugin(Raul::URI(p->second.get_uri())))) { LOG(Raul::warn)(Raul::fmt("Unable to find plugin <%1%>\n") % p->second.get_uri()); plug = SharedPtr<PluginModel>( new PluginModel(uris(), - p->second.get_uri(), + Raul::URI(p->second.get_uri()), _uris.ingen_nil, Resource::Properties())); add_plugin(plug); diff --git a/src/client/NodeModel.cpp b/src/client/NodeModel.cpp index dbbb0258..06a3320d 100644 --- a/src/client/NodeModel.cpp +++ b/src/client/NodeModel.cpp @@ -230,7 +230,7 @@ NodeModel::label() const std::string NodeModel::port_label(SharedPtr<const PortModel> port) const { - const Raul::Atom& name = port->get_property(LV2_CORE__name); + const Raul::Atom& name = port->get_property(Raul::URI(LV2_CORE__name)); if (name.is_valid()) { return name.get_string(); } diff --git a/src/client/ObjectModel.cpp b/src/client/ObjectModel.cpp index 6904e1f6..cc682936 100644 --- a/src/client/ObjectModel.cpp +++ b/src/client/ObjectModel.cpp @@ -44,7 +44,7 @@ ObjectModel::~ObjectModel() bool ObjectModel::is_a(const Raul::URI& type) const { - return has_property(_uris.rdf_type, _uris.forge.alloc_uri(type.str())); + return has_property(_uris.rdf_type, _uris.forge.alloc_uri(type)); } void diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp index 0fb3b859..0f422a89 100644 --- a/src/client/PluginModel.cpp +++ b/src/client/PluginModel.cpp @@ -45,19 +45,19 @@ PluginModel::PluginModel(URIs& uris, const Raul::URI& type_uri, const Resource::Properties& properties) : Plugin(uris, uri) - , _type(type_from_uri(type_uri.str())) + , _type(type_from_uri(type_uri)) { add_properties(properties); assert(_rdf_world); - add_property("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", - uris.forge.alloc_uri(this->type_uri().str())); + add_property(uris.rdf_type, + uris.forge.alloc_uri(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) { - set_property("http://usefulinc.com/ns/doap#name", + set_property(uris.doap_name, uris.forge.alloc(uri.substr(uri.find_last_of('#') + 1))); } } @@ -81,7 +81,7 @@ PluginModel::get_property(const Raul::URI& key) const if (last_colon != string::npos) symbol = uri.substr(last_colon + 1); else - symbol = uri.str(); + symbol = uri; } else if (last_slash == string::npos) { symbol = uri.substr(last_hash + 1); } else if (last_hash == string::npos) { @@ -89,19 +89,19 @@ PluginModel::get_property(const Raul::URI& key) const } else { size_t first_delim = std::min(last_slash, last_hash); size_t last_delim = std::max(last_slash, last_hash); - if (isalpha(uri.str()[last_delim + 1])) + if (isalpha(uri[last_delim + 1])) symbol = uri.substr(last_delim + 1); else symbol = uri.substr(first_delim + 1, last_delim - first_delim - 1); } - set_property(LV2_CORE__symbol, _uris.forge.alloc(symbol)); + set_property(_uris.lv2_symbol, _uris.forge.alloc(symbol)); return get_property(key); } if (_lilv_plugin) { boost::optional<const Raul::Atom&> ret; - LilvNode* lv2_pred = lilv_new_uri(_lilv_world, key.str().c_str()); + LilvNode* lv2_pred = lilv_new_uri(_lilv_world, key.c_str()); LilvNodes* values = lilv_plugin_get_value(_lilv_plugin, lv2_pred); lilv_node_free(lv2_pred); LILV_FOREACH(nodes, i, values) { @@ -155,7 +155,7 @@ PluginModel::set(SharedPtr<PluginModel> p) Raul::Symbol PluginModel::default_node_symbol() const { - const Raul::Atom& name_atom = get_property(LV2_CORE__symbol); + const Raul::Atom& name_atom = get_property(_uris.lv2_symbol); if (name_atom.is_valid() && name_atom.type() == _uris.forge.String) return Raul::Symbol::symbolify(name_atom.get_string()); else @@ -165,7 +165,7 @@ PluginModel::default_node_symbol() const string PluginModel::human_name() const { - const Raul::Atom& name_atom = get_property("http://usefulinc.com/ns/doap#name"); + const Raul::Atom& name_atom = get_property(_uris.doap_name); if (name_atom.type() == _uris.forge.String) return name_atom.get_string(); else diff --git a/src/client/PortModel.cpp b/src/client/PortModel.cpp index 62579c44..c2493563 100644 --- a/src/client/PortModel.cpp +++ b/src/client/PortModel.cpp @@ -38,14 +38,14 @@ bool PortModel::supports(const Raul::URI& value_type) const { return has_property(_uris.atom_supports, - _uris.forge.alloc_uri(value_type.str())); + _uris.forge.alloc_uri(value_type)); } bool PortModel::port_property(const Raul::URI& uri) const { return has_property(_uris.lv2_portProperty, - _uris.forge.alloc_uri(uri.str())); + _uris.forge.alloc_uri(uri)); } void |