diff options
author | David Robillard <d@drobilla.net> | 2018-01-21 00:41:34 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-01-21 00:56:50 +0100 |
commit | 44f7ad5222d824d81dc743045d5887418847e74e (patch) | |
tree | 1b41535ac00b8b225a25dba2873b064cb074bfa9 /src/client | |
parent | 90fca083052880479ad90d870e556f0648e32106 (diff) | |
download | ingen-44f7ad5222d824d81dc743045d5887418847e74e.tar.gz ingen-44f7ad5222d824d81dc743045d5887418847e74e.tar.bz2 ingen-44f7ad5222d824d81dc743045d5887418847e74e.zip |
Add URI class and remove use of Raul::URI
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/BlockModel.cpp | 4 | ||||
-rw-r--r-- | src/client/ClientStore.cpp | 16 | ||||
-rw-r--r-- | src/client/ObjectModel.cpp | 6 | ||||
-rw-r--r-- | src/client/PluginModel.cpp | 12 | ||||
-rw-r--r-- | src/client/PortModel.cpp | 2 |
5 files changed, 20 insertions, 20 deletions
diff --git a/src/client/BlockModel.cpp b/src/client/BlockModel.cpp index cf778408..910f7037 100644 --- a/src/client/BlockModel.cpp +++ b/src/client/BlockModel.cpp @@ -38,7 +38,7 @@ BlockModel::BlockModel(URIs& uris, } BlockModel::BlockModel(URIs& uris, - const Raul::URI& plugin_uri, + const URI& plugin_uri, const Raul::Path& path) : ObjectModel(uris, path) , _plugin_uri(plugin_uri) @@ -245,7 +245,7 @@ BlockModel::label() const std::string BlockModel::port_label(SPtr<const PortModel> port) const { - const Atom& name = port->get_property(Raul::URI(LV2_CORE__name)); + const Atom& name = port->get_property(URI(LV2_CORE__name)); if (name.is_valid() && name.type() == _uris.forge.String) { return name.ptr<char>(); } diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 706b2c5b..792f8949 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -124,7 +124,7 @@ ClientStore::remove_object(const Raul::Path& path) } SPtr<PluginModel> -ClientStore::_plugin(const Raul::URI& uri) +ClientStore::_plugin(const URI& uri) { const Plugins::iterator i = _plugins->find(uri); return (i == _plugins->end()) ? SPtr<PluginModel>() : (*i).second; @@ -136,12 +136,12 @@ ClientStore::_plugin(const Atom& uri) /* FIXME: Should probably be stored with URIs rather than strings, to make this a fast case. */ - const Plugins::iterator i = _plugins->find(Raul::URI(_uris.forge.str(uri, false))); + const Plugins::iterator i = _plugins->find(URI(_uris.forge.str(uri, false))); return (i == _plugins->end()) ? SPtr<PluginModel>() : (*i).second; } SPtr<const PluginModel> -ClientStore::plugin(const Raul::URI& uri) const +ClientStore::plugin(const URI& uri) const { return const_cast<ClientStore*>(this)->_plugin(uri); } @@ -167,7 +167,7 @@ ClientStore::object(const Raul::Path& path) const } SPtr<Resource> -ClientStore::_resource(const Raul::URI& uri) +ClientStore::_resource(const URI& uri) { if (uri_is_path(uri)) { return _object(uri_to_path(uri)); @@ -177,7 +177,7 @@ ClientStore::_resource(const Raul::URI& uri) } SPtr<const Resource> -ClientStore::resource(const Raul::URI& uri) const +ClientStore::resource(const URI& uri) const { return const_cast<ClientStore*>(this)->_resource(uri); } @@ -304,7 +304,7 @@ ClientStore::operator()(const Put& msg) SPtr<PluginModel> plug; if (p->second.is_valid() && (p->second.type() == _uris.forge.URI || p->second.type() == _uris.forge.URID)) { - const Raul::URI uri(_uris.forge.str(p->second, false)); + const URI uri(_uris.forge.str(p->second, false)); if (!(plug = _plugin(uri))) { plug = SPtr<PluginModel>( new PluginModel(uris(), uri, Atom(), Properties())); @@ -339,7 +339,7 @@ void ClientStore::operator()(const Delta& msg) { const auto& uri = msg.uri; - if (uri == Raul::URI("ingen:/clients/this")) { + if (uri == URI("ingen:/clients/this")) { // Client property, which we don't store (yet?) return; } @@ -368,7 +368,7 @@ ClientStore::operator()(const SetProperty& msg) const auto& predicate = msg.predicate; const auto& value = msg.value; - if (subject_uri == Raul::URI("ingen:/engine")) { + if (subject_uri == URI("ingen:/engine")) { _log.info(fmt("Engine property <%1%> = %2%\n") % predicate.c_str() % _uris.forge.str(value, false)); return; diff --git a/src/client/ObjectModel.cpp b/src/client/ObjectModel.cpp index 45136546..8d40b120 100644 --- a/src/client/ObjectModel.cpp +++ b/src/client/ObjectModel.cpp @@ -43,19 +43,19 @@ ObjectModel::is_a(const URIs::Quark& type) const } void -ObjectModel::on_property(const Raul::URI& uri, const Atom& value) +ObjectModel::on_property(const URI& uri, const Atom& value) { _signal_property.emit(uri, value); } void -ObjectModel::on_property_removed(const Raul::URI& uri, const Atom& value) +ObjectModel::on_property_removed(const URI& uri, const Atom& value) { _signal_property_removed.emit(uri, value); } const Atom& -ObjectModel::get_property(const Raul::URI& key) const +ObjectModel::get_property(const URI& key) const { static const Atom null_atom; auto i = properties().find(key); diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp index 2ab4ccae..0cf1419d 100644 --- a/src/client/PluginModel.cpp +++ b/src/client/PluginModel.cpp @@ -41,7 +41,7 @@ const LilvPlugins* PluginModel::_lilv_plugins = nullptr; Sord::World* PluginModel::_rdf_world = nullptr; PluginModel::PluginModel(URIs& uris, - const Raul::URI& uri, + const URI& uri, const Atom& type, const Properties& properties) : Resource(uris, uri) @@ -49,7 +49,7 @@ PluginModel::PluginModel(URIs& uris, , _fetched(false) { if (!_type.is_valid()) { - if (uri.find("ingen-internals") != string::npos) { + if (uri.string().find("ingen-internals") != string::npos) { _type = uris.ingen_Internal.urid; } else { _type = uris.lv2_Plugin.urid; // Assume LV2 and hope for the best... @@ -65,7 +65,7 @@ PluginModel::PluginModel(URIs& uris, if (uris.ingen_Internal == _type) { set_property(uris.doap_name, - uris.forge.alloc(uri.substr(uri.find_last_of('#') + 1))); + uris.forge.alloc(std::string(uri.fragment().substr(1)))); } } @@ -93,7 +93,7 @@ contains_alpha_after(const std::string& str, size_t begin) } const Atom& -PluginModel::get_property(const Raul::URI& key) const +PluginModel::get_property(const URI& key) const { static const Atom nil; const Atom& val = Resource::get_property(key); @@ -126,7 +126,7 @@ PluginModel::get_property(const Raul::URI& key) const const LilvNode* val = lilv_nodes_get(values, i); if (lilv_node_is_uri(val)) { ret = set_property( - key, _uris.forge.make_urid(Raul::URI(lilv_node_as_uri(val)))); + key, _uris.forge.make_urid(URI(lilv_node_as_uri(val)))); break; } else if (lilv_node_is_string(val)) { ret = set_property( @@ -170,7 +170,7 @@ PluginModel::set(SPtr<PluginModel> p) } void -PluginModel::add_preset(const Raul::URI& uri, const std::string& label) +PluginModel::add_preset(const URI& uri, const std::string& label) { _presets.emplace(uri, label); _signal_preset.emit(uri, label); diff --git a/src/client/PortModel.cpp b/src/client/PortModel.cpp index 7e5456dd..5c9a8c77 100644 --- a/src/client/PortModel.cpp +++ b/src/client/PortModel.cpp @@ -21,7 +21,7 @@ namespace Ingen { namespace Client { void -PortModel::on_property(const Raul::URI& uri, const Atom& value) +PortModel::on_property(const URI& uri, const Atom& value) { if (uri == _uris.ingen_activity) { // Don't store activity, it is transient |