summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/AtomReader.cpp30
-rw-r--r--src/AtomWriter.cpp6
-rw-r--r--src/ClashAvoider.cpp4
-rw-r--r--src/Forge.cpp6
-rw-r--r--src/Parser.cpp48
-rw-r--r--src/Resource.cpp22
-rw-r--r--src/Serialiser.cpp52
-rw-r--r--src/SocketWriter.cpp2
-rw-r--r--src/StreamWriter.cpp2
-rw-r--r--src/TurtleWriter.cpp14
-rw-r--r--src/URI.cpp85
-rw-r--r--src/URIMap.cpp4
-rw-r--r--src/URIs.cpp6
-rw-r--r--src/World.cpp6
-rw-r--r--src/client/BlockModel.cpp4
-rw-r--r--src/client/ClientStore.cpp16
-rw-r--r--src/client/ObjectModel.cpp6
-rw-r--r--src/client/PluginModel.cpp12
-rw-r--r--src/client/PortModel.cpp2
-rw-r--r--src/gui/App.cpp24
-rw-r--r--src/gui/App.hpp19
-rw-r--r--src/gui/BreadCrumbs.cpp2
-rw-r--r--src/gui/BreadCrumbs.hpp2
-rw-r--r--src/gui/ConnectWindow.cpp24
-rw-r--r--src/gui/ConnectWindow.hpp4
-rw-r--r--src/gui/GraphBox.cpp14
-rw-r--r--src/gui/GraphBox.hpp6
-rw-r--r--src/gui/GraphCanvas.cpp14
-rw-r--r--src/gui/GraphCanvas.hpp4
-rw-r--r--src/gui/GraphPortModule.cpp2
-rw-r--r--src/gui/GraphPortModule.hpp3
-rw-r--r--src/gui/GraphTreeWindow.cpp4
-rw-r--r--src/gui/GraphTreeWindow.hpp2
-rw-r--r--src/gui/GraphView.cpp2
-rw-r--r--src/gui/GraphView.hpp3
-rw-r--r--src/gui/LoadPluginWindow.cpp8
-rw-r--r--src/gui/LoadPluginWindow.hpp8
-rw-r--r--src/gui/NodeMenu.cpp6
-rw-r--r--src/gui/NodeMenu.hpp2
-rw-r--r--src/gui/NodeModule.cpp2
-rw-r--r--src/gui/NodeModule.hpp2
-rw-r--r--src/gui/ObjectMenu.cpp2
-rw-r--r--src/gui/ObjectMenu.hpp2
-rw-r--r--src/gui/Port.cpp8
-rw-r--r--src/gui/Port.hpp9
-rw-r--r--src/gui/PropertiesWindow.cpp50
-rw-r--r--src/gui/PropertiesWindow.hpp22
-rw-r--r--src/gui/RDFS.cpp14
-rw-r--r--src/gui/RDFS.hpp5
-rw-r--r--src/gui/ThreadedLoader.cpp44
-rw-r--r--src/gui/ThreadedLoader.hpp8
-rw-r--r--src/gui/URIEntry.cpp14
-rw-r--r--src/gui/URIEntry.hpp12
-rw-r--r--src/ingen/ingen.cpp16
-rw-r--r--src/server/BlockFactory.cpp8
-rw-r--r--src/server/BlockFactory.hpp7
-rw-r--r--src/server/BlockImpl.hpp4
-rw-r--r--src/server/Broadcaster.hpp2
-rw-r--r--src/server/ClientUpdate.cpp10
-rw-r--r--src/server/ClientUpdate.hpp17
-rw-r--r--src/server/DirectDriver.hpp2
-rw-r--r--src/server/Driver.hpp2
-rw-r--r--src/server/DuplexPort.cpp2
-rw-r--r--src/server/DuplexPort.hpp2
-rw-r--r--src/server/Engine.cpp4
-rw-r--r--src/server/Event.hpp2
-rw-r--r--src/server/EventWriter.hpp4
-rw-r--r--src/server/GraphPlugin.hpp2
-rw-r--r--src/server/InternalPlugin.cpp2
-rw-r--r--src/server/InternalPlugin.hpp3
-rw-r--r--src/server/JackDriver.cpp7
-rw-r--r--src/server/JackDriver.hpp4
-rw-r--r--src/server/LV2Block.cpp12
-rw-r--r--src/server/LV2Block.hpp4
-rw-r--r--src/server/LV2Plugin.cpp4
-rw-r--r--src/server/LV2Plugin.hpp5
-rw-r--r--src/server/NodeImpl.cpp2
-rw-r--r--src/server/NodeImpl.hpp2
-rw-r--r--src/server/PluginImpl.hpp22
-rw-r--r--src/server/PortAudioDriver.cpp2
-rw-r--r--src/server/PortAudioDriver.hpp2
-rw-r--r--src/server/PortType.hpp22
-rw-r--r--src/server/RunContext.cpp4
-rw-r--r--src/server/SocketListener.cpp6
-rw-r--r--src/server/SocketServer.hpp4
-rw-r--r--src/server/events/Copy.cpp4
-rw-r--r--src/server/events/CreateBlock.cpp2
-rw-r--r--src/server/events/CreateGraph.cpp8
-rw-r--r--src/server/events/Delete.cpp2
-rw-r--r--src/server/events/Delta.cpp24
-rw-r--r--src/server/events/Delta.hpp4
-rw-r--r--src/server/events/Get.cpp2
-rw-r--r--src/server/ingen_lv2.cpp14
-rw-r--r--src/server/internals/BlockDelay.cpp2
-rw-r--r--src/server/internals/Controller.cpp4
-rw-r--r--src/server/internals/Note.cpp2
-rw-r--r--src/server/internals/Time.cpp2
-rw-r--r--src/server/internals/Trigger.cpp2
-rw-r--r--src/wscript1
99 files changed, 502 insertions, 436 deletions
diff --git a/src/AtomReader.cpp b/src/AtomReader.cpp
index 5aa39657..218110e4 100644
--- a/src/AtomReader.cpp
+++ b/src/AtomReader.cpp
@@ -64,44 +64,44 @@ AtomReader::get_props(const LV2_Atom_Object* obj,
LV2_ATOM_OBJECT_FOREACH(obj, p) {
Atom val;
get_atom(&p->value, val);
- props.emplace(Raul::URI(_map.unmap_uri(p->key)), val);
+ props.emplace(URI(_map.unmap_uri(p->key)), val);
}
}
-boost::optional<Raul::URI>
+boost::optional<URI>
AtomReader::atom_to_uri(const LV2_Atom* atom)
{
if (!atom) {
- return boost::optional<Raul::URI>();
+ return boost::optional<URI>();
} else if (atom->type == _uris.atom_URI) {
const char* str = (const char*)LV2_ATOM_BODY_CONST(atom);
- if (Raul::URI::is_valid(str)) {
- return Raul::URI(str);
+ if (URI::is_valid(str)) {
+ return URI(str);
} else {
_log.warn(fmt("Invalid URI <%1%>\n") % str);
}
} else if (atom->type == _uris.atom_Path) {
const char* str = (const char*)LV2_ATOM_BODY_CONST(atom);
if (!strncmp(str, "file://", 5)) {
- return Raul::URI(str);
+ return URI(str);
} else {
- return Raul::URI(std::string("file://") + str);
+ return URI(std::string("file://") + str);
}
} else if (atom->type == _uris.atom_URID) {
const char* str = _map.unmap_uri(((const LV2_Atom_URID*)atom)->body);
if (str) {
- return Raul::URI(str);
+ return URI(str);
} else {
_log.warn(fmt("Unknown URID %1%\n") % str);
}
}
- return boost::optional<Raul::URI>();
+ return boost::optional<URI>();
}
boost::optional<Raul::Path>
AtomReader::atom_to_path(const LV2_Atom* atom)
{
- boost::optional<Raul::URI> uri = atom_to_uri(atom);
+ boost::optional<URI> uri = atom_to_uri(atom);
if (uri && uri_is_path(*uri)) {
return uri_to_path(*uri);
}
@@ -113,7 +113,7 @@ AtomReader::atom_to_context(const LV2_Atom* atom)
{
Resource::Graph ctx = Resource::Graph::DEFAULT;
if (atom) {
- boost::optional<Raul::URI> maybe_uri = atom_to_uri(atom);
+ boost::optional<URI> maybe_uri = atom_to_uri(atom);
if (maybe_uri) {
ctx = Resource::uri_to_graph(*maybe_uri);
} else {
@@ -158,7 +158,7 @@ AtomReader::write(const LV2_Atom* msg, int32_t default_id)
(LV2_URID)_uris.patch_sequenceNumber, &number,
NULL);
- const boost::optional<Raul::URI> subject_uri = atom_to_uri(subject);
+ const boost::optional<URI> subject_uri = atom_to_uri(subject);
const int32_t seq = ((number && number->type == _uris.atom_Int)
? ((const LV2_Atom_Int*)number)->body
@@ -267,7 +267,7 @@ AtomReader::write(const LV2_Atom* msg, int32_t default_id)
get_atom(value, atom);
_iface(SetProperty{seq,
*subject_uri,
- Raul::URI(_map.unmap_uri(prop->body)),
+ URI(_map.unmap_uri(prop->body)),
atom,
atom_to_context(context)});
} else if (obj->body.otype == _uris.patch_Patch) {
@@ -313,13 +313,13 @@ AtomReader::write(const LV2_Atom* msg, int32_t default_id)
return false;
}
- boost::optional<Raul::URI> subject_uri(atom_to_uri(subject));
+ boost::optional<URI> subject_uri(atom_to_uri(subject));
if (!subject_uri) {
_log.warn("Copy message has non-path subject\n");
return false;
}
- boost::optional<Raul::URI> dest_uri(atom_to_uri(dest));
+ boost::optional<URI> dest_uri(atom_to_uri(dest));
if (!dest_uri) {
_log.warn("Copy message has non-URI destination\n");
return false;
diff --git a/src/AtomWriter.cpp b/src/AtomWriter.cpp
index 611b20d9..f235aafc 100644
--- a/src/AtomWriter.cpp
+++ b/src/AtomWriter.cpp
@@ -122,7 +122,7 @@ AtomWriter::operator()(const BundleEnd& message)
}
void
-AtomWriter::forge_uri(const Raul::URI& uri)
+AtomWriter::forge_uri(const URI& uri)
{
if (serd_uri_string_has_scheme((const uint8_t*)uri.c_str())) {
lv2_atom_forge_urid(&_forge, _map.map_uri(uri.c_str()));
@@ -137,7 +137,7 @@ AtomWriter::forge_properties(const Properties& properties)
for (auto p : properties) {
lv2_atom_forge_key(&_forge, _map.map_uri(p.first.c_str()));
if (p.second.type() == _forge.URI) {
- forge_uri(Raul::URI(p.second.ptr<char>()));
+ forge_uri(URI(p.second.ptr<char>()));
} else {
lv2_atom_forge_atom(&_forge, p.second.size(), p.second.type());
lv2_atom_forge_write(&_forge, p.second.get_body(), p.second.size());
@@ -606,7 +606,7 @@ AtomWriter::operator()(const Response& response)
forge_request(&msg, _uris.patch_Response, 0);
lv2_atom_forge_key(&_forge, _uris.patch_sequenceNumber);
lv2_atom_forge_int(&_forge, response.id);
- if (!subject.empty() && Raul::URI::is_valid(subject)) {
+ if (!subject.empty()) {
lv2_atom_forge_key(&_forge, _uris.patch_subject);
lv2_atom_forge_uri(&_forge, subject.c_str(), subject.length());
}
diff --git a/src/ClashAvoider.cpp b/src/ClashAvoider.cpp
index dafd4472..ae4438a4 100644
--- a/src/ClashAvoider.cpp
+++ b/src/ClashAvoider.cpp
@@ -30,8 +30,8 @@ ClashAvoider::ClashAvoider(const Store& store)
: _store(store)
{}
-const Raul::URI
-ClashAvoider::map_uri(const Raul::URI& in)
+const URI
+ClashAvoider::map_uri(const URI& in)
{
if (uri_is_path(in)) {
return path_to_uri(map_path(uri_to_path(in)));
diff --git a/src/Forge.cpp b/src/Forge.cpp
index a075d5a1..688d994d 100644
--- a/src/Forge.cpp
+++ b/src/Forge.cpp
@@ -17,9 +17,9 @@
#include <sstream>
#include "ingen/Forge.hpp"
+#include "ingen/URI.hpp"
#include "ingen/URIMap.hpp"
#include "lv2/lv2plug.in/ns/ext/atom/atom.h"
-#include "raul/URI.hpp"
namespace Ingen {
@@ -30,9 +30,9 @@ Forge::Forge(URIMap& map)
}
Atom
-Forge::make_urid(const Raul::URI& u)
+Forge::make_urid(const Ingen::URI& u)
{
- const LV2_URID urid = _map.map_uri(u);
+ const LV2_URID urid = _map.map_uri(u.string());
return Atom(sizeof(int32_t), URID, &urid);
}
diff --git a/src/Parser.cpp b/src/Parser.cpp
index d761c84e..e0ec0d35 100644
--- a/src/Parser.cpp
+++ b/src/Parser.cpp
@@ -44,19 +44,19 @@
namespace Ingen {
std::set<Parser::ResourceRecord>
-Parser::find_resources(Sord::World& world,
- const std::string& manifest_uri,
- const Raul::URI& type_uri)
+Parser::find_resources(Sord::World& world,
+ const URI& manifest_uri,
+ const URI& type_uri)
{
- const Sord::URI base (world, manifest_uri);
- const Sord::URI type (world, type_uri);
+ const Sord::URI base (world, manifest_uri.string());
+ const Sord::URI type (world, type_uri.string());
const Sord::URI rdf_type (world, NS_RDF "type");
const Sord::URI rdfs_seeAlso(world, NS_RDFS "seeAlso");
const Sord::Node nil;
SerdEnv* env = serd_env_new(sord_node_to_serd_node(base.c_obj()));
- Sord::Model model(world, manifest_uri);
- model.load_file(env, SERD_TURTLE, manifest_uri);
+ Sord::Model model(world, manifest_uri.string());
+ model.load_file(env, SERD_TURTLE, manifest_uri.string());
std::set<ResourceRecord> resources;
for (Sord::Iter i = model.find(nil, rdf_type, type); !i.end(); ++i) {
@@ -69,7 +69,7 @@ Parser::find_resources(Sord::World& world,
file_path = (const char*)p;
free(p);
}
- resources.insert(ResourceRecord(resource.to_string(), file_path));
+ resources.insert(ResourceRecord(URI(resource.to_string()), file_path));
}
serd_env_free(env);
@@ -117,9 +117,9 @@ static bool
skip_property(Ingen::URIs& uris, const Sord::Node& predicate)
{
return (predicate.to_string() == INGEN__file ||
- predicate.to_string() == uris.ingen_arc ||
- predicate.to_string() == uris.ingen_block ||
- predicate.to_string() == uris.lv2_port);
+ predicate == uris.ingen_arc ||
+ predicate == uris.ingen_block ||
+ predicate == uris.lv2_port);
}
static Properties
@@ -147,7 +147,7 @@ get_properties(Ingen::World* world,
Atom atomm;
atomm = world->forge().alloc(
atom->size, atom->type, LV2_ATOM_BODY_CONST(atom));
- props.emplace(Raul::URI(i.get_predicate().to_string()),
+ props.emplace(URI(i.get_predicate().to_string()),
Property(atomm, ctx));
}
}
@@ -250,7 +250,7 @@ parse_properties(
Sord::Model& model,
const Sord::Node& subject,
Resource::Graph ctx,
- const Raul::URI& uri,
+ const URI& uri,
boost::optional<Properties> data = boost::optional<Properties>());
static bool
@@ -535,7 +535,7 @@ parse_properties(Ingen::World* world,
Sord::Model& model,
const Sord::Node& subject,
Resource::Graph ctx,
- const Raul::URI& uri,
+ const URI& uri,
boost::optional<Properties> data)
{
Properties properties = get_properties(world, model, subject, ctx);
@@ -647,9 +647,9 @@ Parser::parse_file(Ingen::World* world,
? Glib::build_filename(file_path, "manifest.ttl")
: file_path);
- std::string manifest_uri;
+ URI manifest_uri;
try {
- manifest_uri = Glib::filename_to_uri(manifest_path);
+ manifest_uri = URI(Glib::filename_to_uri(manifest_path));
} catch (const Glib::ConvertError& e) {
world->log().error(fmt("URI conversion error (%1%)\n") % e.what());
return false;
@@ -657,7 +657,7 @@ Parser::parse_file(Ingen::World* world,
// Find graphs in manifest
const std::set<ResourceRecord> resources = find_resources(
- *world->rdf_world(), manifest_uri, Raul::URI(INGEN__Graph));
+ *world->rdf_world(), manifest_uri, URI(INGEN__Graph));
if (resources.empty()) {
world->log().error(fmt("No graphs found in %1%\n") % path);
@@ -667,7 +667,7 @@ Parser::parse_file(Ingen::World* world,
/* Choose the graph to load. If this is a manifest, then there should only be
one, but if this is a graph file, subgraphs will be returned as well.
In this case, choose the one with the file URI. */
- std::string uri;
+ URI uri;
for (const ResourceRecord& r : resources) {
if (r.uri == Glib::filename_to_uri(manifest_path)) {
uri = r.uri;
@@ -694,7 +694,7 @@ Parser::parse_file(Ingen::World* world,
SerdEnv* env = serd_env_new(&base_node);
// Load graph into model
- Sord::Model model(*world->rdf_world(), uri, SORD_SPO|SORD_PSO, false);
+ Sord::Model model(*world->rdf_world(), uri.string(), SORD_SPO|SORD_PSO, false);
model.load_file(env, SERD_TURTLE, file_uri);
serd_env_free(env);
@@ -706,15 +706,15 @@ Parser::parse_file(Ingen::World* world,
world->log().info(fmt("Symbol: %1%\n") % symbol->c_str());
}
- Sord::Node subject(*world->rdf_world(), Sord::Node::URI, uri);
+ Sord::Node subject(*world->rdf_world(), Sord::Node::URI, uri.string());
boost::optional<Raul::Path> parsed_path
= parse(world, target, model, model.base_uri().to_string(),
subject, parent, symbol, data);
if (parsed_path) {
target->set_property(path_to_uri(*parsed_path),
- Raul::URI(INGEN__file),
- world->forge().alloc_uri(uri));
+ URI(INGEN__file),
+ world->forge().alloc_uri(uri.string()));
return true;
} else {
world->log().warn("Document URI lost\n");
@@ -722,7 +722,7 @@ Parser::parse_file(Ingen::World* world,
}
}
-boost::optional<Raul::URI>
+boost::optional<URI>
Parser::parse_string(Ingen::World* world,
Ingen::Interface* target,
const std::string& str,
@@ -742,7 +742,7 @@ Parser::parse_string(Ingen::World* world,
}
model.load_string(env, SERD_TURTLE, str.c_str(), str.length(), base_uri);
- Raul::URI actual_base((const char*)serd_env_get_base_uri(env, nullptr)->buf);
+ URI actual_base((const char*)serd_env_get_base_uri(env, nullptr)->buf);
serd_env_free(env);
world->log().info(fmt("Parsing string (base %1%)\n") % base_uri);
diff --git a/src/Resource.cpp b/src/Resource.cpp
index 05c4fb4e..d0261eee 100644
--- a/src/Resource.cpp
+++ b/src/Resource.cpp
@@ -25,9 +25,7 @@
namespace Ingen {
bool
-Resource::add_property(const Raul::URI& uri,
- const Atom& value,
- Graph ctx)
+Resource::add_property(const URI& uri, const Atom& value, Graph ctx)
{
// Ignore duplicate statements
typedef Properties::const_iterator iterator;
@@ -51,9 +49,7 @@ Resource::add_property(const Raul::URI& uri,
}
const Atom&
-Resource::set_property(const Raul::URI& uri,
- const Atom& value,
- Resource::Graph ctx)
+Resource::set_property(const URI& uri, const Atom& value, Resource::Graph ctx)
{
// Erase existing property in this context
for (auto i = _properties.find(uri);
@@ -81,7 +77,7 @@ Resource::set_property(const Raul::URI& uri,
}
const Atom&
-Resource::set_property(const Raul::URI& uri,
+Resource::set_property(const URI& uri,
const URIs::Quark& value,
Resource::Graph ctx)
{
@@ -89,7 +85,7 @@ Resource::set_property(const Raul::URI& uri,
}
void
-Resource::remove_property(const Raul::URI& uri, const Atom& value)
+Resource::remove_property(const URI& uri, const Atom& value)
{
if (_uris.patch_wildcard == value) {
_properties.erase(uri);
@@ -107,20 +103,20 @@ Resource::remove_property(const Raul::URI& uri, const Atom& value)
}
void
-Resource::remove_property(const Raul::URI& uri, const URIs::Quark& value)
+Resource::remove_property(const URI& uri, const URIs::Quark& value)
{
remove_property(uri, value.urid);
remove_property(uri, value.uri);
}
bool
-Resource::has_property(const Raul::URI& uri, const Atom& value) const
+Resource::has_property(const URI& uri, const Atom& value) const
{
return _properties.contains(uri, value);
}
bool
-Resource::has_property(const Raul::URI& uri, const URIs::Quark& value) const
+Resource::has_property(const URI& uri, const URIs::Quark& value) const
{
Properties::const_iterator i = _properties.find(uri);
for (; (i != _properties.end()) && (i->first == uri); ++i) {
@@ -132,13 +128,13 @@ Resource::has_property(const Raul::URI& uri, const URIs::Quark& value) const
}
const Atom&
-Resource::set_property(const Raul::URI& uri, const Atom& value) const
+Resource::set_property(const URI& uri, const Atom& value) const
{
return const_cast<Resource*>(this)->set_property(uri, value);
}
const Atom&
-Resource::get_property(const Raul::URI& uri) const
+Resource::get_property(const URI& uri) const
{
static const Atom nil;
Properties::const_iterator i = _properties.find(uri);
diff --git a/src/Serialiser.cpp b/src/Serialiser.cpp
index 13a0f96d..b572b453 100644
--- a/src/Serialiser.cpp
+++ b/src/Serialiser.cpp
@@ -38,6 +38,7 @@
#include "ingen/Resource.hpp"
#include "ingen/Serialiser.hpp"
#include "ingen/Store.hpp"
+#include "ingen/URI.hpp"
#include "ingen/URIMap.hpp"
#include "ingen/URIs.hpp"
#include "ingen/World.hpp"
@@ -81,8 +82,7 @@ struct Serialiser::Impl {
void serialise_properties(Sord::Node id,
const Properties& props);
- void write_bundle(SPtr<const Node> graph,
- const std::string& uri);
+ void write_bundle(SPtr<const Node> graph, const URI& uri);
Sord::Node path_rdf_node(const Raul::Path& path);
@@ -100,7 +100,7 @@ struct Serialiser::Impl {
Raul::Path _root_path;
Mode _mode;
- std::string _base_uri;
+ URI _base_uri;
std::string _basename;
World& _world;
Sord::Model* _model;
@@ -129,7 +129,7 @@ Serialiser::Impl::write_manifest(const std::string& bundle_path,
const URIs& uris = _world.uris();
const string filename("main.ttl");
- const Sord::URI subject(world, filename, _base_uri);
+ const Sord::URI subject(world, filename, _base_uri.string());
_model->add_statement(subject,
Sord::URI(world, uris.rdf_type),
@@ -139,7 +139,7 @@ Serialiser::Impl::write_manifest(const std::string& bundle_path,
Sord::URI(world, uris.lv2_Plugin));
_model->add_statement(subject,
Sord::URI(world, uris.rdfs_seeAlso),
- Sord::URI(world, filename, _base_uri));
+ Sord::URI(world, filename, _base_uri.string()));
_model->add_statement(subject,
Sord::URI(world, uris.lv2_prototype),
Sord::URI(world, uris.ingen_GraphPrototype));
@@ -180,17 +180,15 @@ Serialiser::Impl::write_plugins(const std::string& bundle_path,
}
void
-Serialiser::write_bundle(SPtr<const Node> graph,
- const std::string& uri)
+Serialiser::write_bundle(SPtr<const Node> graph, const URI& uri)
{
me->write_bundle(graph, uri);
}
void
-Serialiser::Impl::write_bundle(SPtr<const Node> graph,
- const std::string& uri)
+Serialiser::Impl::write_bundle(SPtr<const Node> graph, const URI& uri)
{
- std::string path = Glib::filename_from_uri(uri);
+ std::string path = Glib::filename_from_uri(uri.string());
if (Glib::file_test(path, Glib::FILE_TEST_EXISTS)
&& !Glib::file_test(path, Glib::FILE_TEST_IS_DIR)) {
path = Glib::path_get_dirname(path);
@@ -210,7 +208,7 @@ Serialiser::Impl::write_bundle(SPtr<const Node> graph,
start_to_file(graph->path(), main_file);
std::set<const Resource*> plugins = serialise_graph(
- graph, Sord::URI(_model->world(), main_file, _base_uri));
+ graph, Sord::URI(_model->world(), main_file, _base_uri.string()));
finish();
write_manifest(path, graph);
@@ -229,9 +227,9 @@ Serialiser::Impl::start_to_file(const Raul::Path& root, const string& filename)
// Set Base URI
assert(filename.find(":") == string::npos || filename.substr(0, 5) == "file:");
if (filename.find(":") == string::npos) {
- _base_uri = "file://" + filename;
+ _base_uri = URI("file://" + filename);
} else {
- _base_uri = filename;
+ _base_uri = URI(filename);
}
// Find graph basename to use as symbol / fallback name
@@ -240,17 +238,17 @@ Serialiser::Impl::start_to_file(const Raul::Path& root, const string& filename)
_basename = Glib::path_get_basename(Glib::path_get_dirname(filename));
}
- _model = new Sord::Model(*_world.rdf_world(), _base_uri);
+ _model = new Sord::Model(*_world.rdf_world(), _base_uri.string());
_mode = Mode::TO_FILE;
_root_path = root;
}
void
-Serialiser::start_to_string(const Raul::Path& root, const string& base_uri)
+Serialiser::start_to_string(const Raul::Path& root, const URI& base_uri)
{
me->_root_path = root;
me->_base_uri = base_uri;
- me->_model = new Sord::Model(*me->_world.rdf_world(), base_uri);
+ me->_model = new Sord::Model(*me->_world.rdf_world(), base_uri.string());
me->_mode = Impl::Mode::TO_STRING;
}
@@ -271,18 +269,18 @@ Serialiser::Impl::finish()
{
string ret = "";
if (_mode == Mode::TO_FILE) {
- SerdStatus st = _model->write_to_file(_base_uri, SERD_TURTLE);
+ SerdStatus st = _model->write_to_file(_base_uri.string(), SERD_TURTLE);
if (st) {
_world.log().error(fmt("Error writing file %1% (%2%)\n")
% _base_uri % serd_strerror(st));
}
} else {
- ret = _model->write_to_string(_base_uri, SERD_TURTLE);
+ ret = _model->write_to_string(_base_uri.string(), SERD_TURTLE);
}
delete _model;
_model = nullptr;
- _base_uri = "";
+ _base_uri = URI();
return ret;
}
@@ -294,7 +292,7 @@ Serialiser::Impl::path_rdf_node(const Raul::Path& path)
assert(path == _root_path || path.is_child_of(_root_path));
return Sord::URI(_model->world(),
path.substr(_root_path.base().length()),
- _base_uri);
+ _base_uri.string());
}
void
@@ -378,11 +376,11 @@ Serialiser::Impl::serialise_graph(SPtr<const Node> graph,
const Sord::URI subgraph_id(world, (const char*)subgraph_node.buf);
// Save our state
- std::string my_base_uri = _base_uri;
+ URI my_base_uri = _base_uri;
Sord::Model* my_model = _model;
// Write child bundle within this bundle
- write_bundle(subgraph, subgraph_id.to_string());
+ write_bundle(subgraph, URI(subgraph_id.to_string()));
// Restore our state
_base_uri = my_base_uri;
@@ -451,8 +449,8 @@ Serialiser::Impl::serialise_block(SPtr<const Node> block,
props.erase(uris.state_state);
serialise_properties(block_id, props);
- if (_base_uri.substr(0, 5) == "file:") {
- const std::string base = Glib::filename_from_uri(_base_uri);
+ if (_base_uri.scheme() == "file") {
+ const std::string base = Glib::filename_from_uri(_base_uri.string());
const std::string graph_dir = Glib::path_get_dirname(base);
const std::string state_dir = Glib::build_filename(graph_dir, block->symbol());
const std::string state_file = Glib::build_filename(state_dir, "state.ttl");
@@ -557,9 +555,9 @@ static bool
skip_property(Ingen::URIs& uris, const Sord::Node& predicate)
{
return (predicate.to_string() == INGEN__file ||
- predicate.to_string() == uris.ingen_arc ||
- predicate.to_string() == uris.ingen_block ||
- predicate.to_string() == uris.lv2_port);
+ predicate == uris.ingen_arc ||
+ predicate == uris.ingen_block ||
+ predicate == uris.lv2_port);
}
void
diff --git a/src/SocketWriter.cpp b/src/SocketWriter.cpp
index 9274fe57..68091bcc 100644
--- a/src/SocketWriter.cpp
+++ b/src/SocketWriter.cpp
@@ -29,7 +29,7 @@ namespace Ingen {
SocketWriter::SocketWriter(URIMap& map,
URIs& uris,
- const Raul::URI& uri,
+ const URI& uri,
SPtr<Raul::Socket> sock)
: TurtleWriter(map, uris, uri)
, _socket(std::move(sock))
diff --git a/src/StreamWriter.cpp b/src/StreamWriter.cpp
index a4e5b761..45853055 100644
--- a/src/StreamWriter.cpp
+++ b/src/StreamWriter.cpp
@@ -21,7 +21,7 @@ namespace Ingen {
StreamWriter::StreamWriter(URIMap& map,
URIs& uris,
- const Raul::URI& uri,
+ const URI& uri,
FILE* stream,
ColorContext::Color color)
: TurtleWriter(map, uris, uri)
diff --git a/src/TurtleWriter.cpp b/src/TurtleWriter.cpp
index 630906e7..368184d4 100644
--- a/src/TurtleWriter.cpp
+++ b/src/TurtleWriter.cpp
@@ -35,14 +35,12 @@ write_prefix(void* handle, const SerdNode* name, const SerdNode* uri)
return SERD_SUCCESS;
}
-TurtleWriter::TurtleWriter(URIMap& map,
- URIs& uris,
- const Raul::URI& uri)
- : AtomWriter(map, uris, *this)
- , _map(map)
- , _sratom(sratom_new(&map.urid_map_feature()->urid_map))
- , _uri(uri)
- , _wrote_prefixes(false)
+TurtleWriter::TurtleWriter(URIMap& map, URIs& uris, const URI& uri)
+ : AtomWriter(map, uris, *this)
+ , _map(map)
+ , _sratom(sratom_new(&map.urid_map_feature()->urid_map))
+ , _uri(uri)
+ , _wrote_prefixes(false)
{
// Use <ingen:/> as base URI, so relative URIs are like bundle paths
_base = serd_node_from_string(SERD_URI, (const uint8_t*)"ingen:/");
diff --git a/src/URI.cpp b/src/URI.cpp
new file mode 100644
index 00000000..cc7dde46
--- /dev/null
+++ b/src/URI.cpp
@@ -0,0 +1,85 @@
+/*
+ This file is part of Ingen.
+ Copyright 2018 David Robillard <http://drobilla.net/>
+
+ Ingen is free software: you can redistribute it and/or modify it under the
+ terms of the GNU Affero General Public License as published by the Free
+ Software Foundation, either version 3 of the License, or any later version.
+
+ Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU Affero General Public License for details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Ingen. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <cassert>
+
+#include "ingen/URI.hpp"
+
+namespace Ingen {
+
+URI::URI()
+ : _node(SERD_NODE_NULL)
+ , _uri(SERD_URI_NULL)
+{}
+
+URI::URI(const std::string& str)
+ : _node(serd_node_new_uri_from_string((const uint8_t*)str.c_str(),
+ NULL,
+ &_uri))
+{}
+
+URI::URI(const char* str)
+ : _node(serd_node_new_uri_from_string((const uint8_t*)str, NULL, &_uri))
+{}
+
+URI::URI(const std::string& str, const URI& base)
+ : _node(serd_node_new_uri_from_string((const uint8_t*)str.c_str(),
+ &base._uri,
+ &_uri))
+{}
+
+URI::URI(const Sord::Node& node)
+ : _node(serd_node_new_uri_from_node(node.to_serd_node(), NULL, &_uri))
+{
+ assert(node.type() == Sord::Node::URI);
+}
+
+URI::URI(const URI& uri)
+ : _node(serd_node_new_uri(&uri._uri, NULL, &_uri))
+{}
+
+URI&
+URI::operator=(const URI& uri)
+{
+ serd_node_free(&_node);
+ _node = serd_node_new_uri(&uri._uri, NULL, &_uri);
+ return *this;
+}
+
+URI::URI(URI&& uri)
+ : _node(uri._node)
+ , _uri(uri._uri)
+{
+ uri._node = SERD_NODE_NULL;
+ uri._uri = SERD_URI_NULL;
+}
+
+URI&
+URI::operator=(URI&& uri)
+{
+ _node = uri._node;
+ _uri = uri._uri;
+ uri._node = SERD_NODE_NULL;
+ uri._uri = SERD_URI_NULL;
+ return *this;
+}
+
+URI::~URI()
+{
+ serd_node_free(&_node);
+}
+
+} // namespace Ingen
diff --git a/src/URIMap.cpp b/src/URIMap.cpp
index 1dcf8a24..0be308d7 100644
--- a/src/URIMap.cpp
+++ b/src/URIMap.cpp
@@ -19,8 +19,8 @@
#include <glib.h>
#include "ingen/Log.hpp"
+#include "ingen/URI.hpp"
#include "ingen/URIMap.hpp"
-#include "raul/URI.hpp"
namespace Ingen {
@@ -54,7 +54,7 @@ URIMap::URIDMapFeature::default_map(LV2_URID_Map_Handle h,
LV2_URID
URIMap::URIDMapFeature::map(const char* uri)
{
- if (!Raul::URI::is_valid(uri)) {
+ if (!URI::is_valid(uri)) {
log.error(fmt("Attempt to map invalid URI <%1%>\n") % uri);
return 0;
}
diff --git a/src/URIs.cpp b/src/URIs.cpp
index 3e56e4f4..af03b7b5 100644
--- a/src/URIs.cpp
+++ b/src/URIs.cpp
@@ -40,14 +40,14 @@ URIs::Quark::Quark(Forge& forge,
URIMap* map,
LilvWorld* lworld,
const char* str)
- : Raul::URI(str)
- , urid(forge.make_urid(Raul::URI(str)))
+ : URI(str)
+ , urid(forge.make_urid(URI(str)))
, uri(forge.alloc_uri(str))
, lnode(lilv_new_uri(lworld, str))
{}
URIs::Quark::Quark(const Quark& copy)
- : Raul::URI(copy)
+ : URI(copy)
, urid(copy.urid)
, uri(copy.uri)
, lnode(lilv_node_duplicate(copy.lnode))
diff --git a/src/World.cpp b/src/World.cpp
index 8797bb3e..7834c3df 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -312,10 +312,10 @@ World::run_module(const char* name)
/** Get an interface for a remote engine at `engine_uri`
*/
SPtr<Interface>
-World::new_interface(const Raul::URI& engine_uri,
- SPtr<Interface> respondee)
+World::new_interface(const URI& engine_uri, SPtr<Interface> respondee)
{
- const Impl::InterfaceFactories::const_iterator i = _impl->interface_factories.find(engine_uri.scheme());
+ const Impl::InterfaceFactories::const_iterator i =
+ _impl->interface_factories.find(std::string(engine_uri.scheme()));
if (i == _impl->interface_factories.end()) {
log().warn(fmt("Unknown URI scheme `%1%'\n") % engine_uri.scheme());
return SPtr<Interface>();
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
diff --git a/src/gui/App.cpp b/src/gui/App.cpp
index 1473320b..a8128d8d 100644
--- a/src/gui/App.cpp
+++ b/src/gui/App.cpp
@@ -177,7 +177,7 @@ App::attach(SPtr<SigClientInterface> client)
if (_world->conf().option("dump").get<int32_t>()) {
_dumper = SPtr<StreamWriter>(new StreamWriter(_world->uri_map(),
_world->uris(),
- Raul::URI("ingen:/client"),
+ URI("ingen:/client"),
stderr,
ColorContext::Color::CYAN));
@@ -207,7 +207,7 @@ void
App::request_plugins_if_necessary()
{
if (!_requested_plugins) {
- _world->interface()->get(Raul::URI("ingen:/plugins"));
+ _world->interface()->get(URI("ingen:/plugins"));
_requested_plugins = true;
}
}
@@ -251,10 +251,10 @@ App::error_message(const std::string& str)
}
void
-App::set_property(const Raul::URI& subject,
- const Raul::URI& key,
- const Atom& value,
- Resource::Graph ctx)
+App::set_property(const URI& subject,
+ const URI& key,
+ const Atom& value,
+ Resource::Graph ctx)
{
// Send message to server
interface()->set_property(subject, key, value, ctx);
@@ -278,7 +278,7 @@ App::set_tooltip(Gtk::Widget* widget, const LilvNode* node)
}
void
-App::put(const Raul::URI& uri,
+App::put(const URI& uri,
const Properties& properties,
Resource::Graph ctx)
{
@@ -292,12 +292,12 @@ App::put(const Raul::URI& uri,
}
void
-App::property_change(const Raul::URI& subject,
- const Raul::URI& key,
- const Atom& value,
- Resource::Graph ctx)
+App::property_change(const URI& subject,
+ const URI& key,
+ const Atom& value,
+ Resource::Graph ctx)
{
- if (subject != Raul::URI("ingen:/engine")) {
+ if (subject != URI("ingen:/engine")) {
return;
} else if (key == uris().param_sampleRate && value.type() == forge().Int) {
_sample_rate = value.get<int32_t>();
diff --git a/src/gui/App.hpp b/src/gui/App.hpp
index 22451846..573925e6 100644
--- a/src/gui/App.hpp
+++ b/src/gui/App.hpp
@@ -33,7 +33,6 @@
#include "ingen/types.hpp"
#include "lilv/lilv.h"
#include "raul/Deletable.hpp"
-#include "raul/URI.hpp"
namespace Ingen {
@@ -100,10 +99,10 @@ public:
return old;
}
- void set_property(const Raul::URI& subject,
- const Raul::URI& key,
- const Atom& value,
- Resource::Graph ctx = Resource::Graph::DEFAULT);
+ void set_property(const URI& subject,
+ const URI& key,
+ const Atom& value,
+ Resource::Graph ctx = Resource::Graph::DEFAULT);
/** Set the tooltip for a widget from its RDF documentation. */
void set_tooltip(Gtk::Widget* widget, const LilvNode* node);
@@ -147,14 +146,14 @@ protected:
bool animate();
void response(int32_t id, Ingen::Status status, const std::string& subject);
- void put(const Raul::URI& uri,
+ void put(const URI& uri,
const Properties& properties,
Resource::Graph ctx);
- void property_change(const Raul::URI& subject,
- const Raul::URI& key,
- const Atom& value,
- Resource::Graph ctx = Resource::Graph::DEFAULT);
+ void property_change(const URI& subject,
+ const URI& key,
+ const Atom& value,
+ Resource::Graph ctx = Resource::Graph::DEFAULT);
static Gtk::Main* _main;
diff --git a/src/gui/BreadCrumbs.cpp b/src/gui/BreadCrumbs.cpp
index 693b81e1..3f69e998 100644
--- a/src/gui/BreadCrumbs.cpp
+++ b/src/gui/BreadCrumbs.cpp
@@ -200,7 +200,7 @@ BreadCrumbs::message(const Message& msg)
}
void
-BreadCrumbs::object_destroyed(const Raul::URI& uri)
+BreadCrumbs::object_destroyed(const URI& uri)
{
for (auto i = _breadcrumbs.begin(); i != _breadcrumbs.end(); ++i) {
if ((*i)->path() == uri.c_str()) {
diff --git a/src/gui/BreadCrumbs.hpp b/src/gui/BreadCrumbs.hpp
index 22bbd7af..467d3bfc 100644
--- a/src/gui/BreadCrumbs.hpp
+++ b/src/gui/BreadCrumbs.hpp
@@ -104,7 +104,7 @@ private:
void breadcrumb_clicked(BreadCrumb* crumb);
void message(const Message& msg);
- void object_destroyed(const Raul::URI& uri);
+ void object_destroyed(const URI& uri);
void object_moved(const Raul::Path& old_path, const Raul::Path& new_path);
Raul::Path _active_path;
diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp
index 7cacb498..8f235264 100644
--- a/src/gui/ConnectWindow.cpp
+++ b/src/gui/ConnectWindow.cpp
@@ -141,7 +141,7 @@ ConnectWindow::set_connected_to(SPtr<Ingen::Interface> engine)
_progress_bar->set_fraction(1.0);
_progress_label->set_text("Connected to engine");
_url_entry->set_sensitive(false);
- _url_entry->set_text(engine->uri());
+ _url_entry->set_text(engine->uri().string());
_connect_button->set_sensitive(false);
_disconnect_button->set_label("gtk-disconnect");
_disconnect_button->set_sensitive(true);
@@ -190,7 +190,7 @@ ConnectWindow::set_connecting_widget_states()
}
bool
-ConnectWindow::connect_remote(const Raul::URI& uri)
+ConnectWindow::connect_remote(const URI& uri)
{
Ingen::World* world = _app->world();
@@ -241,12 +241,12 @@ ConnectWindow::connect(bool existing)
uri_str = _url_entry->get_text();
}
- if (!Raul::URI::is_valid(uri_str)) {
+ if (!URI::is_valid(uri_str)) {
error((fmt("Invalid socket URI %1%") % uri_str).str());
return;
}
- _connect_uri = Raul::URI(uri_str);
+ _connect_uri = URI(uri_str);
} else if (_mode == Mode::LAUNCH_REMOTE) {
const std::string port = std::to_string(_port_spinbutton->get_value_as_int());
@@ -257,7 +257,7 @@ ConnectWindow::connect(bool existing)
return;
}
- _connect_uri = Raul::URI(std::string("tcp://localhost:") + port);
+ _connect_uri = URI(std::string("tcp://localhost:") + port);
} else if (_mode == Mode::INTERNAL) {
if (!world->engine()) {
@@ -310,7 +310,7 @@ ConnectWindow::activate()
return;
}
- _app->interface()->set_property(Raul::URI("ingen:/driver"),
+ _app->interface()->set_property(URI("ingen:/driver"),
_app->uris().ingen_enabled,
_app->forge().make(true));
}
@@ -322,7 +322,7 @@ ConnectWindow::deactivate()
return;
}
- _app->interface()->set_property(Raul::URI("ingen:/driver"),
+ _app->interface()->set_property(URI("ingen:/driver"),
_app->uris().ingen_enabled,
_app->forge().make(false));
}
@@ -376,8 +376,8 @@ ConnectWindow::load_widgets()
sigc::mem_fun(this, &ConnectWindow::quit_clicked));
_url_entry->set_text(_app->world()->conf().option("connect").ptr<char>());
- if (Raul::URI::is_valid(_url_entry->get_text())) {
- _connect_uri = Raul::URI(_url_entry->get_text());
+ if (URI::is_valid(_url_entry->get_text())) {
+ _connect_uri = URI(_url_entry->get_text());
}
_port_spinbutton->set_range(1, std::numeric_limits<uint16_t>::max());
@@ -499,7 +499,7 @@ ConnectWindow::gtk_callback()
_ping_id = g_random_int_range(1, std::numeric_limits<int32_t>::max());
_app->interface()->set_response_id(_ping_id);
- _app->interface()->get(Raul::URI("ingen:/engine"));
+ _app->interface()->get(URI("ingen:/engine"));
last = now;
attempts = 0;
next_stage();
@@ -515,13 +515,13 @@ ConnectWindow::gtk_callback()
_connect_stage = -1;
} else if (ms_since_last > 1000) {
_app->interface()->set_response_id(_ping_id);
- _app->interface()->get(Raul::URI("ingen:/engine"));
+ _app->interface()->get(URI("ingen:/engine"));
last = now;
++attempts;
}
}
} else if (_connect_stage == 3) {
- _app->interface()->get(Raul::URI(main_uri() + "/"));
+ _app->interface()->get(URI(main_uri().string() + "/"));
next_stage();
} else if (_connect_stage == 4) {
if (_app->store()->size() > 0) {
diff --git a/src/gui/ConnectWindow.hpp b/src/gui/ConnectWindow.hpp
index 015a6e76..08560361 100644
--- a/src/gui/ConnectWindow.hpp
+++ b/src/gui/ConnectWindow.hpp
@@ -70,7 +70,7 @@ private:
void disconnect();
void next_stage();
- bool connect_remote(const Raul::URI& uri);
+ bool connect_remote(const URI& uri);
void connect(bool existing);
void activate();
void deactivate();
@@ -101,7 +101,7 @@ private:
Gtk::Button* _quit_button;
Mode _mode;
- Raul::URI _connect_uri;
+ URI _connect_uri;
int32_t _ping_id;
bool _attached;
bool _finished_connecting;
diff --git a/src/gui/GraphBox.cpp b/src/gui/GraphBox.cpp
index def101a7..6f9969be 100644
--- a/src/gui/GraphBox.cpp
+++ b/src/gui/GraphBox.cpp
@@ -216,7 +216,7 @@ GraphBox::init_box(App& app)
{
_app = &app;
- const Raul::URI engine_uri(_app->interface()->uri());
+ const URI engine_uri(_app->interface()->uri());
if (engine_uri == "ingen:/clients/event_writer") {
_status_bar->push("Running internal engine", STATUS_CONTEXT_ENGINE);
} else {
@@ -381,7 +381,7 @@ GraphBox::graph_port_removed(SPtr<const PortModel> port)
}
void
-GraphBox::property_changed(const Raul::URI& predicate, const Atom& value)
+GraphBox::property_changed(const URI& predicate, const Atom& value)
{
if (predicate == _app->uris().ingen_sprungLayout) {
if (value.type() == _app->uris().forge.Bool) {
@@ -506,7 +506,7 @@ GraphBox::event_save()
if (!document.is_valid() || document.type() != _app->uris().forge.URI) {
event_save_as();
} else {
- save_graph(Raul::URI(document.ptr<char>()));
+ save_graph(URI(document.ptr<char>()));
}
}
@@ -537,9 +537,9 @@ GraphBox::confirm(const Glib::ustring& message,
}
void
-GraphBox::save_graph(const Raul::URI& uri)
+GraphBox::save_graph(const URI& uri)
{
- if (_app->interface()->uri().substr(0, 3) == "tcp") {
+ if (_app->interface()->uri().string().substr(0, 3) == "tcp") {
_status_bar->push(
(boost::format("Saved %1% to %2% on client")
% _graph->path() % uri).str(),
@@ -642,7 +642,7 @@ GraphBox::event_save_as()
if (confirmed) {
const Glib::ustring uri = Glib::filename_to_uri(filename);
- save_graph(Raul::URI(uri));
+ save_graph(URI(uri));
const_cast<GraphModel*>(_graph.get())->set_property(
uris.ingen_file,
@@ -876,7 +876,7 @@ void
GraphBox::event_animate_signals_toggled()
{
_app->interface()->set_property(
- Raul::URI("ingen:/clients/this"),
+ URI("ingen:/clients/this"),
_app->uris().ingen_broadcast,
_app->forge().make((bool)_menu_animate_signals->get_active()));
}
diff --git a/src/gui/GraphBox.hpp b/src/gui/GraphBox.hpp
index ee054e17..fd9bf9c0 100644
--- a/src/gui/GraphBox.hpp
+++ b/src/gui/GraphBox.hpp
@@ -40,6 +40,8 @@ class Path;
namespace Ingen {
+class URI;
+
namespace Client {
class GraphModel;
class PortModel;
@@ -97,7 +99,7 @@ public:
private:
void graph_port_added(SPtr<const Client::PortModel> port);
void graph_port_removed(SPtr<const Client::PortModel> port);
- void property_changed(const Raul::URI& predicate, const Atom& value);
+ void property_changed(const URI& predicate, const Atom& value);
void show_status(const Client::ObjectModel* model);
void error(const Glib::ustring& message,
@@ -106,7 +108,7 @@ private:
bool confirm(const Glib::ustring& message,
const Glib::ustring& secondary_text="");
- void save_graph(const Raul::URI& uri);
+ void save_graph(const URI& uri);
void event_import();
void event_save();
diff --git a/src/gui/GraphCanvas.cpp b/src/gui/GraphCanvas.cpp
index 4c7c34c8..a17915a5 100644
--- a/src/gui/GraphCanvas.cpp
+++ b/src/gui/GraphCanvas.cpp
@@ -320,7 +320,7 @@ GraphCanvas::add_plugin(SPtr<PluginModel> p)
}
void
-GraphCanvas::remove_plugin(const Raul::URI& uri)
+GraphCanvas::remove_plugin(const URI& uri)
{
// Flag menus as dirty so they will be rebuilt when needed next
_menu_dirty = true;
@@ -683,7 +683,7 @@ GraphCanvas::paste()
{{uris.rdf_type, Property(uris.ingen_Graph)}});
// Parse clipboard text into clipboard store
- boost::optional<Raul::URI> base_uri = parser->parse_string(
+ boost::optional<URI> base_uri = parser->parse_string(
_app.world(), &clipboard, str, main_uri());
// Figure out the copy graph base path
@@ -693,7 +693,7 @@ GraphCanvas::paste()
if (base[base.size() - 1] == '/') {
base = base.substr(0, base.size() - 1);
}
- copy_root = uri_to_path(Raul::URI(base));
+ copy_root = uri_to_path(URI(base));
}
// Find the minimum x and y coordinate of objects to be pasted
@@ -730,7 +730,7 @@ GraphCanvas::paste()
const SPtr<Node> node = c.second;
const Raul::Path& old_path = copy_root.child(node->path());
- const Raul::URI& old_uri = path_to_uri(old_path);
+ const URI& old_uri = path_to_uri(old_path);
const Raul::Path& new_path = avoider.map_path(parent.child(node->path()));
Properties props{{uris.lv2_prototype,
@@ -793,8 +793,10 @@ GraphCanvas::generate_port_name(
}
void
-GraphCanvas::menu_add_port(const string& sym_base, const string& name_base,
- const Raul::URI& type, bool is_output)
+GraphCanvas::menu_add_port(const string& sym_base,
+ const string& name_base,
+ const URI& type,
+ bool is_output)
{
string sym, name;
generate_port_name(sym_base, sym, name_base, name);
diff --git a/src/gui/GraphCanvas.hpp b/src/gui/GraphCanvas.hpp
index f283354e..a7340744 100644
--- a/src/gui/GraphCanvas.hpp
+++ b/src/gui/GraphCanvas.hpp
@@ -63,7 +63,7 @@ public:
bool show_port_names() const { return _show_port_names; }
void add_plugin(SPtr<Client::PluginModel> p);
- void remove_plugin(const Raul::URI& uri);
+ void remove_plugin(const URI& uri);
void add_block(SPtr<const Client::BlockModel> bm);
void remove_block(SPtr<const Client::BlockModel> bm);
void add_port(SPtr<const Client::PortModel> pm);
@@ -90,7 +90,7 @@ private:
void menu_add_port(const std::string& sym_base,
const std::string& name_base,
- const Raul::URI& type,
+ const URI& type,
bool is_output);
void menu_load_plugin();
diff --git a/src/gui/GraphPortModule.cpp b/src/gui/GraphPortModule.cpp
index 7dc24a20..5987b0e3 100644
--- a/src/gui/GraphPortModule.cpp
+++ b/src/gui/GraphPortModule.cpp
@@ -130,7 +130,7 @@ GraphPortModule::set_name(const std::string& n)
}
void
-GraphPortModule::property_changed(const Raul::URI& key, const Atom& value)
+GraphPortModule::property_changed(const URI& key, const Atom& value)
{
const URIs& uris = app().uris();
if (value.type() == uris.forge.Float) {
diff --git a/src/gui/GraphPortModule.hpp b/src/gui/GraphPortModule.hpp
index 79229be6..97bc2e5b 100644
--- a/src/gui/GraphPortModule.hpp
+++ b/src/gui/GraphPortModule.hpp
@@ -20,7 +20,6 @@
#include <string>
#include "ganv/Module.hpp"
-#include "raul/URI.hpp"
#include "Port.hpp"
@@ -68,7 +67,7 @@ protected:
void set_port(Port* port) { _port = port; }
- void property_changed(const Raul::URI& key, const Atom& value);
+ void property_changed(const URI& key, const Atom& value);
SPtr<const Client::PortModel> _model;
Port* _port;
diff --git a/src/gui/GraphTreeWindow.cpp b/src/gui/GraphTreeWindow.cpp
index e5522a74..1eb6557b 100644
--- a/src/gui/GraphTreeWindow.cpp
+++ b/src/gui/GraphTreeWindow.cpp
@@ -88,7 +88,7 @@ GraphTreeWindow::add_graph(SPtr<GraphModel> pm)
Gtk::TreeModel::iterator iter = _graph_treestore->append();
Gtk::TreeModel::Row row = *iter;
if (pm->path().is_root()) {
- row[_graph_tree_columns.name_col] = _app->interface()->uri();
+ row[_graph_tree_columns.name_col] = _app->interface()->uri().string();
} else {
row[_graph_tree_columns.name_col] = pm->symbol().c_str();
}
@@ -193,7 +193,7 @@ GraphTreeWindow::event_graph_enabled_toggled(const Glib::ustring& path_str)
}
void
-GraphTreeWindow::graph_property_changed(const Raul::URI& key,
+GraphTreeWindow::graph_property_changed(const URI& key,
const Atom& value,
SPtr<GraphModel> graph)
{
diff --git a/src/gui/GraphTreeWindow.hpp b/src/gui/GraphTreeWindow.hpp
index af767a2a..005f39a8 100644
--- a/src/gui/GraphTreeWindow.hpp
+++ b/src/gui/GraphTreeWindow.hpp
@@ -49,7 +49,7 @@ public:
void new_object(SPtr<Client::ObjectModel> object);
- void graph_property_changed(const Raul::URI& key,
+ void graph_property_changed(const URI& key,
const Atom& value,
SPtr<Client::GraphModel> graph);
diff --git a/src/gui/GraphView.cpp b/src/gui/GraphView.cpp
index cb722066..e6361249 100644
--- a/src/gui/GraphView.cpp
+++ b/src/gui/GraphView.cpp
@@ -135,7 +135,7 @@ GraphView::poly_changed()
}
void
-GraphView::property_changed(const Raul::URI& predicate, const Atom& value)
+GraphView::property_changed(const URI& predicate, const Atom& value)
{
_enable_signal = false;
if (predicate == _app->uris().ingen_enabled) {
diff --git a/src/gui/GraphView.hpp b/src/gui/GraphView.hpp
index 54d47c72..03569831 100644
--- a/src/gui/GraphView.hpp
+++ b/src/gui/GraphView.hpp
@@ -27,7 +27,6 @@
#include <gtkmm/toolitem.h>
#include "ingen/types.hpp"
-#include "raul/URI.hpp"
namespace Raul { class Atom; }
@@ -77,7 +76,7 @@ private:
void poly_changed();
void clear_clicked();
- void property_changed(const Raul::URI& predicate, const Atom& value);
+ void property_changed(const URI& predicate, const Atom& value);
App* _app;
diff --git a/src/gui/LoadPluginWindow.cpp b/src/gui/LoadPluginWindow.cpp
index 0eb65f8d..c96634cc 100644
--- a/src/gui/LoadPluginWindow.cpp
+++ b/src/gui/LoadPluginWindow.cpp
@@ -296,7 +296,7 @@ LoadPluginWindow::set_row(Gtk::TreeModel::Row& row,
row[_plugins_columns._col_type] = "";
}
- row[_plugins_columns._col_uri] = plugin->uri();
+ row[_plugins_columns._col_uri] = plugin->uri().string();
row[_plugins_columns._col_plugin] = plugin;
}
@@ -498,9 +498,9 @@ LoadPluginWindow::on_key_press_event(GdkEventKey* event)
}
void
-LoadPluginWindow::plugin_property_changed(const Raul::URI& plugin,
- const Raul::URI& predicate,
- const Atom& value)
+LoadPluginWindow::plugin_property_changed(const URI& plugin,
+ const URI& predicate,
+ const Atom& value)
{
const URIs& uris = _app->uris();
if (predicate == uris.doap_name) {
diff --git a/src/gui/LoadPluginWindow.hpp b/src/gui/LoadPluginWindow.hpp
index 71ac76e2..3874b8dd 100644
--- a/src/gui/LoadPluginWindow.hpp
+++ b/src/gui/LoadPluginWindow.hpp
@@ -116,9 +116,9 @@ private:
void new_plugin(SPtr<const Client::PluginModel> pm);
- void plugin_property_changed(const Raul::URI& plugin,
- const Raul::URI& predicate,
- const Atom& value);
+ void plugin_property_changed(const URI& plugin,
+ const URI& predicate,
+ const Atom& value);
void plugin_activated(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* col);
void plugin_selection_changed();
@@ -132,7 +132,7 @@ private:
SPtr<const Client::GraphModel> _graph;
- typedef std::map<Raul::URI, Gtk::TreeModel::iterator> Rows;
+ typedef std::map<URI, Gtk::TreeModel::iterator> Rows;
Rows _rows;
Glib::RefPtr<Gtk::ListStore> _plugins_liststore;
diff --git a/src/gui/NodeMenu.cpp b/src/gui/NodeMenu.cpp
index 73564f9d..1b1b1677 100644
--- a/src/gui/NodeMenu.cpp
+++ b/src/gui/NodeMenu.cpp
@@ -137,7 +137,7 @@ NodeMenu::init(App& app, SPtr<const Client::BlockModel> block)
}
void
-NodeMenu::add_preset(const Raul::URI& uri, const std::string& label)
+NodeMenu::add_preset(const URI& uri, const std::string& label)
{
if (_presets_menu) {
_presets_menu->items().push_back(
@@ -225,7 +225,7 @@ NodeMenu::on_save_preset_activated()
_app->forge().alloc(basename) },
{ _app->uris().lv2_prototype,
_app->forge().make_urid(block()->uri()) }};
- _app->interface()->put(Raul::URI(real_uri), props);
+ _app->interface()->put(URI(real_uri), props);
}
}
@@ -234,7 +234,7 @@ NodeMenu::on_preset_activated(const std::string& uri)
{
_app->set_property(block()->uri(),
_app->uris().pset_preset,
- _app->forge().make_urid(Raul::URI(uri)));
+ _app->forge().make_urid(URI(uri)));
}
bool
diff --git a/src/gui/NodeMenu.hpp b/src/gui/NodeMenu.hpp
index c8ac3daf..5d9f1e6d 100644
--- a/src/gui/NodeMenu.hpp
+++ b/src/gui/NodeMenu.hpp
@@ -52,7 +52,7 @@ protected:
return dynamic_ptr_cast<const Client::BlockModel>(_object);
}
- void add_preset(const Raul::URI& uri, const std::string& label);
+ void add_preset(const URI& uri, const std::string& label);
void on_menu_disconnect();
void on_menu_embed_gui();
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index 2e81128a..dadffff0 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -457,7 +457,7 @@ NodeModule::store_location(double ax, double ay)
}
void
-NodeModule::property_changed(const Raul::URI& key, const Atom& value)
+NodeModule::property_changed(const URI& key, const Atom& value)
{
const URIs& uris = app().uris();
if (value.type() == uris.forge.Float) {
diff --git a/src/gui/NodeModule.hpp b/src/gui/NodeModule.hpp
index f2381999..863b6ffb 100644
--- a/src/gui/NodeModule.hpp
+++ b/src/gui/NodeModule.hpp
@@ -79,7 +79,7 @@ protected:
bool on_selected(gboolean selected);
void rename();
- void property_changed(const Raul::URI& key, const Atom& value);
+ void property_changed(const URI& key, const Atom& value);
void new_port_view(SPtr<const Client::PortModel> port);
diff --git a/src/gui/ObjectMenu.cpp b/src/gui/ObjectMenu.cpp
index c113cac9..bfce4248 100644
--- a/src/gui/ObjectMenu.cpp
+++ b/src/gui/ObjectMenu.cpp
@@ -119,7 +119,7 @@ ObjectMenu::on_menu_polyphonic()
}
void
-ObjectMenu::property_changed(const Raul::URI& predicate, const Atom& value)
+ObjectMenu::property_changed(const URI& predicate, const Atom& value)
{
const URIs& uris = _app->uris();
_enable_signal = false;
diff --git a/src/gui/ObjectMenu.hpp b/src/gui/ObjectMenu.hpp
index a9766614..a9b07fd5 100644
--- a/src/gui/ObjectMenu.hpp
+++ b/src/gui/ObjectMenu.hpp
@@ -55,7 +55,7 @@ protected:
void on_menu_destroy();
void on_menu_properties();
- void property_changed(const Raul::URI& predicate, const Atom& value);
+ void property_changed(const URI& predicate, const Atom& value);
App* _app;
SPtr<const Client::ObjectModel> _object;
diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp
index 9622a7f5..9742cee3 100644
--- a/src/gui/Port.cpp
+++ b/src/gui/Port.cpp
@@ -246,7 +246,7 @@ Port::build_enum_menu()
}
void
-Port::on_uri_activated(const Raul::URI& uri)
+Port::on_uri_activated(const URI& uri)
{
_app.set_property(model()->uri(),
_app.world()->uris().ingen_value,
@@ -278,7 +278,7 @@ Port::build_uri_menu()
LilvNodes* range = lilv_world_find_nodes(
world->lilv_world(), designation, rdfs_range, nullptr);
LILV_FOREACH(nodes, r, range) {
- ranges.insert(Raul::URI(lilv_node_as_string(lilv_nodes_get(range, r))));
+ ranges.insert(URI(lilv_node_as_string(lilv_nodes_get(range, r))));
}
RDFS::classes(world, ranges, false);
@@ -450,7 +450,7 @@ Port::port_properties_changed()
}
void
-Port::property_changed(const Raul::URI& key, const Atom& value)
+Port::property_changed(const URI& key, const Atom& value)
{
const URIs& uris = _app.uris();
if (value.type() == uris.forge.Float) {
@@ -495,7 +495,7 @@ Port::property_changed(const Raul::URI& key, const Atom& value)
}
void
-Port::property_removed(const Raul::URI& key, const Atom& value)
+Port::property_removed(const URI& key, const Atom& value)
{
const URIs& uris = _app.uris();
if (key == uris.lv2_minimum || key == uris.lv2_maximum) {
diff --git a/src/gui/Port.hpp b/src/gui/Port.hpp
index 5f683412..c714feae 100644
--- a/src/gui/Port.hpp
+++ b/src/gui/Port.hpp
@@ -27,11 +27,12 @@
namespace Raul {
class Atom;
-class URI;
}
namespace Ingen {
+class URI;
+
namespace Client { class PortModel; }
namespace GUI {
@@ -78,13 +79,13 @@ private:
Gtk::Menu* build_uri_menu();
GraphBox* get_graph_box() const;
- void property_changed(const Raul::URI& key, const Atom& value);
- void property_removed(const Raul::URI& key, const Atom& value);
+ void property_changed(const URI& key, const Atom& value);
+ void property_removed(const URI& key, const Atom& value);
void moved();
void on_value_changed(double value);
void on_scale_point_activated(float f);
- void on_uri_activated(const Raul::URI& uri);
+ void on_uri_activated(const URI& uri);
bool on_event(GdkEvent* ev);
void port_properties_changed();
void set_type_tag();
diff --git a/src/gui/PropertiesWindow.cpp b/src/gui/PropertiesWindow.cpp
index db939b73..4d47b3ae 100644
--- a/src/gui/PropertiesWindow.cpp
+++ b/src/gui/PropertiesWindow.cpp
@@ -39,7 +39,7 @@ using namespace Client;
namespace GUI {
-typedef std::set<Raul::URI> URISet;
+typedef std::set<URI> URISet;
PropertiesWindow::PropertiesWindow(BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& xml)
@@ -100,7 +100,7 @@ PropertiesWindow::present(SPtr<const ObjectModel> model)
}
void
-PropertiesWindow::add_property(const Raul::URI& key, const Atom& value)
+PropertiesWindow::add_property(const URI& key, const Atom& value)
{
World* world = _app->world();
@@ -114,7 +114,9 @@ PropertiesWindow::add_property(const Raul::URI& key, const Atom& value)
name = world->rdf_world()->prefixes().qualify(key);
}
Gtk::Label* label = new Gtk::Label(
- std::string("<a href=\"") + key + "\">" + name + "</a>", 1.0, 0.5);
+ std::string("<a href=\"") + key.string() + "\">" + name + "</a>",
+ 1.0,
+ 0.5);
label->set_use_markup(true);
_app->set_tooltip(label, prop);
_table->attach(*Gtk::manage(label), 0, 1, n_rows, n_rows + 1,
@@ -144,7 +146,7 @@ PropertiesWindow::add_property(const Raul::URI& key, const Atom& value)
bool
PropertiesWindow::datatype_supported(const RDFS::URISet& types,
- Raul::URI* widget_type)
+ URI* widget_type)
{
if (types.find(_app->uris().atom_Int) != types.end()) {
*widget_type = _app->uris().atom_Int;
@@ -211,8 +213,8 @@ PropertiesWindow::set_object(SPtr<const ObjectModel> model)
world->lilv_world(), LILV_NS_RDFS "Datatype");
// Populate key combo
- const URISet props = RDFS::properties(world, model);
- std::map<std::string, Raul::URI> entries;
+ const URISet props = RDFS::properties(world, model);
+ std::map<std::string, URI> entries;
for (const auto& p : props) {
LilvNode* prop = lilv_new_uri(world->lilv_world(), p.c_str());
const std::string label = RDFS::label(world, prop);
@@ -228,7 +230,7 @@ PropertiesWindow::set_object(SPtr<const ObjectModel> model)
if (RDFS::is_a(world, range, rdfs_DataType)) {
// Range is a datatype, show if type or any subtype is supported
RDFS::datatypes(_app->world(), ranges, false);
- Raul::URI widget_type("urn:nothing");
+ URI widget_type("urn:nothing");
if (datatype_supported(ranges, &widget_type)) {
entries.emplace(label, p);
}
@@ -243,7 +245,7 @@ PropertiesWindow::set_object(SPtr<const ObjectModel> model)
for (const auto& e : entries) {
Gtk::ListStore::iterator ki = _key_store->append();
Gtk::ListStore::Row row = *ki;
- row[_combo_columns.uri_col] = e.second;
+ row[_combo_columns.uri_col] = e.second.string();
row[_combo_columns.label_col] = e.first;
}
@@ -263,23 +265,23 @@ PropertiesWindow::set_object(SPtr<const ObjectModel> model)
}
Gtk::Widget*
-PropertiesWindow::create_value_widget(const Raul::URI& key,
- const char* type_uri,
- const Atom& value)
+PropertiesWindow::create_value_widget(const URI& key,
+ const char* type_uri,
+ const Atom& value)
{
- if (!type_uri || !Raul::URI::is_valid(type_uri)) {
+ if (!type_uri || !URI::is_valid(type_uri)) {
return nullptr;
}
- Raul::URI type(type_uri);
+ URI type(type_uri);
Ingen::World* world = _app->world();
LilvWorld* lworld = world->lilv_world();
// See if type is a datatype we support
- std::set<Raul::URI> types{type};
+ std::set<URI> types{type};
RDFS::datatypes(_app->world(), types, false);
- Raul::URI widget_type("urn:nothing");
+ URI widget_type("urn:nothing");
const bool supported = datatype_supported(types, &widget_type);
if (supported) {
type = widget_type;
@@ -390,7 +392,7 @@ PropertiesWindow::on_show()
}
void
-PropertiesWindow::change_property(const Raul::URI& key, const Atom& value)
+PropertiesWindow::change_property(const URI& key, const Atom& value)
{
auto r = _records.find(key);
if (r == _records.end()) {
@@ -413,7 +415,7 @@ PropertiesWindow::change_property(const Raul::URI& key, const Atom& value)
}
void
-PropertiesWindow::remove_property(const Raul::URI& key, const Atom& value)
+PropertiesWindow::remove_property(const URI& key, const Atom& value)
{
// Bleh, there doesn't seem to be an easy way to remove a Gtk::Table row...
_records.clear();
@@ -449,8 +451,8 @@ PropertiesWindow::get_value(LV2_URID type, Gtk::Widget* value_widget)
}
} else if (type == forge.URI || type == forge.URID) {
URIEntry* uri_entry = dynamic_cast<URIEntry*>(value_widget);
- if (uri_entry && Raul::URI::is_valid(uri_entry->get_text())) {
- return _app->forge().make_urid(Raul::URI(uri_entry->get_text()));
+ if (uri_entry && URI::is_valid(uri_entry->get_text())) {
+ return _app->forge().make_urid(URI(uri_entry->get_text()));
} else {
_app->log().error(fmt("Invalid URI <%1%>\n") % uri_entry->get_text());
}
@@ -465,7 +467,7 @@ PropertiesWindow::get_value(LV2_URID type, Gtk::Widget* value_widget)
}
void
-PropertiesWindow::on_change(const Raul::URI& key)
+PropertiesWindow::on_change(const URI& key)
{
auto r = _records.find(key);
if (r == _records.end()) {
@@ -512,7 +514,7 @@ PropertiesWindow::key_changed()
const URISet ranges = RDFS::range(_app->world(), prop, true);
for (const auto& r : ranges) {
Gtk::Widget* value_widget = create_value_widget(
- Raul::URI(key_uri), r.c_str(), Atom());
+ URI(key_uri), r.c_str(), Atom());
if (value_widget) {
_add_button->set_sensitive(true);
@@ -542,7 +544,7 @@ PropertiesWindow::add_clicked()
if (value.is_valid()) {
// Send property to engine
Properties properties;
- properties.emplace(Raul::URI(key_uri.c_str()), Property(value));
+ properties.emplace(URI(key_uri.c_str()), Property(value));
_app->interface()->put(_model->uri(), properties);
}
}
@@ -560,8 +562,8 @@ PropertiesWindow::apply_clicked()
Properties remove;
Properties add;
for (const auto& r : _records) {
- const Raul::URI& uri = r.first;
- const Record& record = r.second;
+ const URI& uri = r.first;
+ const Record& record = r.second;
if (record.present_button->get_active()) {
if (!_model->has_property(uri, record.value)) {
add.emplace(uri, record.value);
diff --git a/src/gui/PropertiesWindow.hpp b/src/gui/PropertiesWindow.hpp
index c9a2c9f4..f4a8dd0d 100644
--- a/src/gui/PropertiesWindow.hpp
+++ b/src/gui/PropertiesWindow.hpp
@@ -76,19 +76,19 @@ private:
Gtk::TreeModelColumn<Glib::ustring> uri_col;
};
- void add_property(const Raul::URI& key, const Atom& value);
- void change_property(const Raul::URI& key, const Atom& value);
- void remove_property(const Raul::URI& key, const Atom& value);
- void on_change(const Raul::URI& key);
+ void add_property(const URI& key, const Atom& value);
+ void change_property(const URI& key, const Atom& value);
+ void remove_property(const URI& key, const Atom& value);
+ void on_change(const URI& key);
- bool datatype_supported(const std::set<Raul::URI>& types,
- Raul::URI* widget_type);
+ bool datatype_supported(const std::set<URI>& types,
+ URI* widget_type);
- bool class_supported(const std::set<Raul::URI>& types);
+ bool class_supported(const std::set<URI>& types);
- Gtk::Widget* create_value_widget(const Raul::URI& key,
- const char* type_uri,
- const Atom& value = Atom());
+ Gtk::Widget* create_value_widget(const URI& key,
+ const char* type_uri,
+ const Atom& value = Atom());
Atom get_value(LV2_URID type, Gtk::Widget* value_widget);
@@ -103,7 +103,7 @@ private:
void apply_clicked();
void ok_clicked();
- typedef std::map<Raul::URI, Record> Records;
+ typedef std::map<URI, Record> Records;
Records _records;
SPtr<const Client::ObjectModel> _model;
diff --git a/src/gui/RDFS.cpp b/src/gui/RDFS.cpp
index b524aed7..71b3441a 100644
--- a/src/gui/RDFS.cpp
+++ b/src/gui/RDFS.cpp
@@ -76,7 +76,7 @@ closure(World* world, const LilvNode* pred, URISet& types, bool super)
LILV_FOREACH(nodes, m, matches) {
const LilvNode* klass_node = lilv_nodes_get(matches, m);
if (lilv_node_is_uri(klass_node)) {
- Raul::URI klass(lilv_node_as_uri(klass_node));
+ URI klass(lilv_node_as_uri(klass_node));
if (!types.count(klass)) {
++added;
klasses.insert(klass);
@@ -120,12 +120,12 @@ types(World* world, SPtr<const Client::ObjectModel> model)
// Start with every rdf:type
URISet types;
- types.insert(Raul::URI(LILV_NS_RDFS "Resource"));
+ types.insert(URI(LILV_NS_RDFS "Resource"));
PropRange range = model->properties().equal_range(world->uris().rdf_type);
for (auto t = range.first; t != range.second; ++t) {
if (t->second.type() == world->forge().URI ||
t->second.type() == world->forge().URID) {
- const Raul::URI type(world->forge().str(t->second, false));
+ const URI type(world->forge().str(t->second, false));
types.insert(type);
if (world->uris().ingen_Graph == type) {
// Add lv2:Plugin as a type for graphs so plugin properties show up
@@ -170,7 +170,7 @@ properties(World* world, SPtr<const Client::ObjectModel> model)
continue;
}
- const Raul::URI domain(lilv_node_as_uri(domain_node));
+ const URI domain(lilv_node_as_uri(domain_node));
if (types.count(domain)) {
++n_matching_domains;
}
@@ -179,7 +179,7 @@ properties(World* world, SPtr<const Client::ObjectModel> model)
if (lilv_nodes_size(domains) == 0 || (
n_matching_domains > 0 &&
n_matching_domains == lilv_nodes_size(domains))) {
- properties.insert(Raul::URI(lilv_node_as_uri(prop)));
+ properties.insert(URI(lilv_node_as_uri(prop)));
}
lilv_nodes_free(domains);
@@ -210,7 +210,7 @@ instances(World* world, const URISet& types)
continue;
}
const std::string label = RDFS::label(world, object);
- result.emplace(label, Raul::URI(lilv_node_as_string(object)));
+ result.emplace(label, URI(lilv_node_as_string(object)));
}
lilv_node_free(type);
}
@@ -230,7 +230,7 @@ range(World* world, const LilvNode* prop, bool recursive)
URISet ranges;
LILV_FOREACH(nodes, n, nodes) {
- ranges.insert(Raul::URI(lilv_node_as_string(lilv_nodes_get(nodes, n))));
+ ranges.insert(URI(lilv_node_as_string(lilv_nodes_get(nodes, n))));
}
if (recursive) {
diff --git a/src/gui/RDFS.hpp b/src/gui/RDFS.hpp
index 7208c638..f59bbdf5 100644
--- a/src/gui/RDFS.hpp
+++ b/src/gui/RDFS.hpp
@@ -23,7 +23,6 @@
#include "ingen/types.hpp"
#include "lilv/lilv.h"
-#include "raul/URI.hpp"
namespace Ingen {
@@ -36,10 +35,10 @@ namespace GUI {
namespace RDFS {
/** Set of URIs. */
-typedef std::set<Raul::URI> URISet;
+typedef std::set<URI> URISet;
/** Label => Resource map. */
-typedef std::map<std::string, Raul::URI> Objects;
+typedef std::map<std::string, URI> Objects;
/** Return the label of `node`. */
std::string label(World* world, const LilvNode* node);
diff --git a/src/gui/ThreadedLoader.cpp b/src/gui/ThreadedLoader.cpp
index 93c97cbd..891502f7 100644
--- a/src/gui/ThreadedLoader.cpp
+++ b/src/gui/ThreadedLoader.cpp
@@ -14,6 +14,7 @@
along with Ingen. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <cassert>
#include <string>
#include "ingen/Log.hpp"
@@ -30,11 +31,11 @@ namespace Ingen {
namespace GUI {
ThreadedLoader::ThreadedLoader(App& app, SPtr<Interface> engine)
- : _app(app)
- , _sem(0)
- , _engine(std::move(engine))
- , _exit_flag(false)
- , _thread(&ThreadedLoader::run, this)
+ : _app(app)
+ , _sem(0)
+ , _engine(std::move(engine))
+ , _exit_flag(false)
+ , _thread(&ThreadedLoader::run, this)
{
if (!parser()) {
app.log().warn("Parser unavailable, graph loading disabled\n");
@@ -85,13 +86,12 @@ ThreadedLoader::load_graph(bool merge,
}
}
- _events.push_back(
- sigc::hide_return(
- sigc::bind(sigc::mem_fun(this, &ThreadedLoader::load_graph_event),
- document_uri,
- engine_parent,
- engine_symbol,
- engine_data)));
+ _events.push_back(sigc::hide_return(
+ sigc::bind(sigc::mem_fun(this, &ThreadedLoader::load_graph_event),
+ document_uri,
+ engine_parent,
+ engine_symbol,
+ engine_data)));
_mutex.unlock();
_sem.post();
@@ -114,15 +114,14 @@ ThreadedLoader::load_graph_event(const Glib::ustring& document_uri,
}
void
-ThreadedLoader::save_graph(SPtr<const Client::GraphModel> model,
- const std::string& filename)
+ThreadedLoader::save_graph(SPtr<const Client::GraphModel> model, const URI& uri)
{
_mutex.lock();
- _events.push_back(
- sigc::hide_return(
- sigc::bind(sigc::mem_fun(this, &ThreadedLoader::save_graph_event),
- model, filename)));
+ _events.push_back(sigc::hide_return(
+ sigc::bind(sigc::mem_fun(this, &ThreadedLoader::save_graph_event),
+ model,
+ uri)));
_mutex.unlock();
_sem.post();
@@ -130,15 +129,16 @@ ThreadedLoader::save_graph(SPtr<const Client::GraphModel> model,
void
ThreadedLoader::save_graph_event(SPtr<const Client::GraphModel> model,
- const std::string& filename)
+ const URI& uri)
{
+ assert(uri.scheme() == "file");
if (_app.serialiser()) {
std::lock_guard<std::mutex> lock(_app.world()->rdf_mutex());
- if (filename.find(".ingen") != std::string::npos) {
- _app.serialiser()->write_bundle(model, filename);
+ if (uri.string().find(".ingen") != std::string::npos) {
+ _app.serialiser()->write_bundle(model, uri);
} else {
- _app.serialiser()->start_to_file(model->path(), filename);
+ _app.serialiser()->start_to_file(model->path(), std::string(uri.path()));
_app.serialiser()->serialise(model);
_app.serialiser()->finish();
}
diff --git a/src/gui/ThreadedLoader.hpp b/src/gui/ThreadedLoader.hpp
index c0a4ed6a..64968230 100644
--- a/src/gui/ThreadedLoader.hpp
+++ b/src/gui/ThreadedLoader.hpp
@@ -32,6 +32,9 @@
#include "raul/Semaphore.hpp"
namespace Ingen {
+
+class URI;
+
namespace GUI {
/** Thread for loading graph files.
@@ -59,8 +62,7 @@ public:
boost::optional<Raul::Symbol> engine_symbol,
boost::optional<Properties> engine_data);
- void save_graph(SPtr<const Client::GraphModel> model,
- const std::string& filename);
+ void save_graph(SPtr<const Client::GraphModel> model, const URI& uri);
SPtr<Parser> parser();
@@ -71,7 +73,7 @@ private:
boost::optional<Properties> engine_data);
void save_graph_event(SPtr<const Client::GraphModel> model,
- const std::string& filename);
+ const URI& filename);
/** Returns nothing and takes no parameters (because they have all been bound) */
typedef sigc::slot<void> Closure;
diff --git a/src/gui/URIEntry.cpp b/src/gui/URIEntry.cpp
index 3c236572..0b81afd7 100644
--- a/src/gui/URIEntry.cpp
+++ b/src/gui/URIEntry.cpp
@@ -23,14 +23,12 @@
namespace Ingen {
namespace GUI {
-URIEntry::URIEntry(App* app,
- std::set<Raul::URI> types,
- const std::string& value)
- : Gtk::HBox(false, 4)
- , _app(app)
- , _types(std::move(types))
- , _menu_button(Gtk::manage(new Gtk::Button("≡")))
- , _entry(Gtk::manage(new Gtk::Entry()))
+URIEntry::URIEntry(App* app, std::set<URI> types, const std::string& value)
+ : Gtk::HBox(false, 4)
+ , _app(app)
+ , _types(std::move(types))
+ , _menu_button(Gtk::manage(new Gtk::Button("≡")))
+ , _entry(Gtk::manage(new Gtk::Entry()))
{
pack_start(*_entry, true, true);
pack_start(*_menu_button, false, true);
diff --git a/src/gui/URIEntry.hpp b/src/gui/URIEntry.hpp
index 90df2160..2f55a3d9 100644
--- a/src/gui/URIEntry.hpp
+++ b/src/gui/URIEntry.hpp
@@ -36,9 +36,7 @@ public:
* If `types` is given, then a menu button will be shown which pops up a
* enu for easily choosing known values with valid types.
*/
- URIEntry(App* app,
- std::set<Raul::URI> types,
- const std::string& value);
+ URIEntry(App* app, std::set<URI> types, const std::string& value);
std::string get_text() { return _entry->get_text(); }
Glib::SignalProxy0<void> signal_changed() { return _entry->signal_changed(); }
@@ -58,10 +56,10 @@ private:
void uri_chosen(const std::string& uri);
bool menu_button_event(GdkEvent* ev);
- App* _app;
- const std::set<Raul::URI> _types;
- Gtk::Button* _menu_button;
- Gtk::Entry* _entry;
+ App* _app;
+ const std::set<URI> _types;
+ Gtk::Button* _menu_button;
+ Gtk::Entry* _entry;
};
} // namespace GUI
diff --git a/src/ingen/ingen.cpp b/src/ingen/ingen.cpp
index b775d415..5630e56b 100644
--- a/src/ingen/ingen.cpp
+++ b/src/ingen/ingen.cpp
@@ -134,10 +134,10 @@ main(int argc, char** argv)
Client::SocketClient::register_factories(world.get());
#endif
const char* const uri = conf.option("connect").ptr<char>();
- ingen_try(Raul::URI::is_valid(uri),
+ ingen_try(URI::is_valid(uri),
(fmt("Invalid URI <%1%>") % uri).str().c_str());
SPtr<Interface> client(new Client::ThreadedSigClientInterface());
- engine_interface = world->new_interface(Raul::URI(uri), client);
+ engine_interface = world->new_interface(URI(uri), client);
if (!engine_interface && !conf.option("gui").get<int32_t>()) {
cerr << (fmt("ingen: error: Failed to connect to `%1%'\n") % uri);
@@ -188,7 +188,7 @@ main(int argc, char** argv)
const string graph = conf.option("load").ptr<char>();
- engine_interface->get(Raul::URI("ingen:/plugins"));
+ engine_interface->get(URI("ingen:/plugins"));
engine_interface->get(main_uri());
std::lock_guard<std::mutex> lock(world->rdf_mutex());
@@ -198,14 +198,13 @@ main(int argc, char** argv)
const char* path = conf.option("server-load").ptr<char>();
if (serd_uri_string_has_scheme((const uint8_t*)path)) {
std::cout << "Loading " << path << " (server side)" << std::endl;
- engine_interface->copy(Raul::URI(path), main_uri());
+ engine_interface->copy(URI(path), main_uri());
} else {
SerdNode uri = serd_node_new_file_uri(
(const uint8_t*)path, nullptr, nullptr, true);
std::cout << "Loading " << (const char*)uri.buf
<< " (server side)" << std::endl;
- engine_interface->copy(Raul::URI((const char*)uri.buf),
- main_uri());
+ engine_interface->copy(URI((const char*)uri.buf), main_uri());
serd_node_free(&uri);
}
}
@@ -215,13 +214,12 @@ main(int argc, char** argv)
const char* path = conf.option("save").ptr<char>();
if (serd_uri_string_has_scheme((const uint8_t*)path)) {
std::cout << "Saving to " << path << std::endl;
- engine_interface->copy(main_uri(), Raul::URI(path));
+ engine_interface->copy(main_uri(), URI(path));
} else {
SerdNode uri = serd_node_new_file_uri(
(const uint8_t*)path, nullptr, nullptr, true);
std::cout << "Saving to " << (const char*)uri.buf << std::endl;
- engine_interface->copy(main_uri(),
- Raul::URI((const char*)uri.buf));
+ engine_interface->copy(main_uri(), URI((const char*)uri.buf));
serd_node_free(&uri);
}
}
diff --git a/src/server/BlockFactory.cpp b/src/server/BlockFactory.cpp
index a1367e12..65108483 100644
--- a/src/server/BlockFactory.cpp
+++ b/src/server/BlockFactory.cpp
@@ -99,7 +99,7 @@ BlockFactory::refresh()
}
PluginImpl*
-BlockFactory::plugin(const Raul::URI& uri)
+BlockFactory::plugin(const URI& uri)
{
load_plugin(uri);
const Plugins::const_iterator i = _plugins.find(uri);
@@ -127,7 +127,7 @@ BlockFactory::load_internal_plugins()
}
void
-BlockFactory::load_plugin(const Raul::URI& uri)
+BlockFactory::load_plugin(const URI& uri)
{
if (_has_loaded || _plugins.find(uri) != _plugins.end()) {
return;
@@ -152,7 +152,7 @@ BlockFactory::load_lv2_plugins()
typedef std::vector< SPtr<LilvNode> > Types;
Types types;
for (unsigned t = PortType::ID::AUDIO; t <= PortType::ID::ATOM; ++t) {
- const Raul::URI& uri(PortType((PortType::ID)t).uri());
+ const URI& uri(PortType((PortType::ID)t).uri());
types.push_back(
SPtr<LilvNode>(lilv_new_uri(_world->lilv_world(), uri.c_str()),
lilv_node_free));
@@ -161,7 +161,7 @@ BlockFactory::load_lv2_plugins()
const LilvPlugins* plugins = lilv_world_get_all_plugins(_world->lilv_world());
LILV_FOREACH(plugins, i, plugins) {
const LilvPlugin* lv2_plug = lilv_plugins_get(plugins, i);
- const Raul::URI uri(lilv_node_as_uri(lilv_plugin_get_uri(lv2_plug)));
+ const URI uri(lilv_node_as_uri(lilv_plugin_get_uri(lv2_plug)));
// Ignore plugins that require features Ingen doesn't support
LilvNodes* features = lilv_plugin_get_required_features(lv2_plug);
diff --git a/src/server/BlockFactory.hpp b/src/server/BlockFactory.hpp
index 71e72bbc..25885f75 100644
--- a/src/server/BlockFactory.hpp
+++ b/src/server/BlockFactory.hpp
@@ -23,7 +23,6 @@
#include "ingen/World.hpp"
#include "ingen/types.hpp"
#include "raul/Noncopyable.hpp"
-#include "raul/URI.hpp"
namespace Ingen {
namespace Server {
@@ -46,12 +45,12 @@ public:
*/
std::set<PluginImpl*> refresh();
- void load_plugin(const Raul::URI& uri);
+ void load_plugin(const URI& uri);
- typedef std::map<Raul::URI, PluginImpl*> Plugins;
+ typedef std::map<URI, PluginImpl*> Plugins;
const Plugins& plugins();
- PluginImpl* plugin(const Raul::URI& uri);
+ PluginImpl* plugin(const URI& uri);
private:
void load_lv2_plugins();
diff --git a/src/server/BlockImpl.hpp b/src/server/BlockImpl.hpp
index 7907b0d8..d663e319 100644
--- a/src/server/BlockImpl.hpp
+++ b/src/server/BlockImpl.hpp
@@ -102,14 +102,14 @@ public:
void set_enabled(bool e) { _enabled = e; }
/** Load a preset from the world for this block. */
- virtual LilvState* load_preset(const Raul::URI& uri) { return nullptr; }
+ virtual LilvState* load_preset(const URI& uri) { return nullptr; }
/** Restore `state`. */
virtual void apply_state(const UPtr<Worker>& worker, const LilvState* state) {}
/** Save current state as preset. */
virtual boost::optional<Resource>
- save_preset(const Raul::URI& bundle,
+ save_preset(const URI& bundle,
const Properties& props) { return boost::optional<Resource>(); }
/** Learn the next incoming MIDI event (for internals) */
diff --git a/src/server/Broadcaster.hpp b/src/server/Broadcaster.hpp
index b51c744c..3981b265 100644
--- a/src/server/Broadcaster.hpp
+++ b/src/server/Broadcaster.hpp
@@ -97,7 +97,7 @@ public:
}
}
- Raul::URI uri() const override { return Raul::URI("ingen:/broadcaster"); }
+ URI uri() const override { return URI("ingen:/broadcaster"); }
private:
friend class Transfer;
diff --git a/src/server/ClientUpdate.cpp b/src/server/ClientUpdate.cpp
index b65fac12..60dd02e3 100644
--- a/src/server/ClientUpdate.cpp
+++ b/src/server/ClientUpdate.cpp
@@ -27,7 +27,7 @@ namespace Ingen {
namespace Server {
void
-ClientUpdate::put(const Raul::URI& uri,
+ClientUpdate::put(const URI& uri,
const Properties& props,
Resource::Graph ctx)
{
@@ -106,8 +106,8 @@ ClientUpdate::put_plugin(PluginImpl* plugin)
void
ClientUpdate::put_preset(const URIs& uris,
- const Raul::URI& plugin,
- const Raul::URI& preset,
+ const URI& plugin,
+ const URI& preset,
const std::string& label)
{
const Properties props{
@@ -118,7 +118,7 @@ ClientUpdate::put_preset(const URIs& uris,
}
void
-ClientUpdate::del(const Raul::URI& subject)
+ClientUpdate::del(const URI& subject)
{
dels.push_back(subject);
}
@@ -135,7 +135,7 @@ void
ClientUpdate::send(Interface& dest)
{
// Send deletions
- for (const Raul::URI& subject : dels) {
+ for (const URI& subject : dels) {
dest.del(subject);
}
diff --git a/src/server/ClientUpdate.hpp b/src/server/ClientUpdate.hpp
index 008bf2da..f1a361f7 100644
--- a/src/server/ClientUpdate.hpp
+++ b/src/server/ClientUpdate.hpp
@@ -22,7 +22,6 @@
#include "ingen/Resource.hpp"
#include "raul/Path.hpp"
-#include "raul/URI.hpp"
namespace Ingen {
@@ -42,7 +41,7 @@ class PluginImpl;
* post_process() to avoid the need to lock.
*/
struct ClientUpdate {
- void put(const Raul::URI& uri,
+ void put(const URI& uri,
const Properties& props,
Resource::Graph ctx = Resource::Graph::DEFAULT);
@@ -51,16 +50,16 @@ struct ClientUpdate {
void put_graph(const GraphImpl* graph);
void put_plugin(PluginImpl* plugin);
void put_preset(const URIs& uris,
- const Raul::URI& plugin,
- const Raul::URI& preset,
+ const URI& plugin,
+ const URI& preset,
const std::string& label);
- void del(const Raul::URI& subject);
+ void del(const URI& subject);
void send(Interface& dest);
struct Put {
- Raul::URI uri;
+ URI uri;
Properties properties;
Resource::Graph ctx;
};
@@ -70,9 +69,9 @@ struct ClientUpdate {
Raul::Path head;
};
- std::vector<Raul::URI> dels;
- std::vector<Put> puts;
- std::vector<Connect> connects;
+ std::vector<URI> dels;
+ std::vector<Put> puts;
+ std::vector<Connect> connects;
};
} // namespace Server
diff --git a/src/server/DirectDriver.hpp b/src/server/DirectDriver.hpp
index 219d0cb1..58b4f898 100644
--- a/src/server/DirectDriver.hpp
+++ b/src/server/DirectDriver.hpp
@@ -72,7 +72,7 @@ public:
const Raul::Path& new_path) {}
virtual void port_property(const Raul::Path& path,
- const Raul::URI& uri,
+ const URI& uri,
const Atom& value) {}
virtual void register_port(EnginePort& port) {}
diff --git a/src/server/Driver.hpp b/src/server/Driver.hpp
index 3014429e..9ae4b836 100644
--- a/src/server/Driver.hpp
+++ b/src/server/Driver.hpp
@@ -81,7 +81,7 @@ public:
/** Apply a system visible port property. */
virtual void port_property(const Raul::Path& path,
- const Raul::URI& uri,
+ const URI& uri,
const Atom& value) = 0;
/** Return the audio buffer size in frames */
diff --git a/src/server/DuplexPort.cpp b/src/server/DuplexPort.cpp
index 7e32e236..1b62ff38 100644
--- a/src/server/DuplexPort.cpp
+++ b/src/server/DuplexPort.cpp
@@ -121,7 +121,7 @@ DuplexPort::inherit_neighbour(const PortImpl* port,
}
void
-DuplexPort::on_property(const Raul::URI& uri, const Atom& value)
+DuplexPort::on_property(const URI& uri, const Atom& value)
{
_bufs.engine().driver()->port_property(_path, uri, value);
}
diff --git a/src/server/DuplexPort.hpp b/src/server/DuplexPort.hpp
index e12841dd..b0066164 100644
--- a/src/server/DuplexPort.hpp
+++ b/src/server/DuplexPort.hpp
@@ -61,7 +61,7 @@ public:
Properties& remove,
Properties& add);
- void on_property(const Raul::URI& uri, const Atom& value);
+ void on_property(const URI& uri, const Atom& value);
uint32_t max_tail_poly(RunContext& context) const;
diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp
index e8d4770e..a7476845 100644
--- a/src/server/Engine.cpp
+++ b/src/server/Engine.cpp
@@ -122,7 +122,7 @@ Engine::Engine(Ingen::World* world)
_event_writer,
std::make_shared<StreamWriter>(world->uri_map(),
world->uris(),
- Raul::URI("ingen:/engine"),
+ URI("ingen:/engine"),
stderr,
ColorContext::Color::MAGENTA)});
}
@@ -327,7 +327,7 @@ Engine::main_iteration()
_maid->cleanup();
if (_run_load.changed) {
- _broadcaster->put(Raul::URI("ingen:/engine"), load_properties());
+ _broadcaster->put(URI("ingen:/engine"), load_properties());
_run_load.changed = false;
}
diff --git a/src/server/Event.hpp b/src/server/Event.hpp
index 48c9580d..d9095def 100644
--- a/src/server/Event.hpp
+++ b/src/server/Event.hpp
@@ -130,7 +130,7 @@ protected:
return st == Status::SUCCESS;
}
- inline bool pre_process_done(Status st, const Raul::URI& subject) {
+ inline bool pre_process_done(Status st, const URI& subject) {
_err_subject = subject;
return pre_process_done(st);
}
diff --git a/src/server/EventWriter.hpp b/src/server/EventWriter.hpp
index 2c7e5666..023761d6 100644
--- a/src/server/EventWriter.hpp
+++ b/src/server/EventWriter.hpp
@@ -40,9 +40,7 @@ class EventWriter : public Interface
public:
explicit EventWriter(Engine& engine);
- Raul::URI uri() const override {
- return Raul::URI("ingen:/clients/event_writer");
- }
+ URI uri() const override { return URI("ingen:/clients/event_writer"); }
SPtr<Interface> respondee() const override {
return _respondee;
diff --git a/src/server/GraphPlugin.hpp b/src/server/GraphPlugin.hpp
index 0314f9d6..308ed91a 100644
--- a/src/server/GraphPlugin.hpp
+++ b/src/server/GraphPlugin.hpp
@@ -33,7 +33,7 @@ class GraphPlugin : public PluginImpl
{
public:
GraphPlugin(URIs& uris,
- const Raul::URI& uri,
+ const URI& uri,
const Raul::Symbol& symbol,
const std::string& name)
: PluginImpl(uris, uris.ingen_Graph.urid, uri)
diff --git a/src/server/InternalPlugin.cpp b/src/server/InternalPlugin.cpp
index 17f6fc70..6529b9c0 100644
--- a/src/server/InternalPlugin.cpp
+++ b/src/server/InternalPlugin.cpp
@@ -30,7 +30,7 @@ namespace Server {
using namespace Internals;
InternalPlugin::InternalPlugin(URIs& uris,
- const Raul::URI& uri,
+ const URI& uri,
const Raul::Symbol& symbol)
: PluginImpl(uris, uris.ingen_Internal.urid, uri)
, _symbol(symbol)
diff --git a/src/server/InternalPlugin.hpp b/src/server/InternalPlugin.hpp
index d95afa1a..79309beb 100644
--- a/src/server/InternalPlugin.hpp
+++ b/src/server/InternalPlugin.hpp
@@ -18,7 +18,6 @@
#define INGEN_ENGINE_INTERNALPLUGIN_HPP
#include "raul/Symbol.hpp"
-#include "raul/URI.hpp"
#include "PluginImpl.hpp"
@@ -36,7 +35,7 @@ class InternalPlugin : public PluginImpl
{
public:
InternalPlugin(URIs& uris,
- const Raul::URI& uri,
+ const URI& uri,
const Raul::Symbol& symbol);
BlockImpl* instantiate(BufferFactory& bufs,
diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp
index 433ca758..d022077a 100644
--- a/src/server/JackDriver.cpp
+++ b/src/server/JackDriver.cpp
@@ -33,6 +33,7 @@
#include "ingen/Configuration.hpp"
#include "ingen/LV2Features.hpp"
#include "ingen/Log.hpp"
+#include "ingen/URI.hpp"
#include "ingen/URIMap.hpp"
#include "ingen/World.hpp"
#include "lv2/lv2plug.in/ns/ext/atom/util.h"
@@ -278,7 +279,7 @@ JackDriver::rename_port(const Raul::Path& old_path,
void
JackDriver::port_property(const Raul::Path& path,
- const Raul::URI& uri,
+ const URI& uri,
const Atom& value)
{
#ifdef HAVE_JACK_METADATA
@@ -292,7 +293,7 @@ JackDriver::port_property(const Raul::Path& path,
void
JackDriver::port_property_internal(const jack_port_t* jport,
- const Raul::URI& uri,
+ const URI& uri,
const Atom& value)
{
#ifdef HAVE_JACK_METADATA
@@ -548,7 +549,7 @@ JackDriver::_session_cb(jack_session_event_t* event)
SPtr<Node> root(_engine.root_graph(), NullDeleter<Node>);
serialiser->write_bundle(root,
- std::string("file://") + event->session_dir);
+ URI(std::string("file://") + event->session_dir));
}
event->command_line = (char*)malloc(cmd.size() + 1);
diff --git a/src/server/JackDriver.hpp b/src/server/JackDriver.hpp
index ce9af82e..678ce483 100644
--- a/src/server/JackDriver.hpp
+++ b/src/server/JackDriver.hpp
@@ -74,7 +74,7 @@ public:
EnginePort* get_port(const Raul::Path& path);
void rename_port(const Raul::Path& old_path, const Raul::Path& new_path);
- void port_property(const Raul::Path& path, const Raul::URI& uri, const Atom& value);
+ void port_property(const Raul::Path& path, const URI& uri, const Atom& value);
void add_port(RunContext& context, EnginePort* port);
void remove_port(RunContext& context, EnginePort* port);
void register_port(EnginePort& port);
@@ -125,7 +125,7 @@ private:
void post_process_port(RunContext& context, EnginePort* port);
void port_property_internal(const jack_port_t* jport,
- const Raul::URI& uri,
+ const URI& uri,
const Atom& value);
// Non static callbacks (methods)
diff --git a/src/server/LV2Block.cpp b/src/server/LV2Block.cpp
index 440fb3c5..054d55ae 100644
--- a/src/server/LV2Block.cpp
+++ b/src/server/LV2Block.cpp
@@ -399,8 +399,8 @@ LV2Block::instantiate(BufferFactory& bufs, const LilvState* state)
LILV_FOREACH(nodes, v, values) {
const LilvNode* val = lilv_nodes_get(values, v);
if (lilv_node_is_uri(val)) {
- port->add_property(Raul::URI(lilv_node_as_uri(preds[p])),
- forge.make_urid(Raul::URI(lilv_node_as_uri(val))));
+ port->add_property(URI(lilv_node_as_uri(preds[p])),
+ forge.make_urid(URI(lilv_node_as_uri(val))));
}
}
lilv_nodes_free(values);
@@ -606,7 +606,7 @@ LV2Block::post_process(RunContext& context)
}
LilvState*
-LV2Block::load_preset(const Raul::URI& uri)
+LV2Block::load_preset(const URI& uri)
{
World* world = _lv2_plugin->world();
LilvWorld* lworld = world->lilv_world();
@@ -678,7 +678,7 @@ get_port_value(const char* port_symbol,
}
boost::optional<Resource>
-LV2Block::save_preset(const Raul::URI& uri,
+LV2Block::save_preset(const URI& uri,
const Properties& props)
{
World* world = parent_graph()->engine().world();
@@ -686,7 +686,7 @@ LV2Block::save_preset(const Raul::URI& uri,
LV2_URID_Map* lmap = &world->uri_map().urid_map_feature()->urid_map;
LV2_URID_Unmap* lunmap = &world->uri_map().urid_unmap_feature()->urid_unmap;
- const std::string path = Glib::filename_from_uri(uri);
+ const std::string path = Glib::filename_from_uri(uri.string());
const std::string dirname = Glib::path_get_dirname(path);
const std::string basename = Glib::path_get_basename(path);
@@ -704,7 +704,7 @@ LV2Block::save_preset(const Raul::URI& uri,
lilv_state_save(lworld, lmap, lunmap, state, nullptr,
dirname.c_str(), basename.c_str());
- const Raul::URI uri(lilv_node_as_uri(lilv_state_get_uri(state)));
+ const URI uri(lilv_node_as_uri(lilv_state_get_uri(state)));
const std::string label(lilv_state_get_label(state)
? lilv_state_get_label(state)
: basename);
diff --git a/src/server/LV2Block.hpp b/src/server/LV2Block.hpp
index d04d2048..eec852a2 100644
--- a/src/server/LV2Block.hpp
+++ b/src/server/LV2Block.hpp
@@ -68,11 +68,11 @@ public:
void run(RunContext& context);
void post_process(RunContext& context);
- LilvState* load_preset(const Raul::URI& uri);
+ LilvState* load_preset(const URI& uri);
void apply_state(const UPtr<Worker>& worker, const LilvState* state);
- boost::optional<Resource> save_preset(const Raul::URI& uri,
+ boost::optional<Resource> save_preset(const URI& uri,
const Properties& props);
void set_port_buffer(uint32_t voice,
diff --git a/src/server/LV2Plugin.cpp b/src/server/LV2Plugin.cpp
index d51aeda3..f56fd4d7 100644
--- a/src/server/LV2Plugin.cpp
+++ b/src/server/LV2Plugin.cpp
@@ -32,7 +32,7 @@ namespace Server {
LV2Plugin::LV2Plugin(World* world, const LilvPlugin* lplugin)
: PluginImpl(world->uris(),
world->uris().lv2_Plugin.urid,
- Raul::URI(lilv_node_as_uri(lilv_plugin_get_uri(lplugin))))
+ URI(lilv_node_as_uri(lilv_plugin_get_uri(lplugin))))
, _world(world)
, _lilv_plugin(lplugin)
{
@@ -122,7 +122,7 @@ LV2Plugin::load_presets()
if (labels) {
const LilvNode* label = lilv_nodes_get_first(labels);
- _presets.emplace(Raul::URI(lilv_node_as_uri(preset)),
+ _presets.emplace(URI(lilv_node_as_uri(preset)),
lilv_node_as_string(label));
lilv_nodes_free(labels);
diff --git a/src/server/LV2Plugin.hpp b/src/server/LV2Plugin.hpp
index f490bbfd..43d0fba9 100644
--- a/src/server/LV2Plugin.hpp
+++ b/src/server/LV2Plugin.hpp
@@ -21,7 +21,6 @@
#include "ingen/types.hpp"
#include "lilv/lilv.h"
-#include "raul/URI.hpp"
#include "PluginImpl.hpp"
@@ -57,9 +56,9 @@ public:
void load_presets();
- Raul::URI bundle_uri() const {
+ URI bundle_uri() const {
const LilvNode* bundle = lilv_plugin_get_bundle_uri(_lilv_plugin);
- return Raul::URI(lilv_node_as_uri(bundle));
+ return URI(lilv_node_as_uri(bundle));
}
private:
diff --git a/src/server/NodeImpl.cpp b/src/server/NodeImpl.cpp
index d26fa51f..778ba15a 100644
--- a/src/server/NodeImpl.cpp
+++ b/src/server/NodeImpl.cpp
@@ -32,7 +32,7 @@ NodeImpl::NodeImpl(const Ingen::URIs& uris,
}
const Atom&
-NodeImpl::get_property(const Raul::URI& key) const
+NodeImpl::get_property(const URI& key) const
{
ThreadManager::assert_not_thread(THREAD_PROCESS);
static const Atom null_atom;
diff --git a/src/server/NodeImpl.hpp b/src/server/NodeImpl.hpp
index 81abb3ef..614801eb 100644
--- a/src/server/NodeImpl.hpp
+++ b/src/server/NodeImpl.hpp
@@ -64,7 +64,7 @@ public:
set_uri(path_to_uri(new_path));
}
- const Atom& get_property(const Raul::URI& key) const;
+ const Atom& get_property(const URI& key) const;
/** The Graph this object is a child of. */
virtual GraphImpl* parent_graph() const;
diff --git a/src/server/PluginImpl.hpp b/src/server/PluginImpl.hpp
index 869c6520..ebd4b3e5 100644
--- a/src/server/PluginImpl.hpp
+++ b/src/server/PluginImpl.hpp
@@ -21,7 +21,6 @@
#include "ingen/Resource.hpp"
#include "raul/Symbol.hpp"
-#include "raul/URI.hpp"
namespace Ingen {
@@ -41,14 +40,13 @@ class GraphImpl;
class PluginImpl : public Resource
{
public:
- PluginImpl(Ingen::URIs& uris,
- const Atom& type,
- const Raul::URI& uri)
- : Resource(uris, uri)
- , _type(type)
- , _presets_loaded(false)
- , _is_zombie(false)
- {}
+ PluginImpl(Ingen::URIs& uris, const Atom& type, const URI& uri)
+ : Resource(uris, uri)
+ , _type(type)
+ , _presets_loaded(false)
+ , _is_zombie(false)
+ {
+ }
virtual BlockImpl* instantiate(BufferFactory& bufs,
const Raul::Symbol& symbol,
@@ -64,8 +62,8 @@ public:
bool is_zombie() const { return _is_zombie; }
void set_is_zombie(bool t) { _is_zombie = t; }
- typedef std::pair<Raul::URI, std::string> Preset;
- typedef std::map<Raul::URI, std::string> Presets;
+ typedef std::pair<URI, std::string> Preset;
+ typedef std::map<URI, std::string> Presets;
const Presets& presets(bool force_reload=false) {
if (!_presets_loaded || force_reload) {
@@ -79,7 +77,7 @@ public:
virtual void load_presets() { _presets_loaded = true; }
- virtual Raul::URI bundle_uri() const { return Raul::URI("ingen:/"); }
+ virtual URI bundle_uri() const { return URI("ingen:/"); }
protected:
Atom _type;
diff --git a/src/server/PortAudioDriver.cpp b/src/server/PortAudioDriver.cpp
index 17b5c8cf..f892c99f 100644
--- a/src/server/PortAudioDriver.cpp
+++ b/src/server/PortAudioDriver.cpp
@@ -204,7 +204,7 @@ PortAudioDriver::rename_port(const Raul::Path& old_path,
void
PortAudioDriver::port_property(const Raul::Path& path,
- const Raul::URI& uri,
+ const URI& uri,
const Atom& value)
{
}
diff --git a/src/server/PortAudioDriver.hpp b/src/server/PortAudioDriver.hpp
index 3659b4ff..11772a88 100644
--- a/src/server/PortAudioDriver.hpp
+++ b/src/server/PortAudioDriver.hpp
@@ -58,7 +58,7 @@ public:
EnginePort* get_port(const Raul::Path& path);
void rename_port(const Raul::Path& old_path, const Raul::Path& new_path);
- void port_property(const Raul::Path& path, const Raul::URI& uri, const Atom& value);
+ void port_property(const Raul::Path& path, const URI& uri, const Atom& value);
void add_port(RunContext& context, EnginePort* port);
void remove_port(RunContext& context, EnginePort* port);
void register_port(EnginePort& port);
diff --git a/src/server/PortType.hpp b/src/server/PortType.hpp
index be0426b0..0b62c5ab 100644
--- a/src/server/PortType.hpp
+++ b/src/server/PortType.hpp
@@ -19,8 +19,6 @@
#include <cassert>
-#include "raul/URI.hpp"
-
#include "lv2/lv2plug.in/ns/ext/atom/atom.h"
#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
@@ -42,7 +40,7 @@ public:
ATOM = 4
};
- explicit PortType(const Raul::URI& uri)
+ explicit PortType(const URI& uri)
: _id(UNKNOWN)
{
if (uri == type_uri(AUDIO)) {
@@ -58,8 +56,8 @@ public:
PortType(ID id) : _id(id) {}
- inline const Raul::URI& uri() const { return type_uri(_id); }
- inline ID id() const { return _id; }
+ inline const URI& uri() const { return type_uri(_id); }
+ inline ID id() const { return _id; }
inline bool operator==(const ID& id) const { return (_id == id); }
inline bool operator!=(const ID& id) const { return (_id != id); }
@@ -73,14 +71,14 @@ public:
inline bool is_atom() { return _id == ATOM; }
private:
- static inline const Raul::URI& type_uri(unsigned id_num) {
+ static inline const URI& type_uri(unsigned id_num) {
assert(id_num <= ATOM);
- static const Raul::URI uris[] = {
- Raul::URI("http://www.w3.org/2002/07/owl#Nothing"),
- Raul::URI(LV2_CORE__AudioPort),
- Raul::URI(LV2_CORE__ControlPort),
- Raul::URI(LV2_CORE__CVPort),
- Raul::URI(LV2_ATOM__AtomPort)
+ static const URI uris[] = {
+ URI("http://www.w3.org/2002/07/owl#Nothing"),
+ URI(LV2_CORE__AudioPort),
+ URI(LV2_CORE__ControlPort),
+ URI(LV2_CORE__CVPort),
+ URI(LV2_ATOM__AtomPort)
};
return uris[id_num];
}
diff --git a/src/server/RunContext.cpp b/src/server/RunContext.cpp
index d065c41f..3ab9d15c 100644
--- a/src/server/RunContext.cpp
+++ b/src/server/RunContext.cpp
@@ -121,12 +121,12 @@ RunContext::emit_notifications(FrameTime end)
const char* key = _engine.world()->uri_map().unmap_uri(note.key);
if (key) {
_engine.broadcaster()->set_property(
- note.port->uri(), Raul::URI(key), value);
+ note.port->uri(), URI(key), value);
if (note.port->is_input() &&
(note.key == uris.ingen_value ||
note.key == uris.midi_binding)) {
// FIXME: not thread safe
- note.port->set_property(Raul::URI(key), value);
+ note.port->set_property(URI(key), value);
}
} else {
_engine.log().rt_error("Error unmapping notification key URI\n");
diff --git a/src/server/SocketListener.cpp b/src/server/SocketListener.cpp
index e62b822e..eecc28d1 100644
--- a/src/server/SocketListener.cpp
+++ b/src/server/SocketListener.cpp
@@ -88,8 +88,8 @@ ingen_listen(Engine* engine, Raul::Socket* unix_sock, Raul::Socket* net_sock)
const std::string unix_path(link_path + "." + std::to_string(getpid()));
// Bind UNIX socket and create PID-less symbolic link
- const Raul::URI unix_uri(unix_scheme + unix_path);
- bool make_link = true;
+ const URI unix_uri(unix_scheme + unix_path);
+ bool make_link = true;
if (!unix_sock->bind(unix_uri) || !unix_sock->listen()) {
world->log().error("Failed to create UNIX socket\n");
unix_sock->close();
@@ -127,7 +127,7 @@ ingen_listen(Engine* engine, Raul::Socket* unix_sock, Raul::Socket* net_sock)
const int port = world->conf().option("engine-port").get<int32_t>();
std::ostringstream ss;
ss << "tcp://*:" << port;
- if (!net_sock->bind(Raul::URI(ss.str())) || !net_sock->listen()) {
+ if (!net_sock->bind(URI(ss.str())) || !net_sock->listen()) {
world->log().error("Failed to create TCP socket\n");
net_sock->close();
} else {
diff --git a/src/server/SocketServer.hpp b/src/server/SocketServer.hpp
index 6420020e..dbeb76ea 100644
--- a/src/server/SocketServer.hpp
+++ b/src/server/SocketServer.hpp
@@ -41,14 +41,14 @@ public:
new Tee({SPtr<Interface>(new EventWriter(engine)),
SPtr<Interface>(new StreamWriter(world.uri_map(),
world.uris(),
- Raul::URI("ingen:/engine"),
+ URI("ingen:/engine"),
stderr,
ColorContext::Color::CYAN))}))
: SPtr<Interface>(new EventWriter(engine)))
, _reader(new SocketReader(world, *_sink.get(), sock))
, _writer(new SocketWriter(world.uri_map(),
world.uris(),
- sock->uri(),
+ URI(sock->uri()),
sock))
{
_sink->set_respondee(_writer);
diff --git a/src/server/events/Copy.cpp b/src/server/events/Copy.cpp
index b1cea1db..fc9d40f7 100644
--- a/src/server/events/Copy.cpp
+++ b/src/server/events/Copy.cpp
@@ -150,7 +150,7 @@ Copy::engine_to_filesystem(PreProcessContext& ctx)
std::lock_guard<std::mutex> lock(_engine.world()->rdf_mutex());
if (ends_with(_msg.new_uri, ".ingen") || ends_with(_msg.new_uri, ".ingen/")) {
- _engine.world()->serialiser()->write_bundle(graph, _msg.new_uri);
+ _engine.world()->serialiser()->write_bundle(graph, URI(_msg.new_uri));
} else {
_engine.world()->serialiser()->start_to_file(graph->path(), _msg.new_uri);
_engine.world()->serialiser()->serialise(graph);
@@ -170,7 +170,7 @@ Copy::filesystem_to_engine(PreProcessContext& ctx)
std::lock_guard<std::mutex> lock(_engine.world()->rdf_mutex());
// Old URI is a filesystem path and new URI is a path within the engine
- const std::string src_path = _msg.old_uri.substr(strlen("file://"));
+ const std::string src_path(_msg.old_uri.path());
const Raul::Path dst_path = uri_to_path(_msg.new_uri);
boost::optional<Raul::Path> dst_parent;
boost::optional<Raul::Symbol> dst_symbol;
diff --git a/src/server/events/CreateBlock.cpp b/src/server/events/CreateBlock.cpp
index 2c7978b1..fc0c0f5e 100644
--- a/src/server/events/CreateBlock.cpp
+++ b/src/server/events/CreateBlock.cpp
@@ -82,7 +82,7 @@ CreateBlock::pre_process(PreProcessContext& ctx)
return Event::pre_process_done(Status::BAD_REQUEST);
}
- const Raul::URI prototype(uris.forge.str(t->second, false));
+ const URI prototype(uris.forge.str(t->second, false));
// Find polyphony
const iterator p = _properties.find(uris.ingen_polyphonic);
diff --git a/src/server/events/CreateGraph.cpp b/src/server/events/CreateGraph.cpp
index 43b3bb97..390fdd9a 100644
--- a/src/server/events/CreateGraph.cpp
+++ b/src/server/events/CreateGraph.cpp
@@ -140,11 +140,11 @@ CreateGraph::pre_process(PreProcessContext& ctx)
if (t != _properties.end() &&
uris.forge.is_uri(t->second) &&
- Raul::URI::is_valid(uris.forge.str(t->second, false)) &&
- uri_is_path(Raul::URI(uris.forge.str(t->second, false)))) {
+ URI::is_valid(uris.forge.str(t->second, false)) &&
+ uri_is_path(URI(uris.forge.str(t->second, false)))) {
// Create a duplicate of an existing graph
- const Raul::URI prototype(uris.forge.str(t->second, false));
- GraphImpl* ancestor = dynamic_cast<GraphImpl*>(
+ const URI prototype(uris.forge.str(t->second, false));
+ GraphImpl* ancestor = dynamic_cast<GraphImpl*>(
_engine.store()->get(uri_to_path(prototype)));
if (!ancestor) {
return Event::pre_process_done(Status::PROTOTYPE_NOT_FOUND, prototype);
diff --git a/src/server/events/Delete.cpp b/src/server/events/Delete.cpp
index 310579aa..e8f9582c 100644
--- a/src/server/events/Delete.cpp
+++ b/src/server/events/Delete.cpp
@@ -202,7 +202,7 @@ Delete::undo(Interface& target)
// Adjust port indices
for (const auto& c : _port_index_changes) {
- if (c.first != _msg.uri) {
+ if (c.first != _msg.uri.path()) {
target.set_property(path_to_uri(c.first),
uris.lv2_index,
forge.make(int32_t(c.second.first)));
diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp
index b7cb9475..56cc22aa 100644
--- a/src/server/events/Delta.cpp
+++ b/src/server/events/Delta.cpp
@@ -178,7 +178,7 @@ Delta::pre_process(PreProcessContext& ctx)
const bool is_graph_object = uri_is_path(_subject);
const bool is_client = (_subject == "ingen:/clients/this");
const bool is_engine = (_subject == "ingen:/");
- const bool is_file = (_subject.substr(0, 5) == "file:");
+ const bool is_file = (_subject.scheme() == "file");
if (_type == Type::PUT && is_file) {
// Ensure type is Preset, the only supported file put
@@ -195,7 +195,7 @@ Delta::pre_process(PreProcessContext& ctx)
return Event::pre_process_done(Status::BAD_REQUEST, _subject);
}
- const Raul::URI prot(_engine.world()->forge().str(p->second, false));
+ const URI prot(_engine.world()->forge().str(p->second, false));
if (!uri_is_path(prot)) {
return Event::pre_process_done(Status::BAD_URI, _subject);
}
@@ -261,8 +261,8 @@ Delta::pre_process(PreProcessContext& ctx)
// Remove any properties removed in delta
for (const auto& r : _remove) {
- const Raul::URI& key = r.first;
- const Atom& value = r.second;
+ const URI& key = r.first;
+ const Atom& value = r.second;
if (key == uris.midi_binding && value == uris.patch_wildcard) {
PortImpl* port = dynamic_cast<PortImpl*>(_object);
if (port) {
@@ -314,9 +314,9 @@ Delta::pre_process(PreProcessContext& ctx)
}
for (const auto& p : _properties) {
- const Raul::URI& key = p.first;
- const Property& value = p.second;
- SpecialType op = SpecialType::NONE;
+ const URI& key = p.first;
+ const Property& value = p.second;
+ SpecialType op = SpecialType::NONE;
if (obj) {
Resource& resource = *obj;
if (value != uris.patch_wildcard) {
@@ -373,8 +373,8 @@ Delta::pre_process(PreProcessContext& ctx)
uri_str = Glib::filename_to_uri(value.ptr<char>());
}
- if (Raul::URI::is_valid(uri_str)) {
- const Raul::URI uri(uri_str);
+ if (URI::is_valid(uri_str)) {
+ const URI uri(uri_str);
op = SpecialType::PRESET;
if ((_state = block->load_preset(uri))) {
lilv_state_emit_port_values(
@@ -503,8 +503,8 @@ Delta::execute(RunContext& context)
std::vector<SpecialType>::const_iterator t = _types.begin();
for (const auto& p : _properties) {
- const Raul::URI& key = p.first;
- const Atom& value = p.second;
+ const URI& key = p.first;
+ const Atom& value = p.second;
switch (*t++) {
case SpecialType::ENABLE_BROADCAST:
if (port) {
@@ -621,7 +621,7 @@ Delta::post_process()
}
break;
case Type::PUT:
- if (_type == Type::PUT && _subject.substr(0, 5) == "file:") {
+ if (_type == Type::PUT && _subject.scheme() == "file") {
// Preset save
ClientUpdate response;
response.put(_preset->uri(), _preset->properties());
diff --git a/src/server/events/Delta.hpp b/src/server/events/Delta.hpp
index 47c4ab22..af337b57 100644
--- a/src/server/events/Delta.hpp
+++ b/src/server/events/Delta.hpp
@@ -23,8 +23,6 @@
#include "lilv/lilv.h"
-#include "raul/URI.hpp"
-
#include "CompiledGraph.hpp"
#include "ControlBindings.hpp"
#include "Event.hpp"
@@ -106,7 +104,7 @@ private:
SetEvents _set_events;
std::vector<SpecialType> _types;
std::vector<SpecialType> _remove_types;
- Raul::URI _subject;
+ URI _subject;
Properties _properties;
Properties _remove;
ClientUpdate _update;
diff --git a/src/server/events/Get.cpp b/src/server/events/Get.cpp
index 84f6f251..e53e8c41 100644
--- a/src/server/events/Get.cpp
+++ b/src/server/events/Get.cpp
@@ -99,7 +99,7 @@ Get::post_process()
const Properties load_props = _engine.load_properties();
props.insert(load_props.begin(), load_props.end());
- _request_client->put(Raul::URI("ingen:/engine"), props);
+ _request_client->put(URI("ingen:/engine"), props);
} else {
_response.send(*_request_client);
}
diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp
index 1b6652ae..b2806ab6 100644
--- a/src/server/ingen_lv2.cpp
+++ b/src/server/ingen_lv2.cpp
@@ -14,8 +14,7 @@
along with Ingen. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdlib.h>
-
+#include <cstdlib>
#include <string>
#include <thread>
#include <vector>
@@ -37,6 +36,7 @@
#include "ingen/Parser.hpp"
#include "ingen/Serialiser.hpp"
#include "ingen/Store.hpp"
+#include "ingen/URI.hpp"
#include "ingen/World.hpp"
#include "ingen/ingen.h"
#include "ingen/runtime_paths.hpp"
@@ -232,7 +232,7 @@ public:
/** Unused since LV2 has no dynamic ports. */
virtual void port_property(const Raul::Path& path,
- const Raul::URI& uri,
+ const URI& uri,
const Atom& value) {}
virtual EnginePort* create_port(DuplexPort* graph_port) {
@@ -439,7 +439,7 @@ struct IngenPlugin {
};
static Lib::Graphs
-find_graphs(const std::string& manifest_uri)
+find_graphs(const URI& manifest_uri)
{
Sord::World world;
Parser parser;
@@ -447,7 +447,7 @@ find_graphs(const std::string& manifest_uri)
const std::set<Parser::ResourceRecord> resources = parser.find_resources(
world,
manifest_uri,
- Raul::URI(INGEN__Graph));
+ URI(INGEN__Graph));
Lib::Graphs graphs;
for (const auto& r : resources) {
@@ -496,7 +496,7 @@ ingen_instantiate(const LV2_Descriptor* descriptor,
SerdNode manifest_node = serd_node_new_file_uri(
(const uint8_t*)manifest_path.c_str(), nullptr, nullptr, true);
- Lib::Graphs graphs = find_graphs((const char*)manifest_node.buf);
+ Lib::Graphs graphs = find_graphs(URI((const char*)manifest_node.buf));
serd_node_free(&manifest_node);
const LV2Graph* graph = nullptr;
@@ -809,7 +809,7 @@ Lib::Lib(const char* bundle_path)
SerdNode manifest_node = serd_node_new_file_uri(
(const uint8_t*)manifest_path.c_str(), nullptr, nullptr, true);
- graphs = find_graphs((const char*)manifest_node.buf);
+ graphs = find_graphs(URI((const char*)manifest_node.buf));
serd_node_free(&manifest_node);
}
diff --git a/src/server/internals/BlockDelay.cpp b/src/server/internals/BlockDelay.cpp
index c0e8dded..e9667cc5 100644
--- a/src/server/internals/BlockDelay.cpp
+++ b/src/server/internals/BlockDelay.cpp
@@ -35,7 +35,7 @@ namespace Internals {
InternalPlugin* BlockDelayNode::internal_plugin(URIs& uris) {
return new InternalPlugin(
- uris, Raul::URI(NS_INTERNALS "BlockDelay"), Raul::Symbol("blockDelay"));
+ uris, URI(NS_INTERNALS "BlockDelay"), Raul::Symbol("blockDelay"));
}
BlockDelayNode::BlockDelayNode(InternalPlugin* plugin,
diff --git a/src/server/internals/Controller.cpp b/src/server/internals/Controller.cpp
index ec701767..a0b2320b 100644
--- a/src/server/internals/Controller.cpp
+++ b/src/server/internals/Controller.cpp
@@ -36,7 +36,7 @@ namespace Internals {
InternalPlugin* ControllerNode::internal_plugin(URIs& uris) {
return new InternalPlugin(
- uris, Raul::URI(NS_INTERNALS "Controller"), Raul::Symbol("controller"));
+ uris, URI(NS_INTERNALS "Controller"), Raul::Symbol("controller"));
}
ControllerNode::ControllerNode(InternalPlugin* plugin,
@@ -53,7 +53,7 @@ ControllerNode::ControllerNode(InternalPlugin* plugin,
const Atom zero = bufs.forge().make(0.0f);
const Atom one = bufs.forge().make(1.0f);
- const Atom atom_Float = bufs.forge().make_urid(Raul::URI(LV2_ATOM__Float));
+ const Atom atom_Float = bufs.forge().make_urid(URI(LV2_ATOM__Float));
_midi_in_port = new InputPort(bufs, this, Raul::Symbol("input"), 0, 1,
PortType::ATOM, uris.atom_Sequence, Atom());
diff --git a/src/server/internals/Note.cpp b/src/server/internals/Note.cpp
index b3688dfd..665ee472 100644
--- a/src/server/internals/Note.cpp
+++ b/src/server/internals/Note.cpp
@@ -40,7 +40,7 @@ namespace Internals {
InternalPlugin* NoteNode::internal_plugin(URIs& uris) {
return new InternalPlugin(
- uris, Raul::URI(NS_INTERNALS "Note"), Raul::Symbol("note"));
+ uris, URI(NS_INTERNALS "Note"), Raul::Symbol("note"));
}
NoteNode::NoteNode(InternalPlugin* plugin,
diff --git a/src/server/internals/Time.cpp b/src/server/internals/Time.cpp
index 2da2a2ae..5474bf21 100644
--- a/src/server/internals/Time.cpp
+++ b/src/server/internals/Time.cpp
@@ -33,7 +33,7 @@ namespace Internals {
InternalPlugin* TimeNode::internal_plugin(URIs& uris) {
return new InternalPlugin(
- uris, Raul::URI(NS_INTERNALS "Time"), Raul::Symbol("time"));
+ uris, URI(NS_INTERNALS "Time"), Raul::Symbol("time"));
}
TimeNode::TimeNode(InternalPlugin* plugin,
diff --git a/src/server/internals/Trigger.cpp b/src/server/internals/Trigger.cpp
index 8adf211c..69967877 100644
--- a/src/server/internals/Trigger.cpp
+++ b/src/server/internals/Trigger.cpp
@@ -36,7 +36,7 @@ namespace Internals {
InternalPlugin* TriggerNode::internal_plugin(URIs& uris) {
return new InternalPlugin(
- uris, Raul::URI(NS_INTERNALS "Trigger"), Raul::Symbol("trigger"));
+ uris, URI(NS_INTERNALS "Trigger"), Raul::Symbol("trigger"));
}
TriggerNode::TriggerNode(InternalPlugin* plugin,
diff --git a/src/wscript b/src/wscript
index 5b308386..5429ba26 100644
--- a/src/wscript
+++ b/src/wscript
@@ -17,6 +17,7 @@ def build(bld):
'Store.cpp',
'StreamWriter.cpp',
'TurtleWriter.cpp',
+ 'URI.cpp',
'URIMap.cpp',
'URIs.cpp',
'World.cpp',