diff options
author | David Robillard <d@drobilla.net> | 2012-12-23 00:06:21 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-12-23 00:06:21 +0000 |
commit | fa8d43dab70a975be9af7aebaac8eba682c2048e (patch) | |
tree | 4088b328260cb7fc75b0b1211879158752114103 | |
parent | f7b865f9ff03b0796ba3c2732b69f70a24faa4d4 (diff) | |
download | ingen-fa8d43dab70a975be9af7aebaac8eba682c2048e.tar.gz ingen-fa8d43dab70a975be9af7aebaac8eba682c2048e.tar.bz2 ingen-fa8d43dab70a975be9af7aebaac8eba682c2048e.zip |
Use more sensible URI scheme for Ingen paths.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4889 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | ingen/AtomWriter.hpp | 2 | ||||
-rw-r--r-- | ingen/ClashAvoider.hpp | 2 | ||||
-rw-r--r-- | ingen/Node.hpp | 5 | ||||
-rw-r--r-- | ingen/client/ClientStore.hpp | 2 | ||||
-rw-r--r-- | ingen/client/SigClientInterface.hpp | 2 | ||||
-rw-r--r-- | ingen/client/ThreadedSigClientInterface.hpp | 2 | ||||
-rw-r--r-- | scripts/ingen.py | 18 | ||||
-rw-r--r-- | src/gui/App.cpp | 2 | ||||
-rw-r--r-- | src/gui/ConnectWindow.cpp | 12 | ||||
-rw-r--r-- | src/ingen/main.cpp | 2 | ||||
-rw-r--r-- | src/server/Broadcaster.hpp | 2 | ||||
-rw-r--r-- | src/server/EventWriter.hpp | 2 | ||||
-rw-r--r-- | src/server/events/Get.cpp | 8 | ||||
-rw-r--r-- | src/server/ingen_lv2.cpp | 2 | ||||
-rw-r--r-- | src/socket/SocketReader.cpp | 4 | ||||
-rw-r--r-- | src/socket/SocketWriter.cpp | 4 | ||||
-rw-r--r-- | tests/ingen_test.cpp | 2 |
17 files changed, 37 insertions, 36 deletions
diff --git a/ingen/AtomWriter.hpp b/ingen/AtomWriter.hpp index 37f91e74..00b64b54 100644 --- a/ingen/AtomWriter.hpp +++ b/ingen/AtomWriter.hpp @@ -37,7 +37,7 @@ public: ~AtomWriter() {} Raul::URI uri() const { - return Raul::URI("http://drobilla.net/ns/ingen#AtomWriter"); + return Raul::URI("ingen:/clients/atom_writer"); } void bundle_begin(); diff --git a/ingen/ClashAvoider.hpp b/ingen/ClashAvoider.hpp index 49a3000a..e3ff519b 100644 --- a/ingen/ClashAvoider.hpp +++ b/ingen/ClashAvoider.hpp @@ -44,7 +44,7 @@ public: ClashAvoider(Store& store, Interface& target, Store* also_avoid=NULL) : _store(store), _target(target), _also_avoid(also_avoid) {} - Raul::URI uri() const { return Raul::URI("ingen:ClientStore"); } + Raul::URI uri() const { return Raul::URI("ingen:/clients/clash_avoider"); } void set_target(Interface& target) { _target = target; } diff --git a/ingen/Node.hpp b/ingen/Node.hpp index 275c82cc..db796ef7 100644 --- a/ingen/Node.hpp +++ b/ingen/Node.hpp @@ -72,10 +72,11 @@ public: virtual const Raul::Symbol& symbol() const = 0; virtual Node* graph_parent() const = 0; - static Raul::URI root_uri() { return Raul::URI("ingen:root"); } + static Raul::URI root_uri() { return Raul::URI("ingen:/root"); } static bool uri_is_path(const Raul::URI& uri) { - return uri.substr(0, root_uri().length() + 1) == root_uri() + "/"; + return uri == root_uri() || + uri.substr(0, root_uri().length() + 1) == root_uri() + "/"; } static Raul::Path uri_to_path(const Raul::URI& uri) { diff --git a/ingen/client/ClientStore.hpp b/ingen/client/ClientStore.hpp index 2ca25dde..fa5b2f5a 100644 --- a/ingen/client/ClientStore.hpp +++ b/ingen/client/ClientStore.hpp @@ -58,7 +58,7 @@ public: SharedPtr<Interface> engine = SharedPtr<Interface>(), SharedPtr<SigClientInterface> emitter = SharedPtr<SigClientInterface>()); - Raul::URI uri() const { return Raul::URI("ingen:clientStore"); } + Raul::URI uri() const { return Raul::URI("ingen:/clients/store"); } SharedPtr<const ObjectModel> object(const Raul::Path& path) const; SharedPtr<const PluginModel> plugin(const Raul::URI& uri) const; diff --git a/ingen/client/SigClientInterface.hpp b/ingen/client/SigClientInterface.hpp index dc6676f7..2453440f 100644 --- a/ingen/client/SigClientInterface.hpp +++ b/ingen/client/SigClientInterface.hpp @@ -45,7 +45,7 @@ class SigClientInterface : public Ingen::Interface, public: SigClientInterface() {} - Raul::URI uri() const { return Raul::URI("ingen:sigClient"); } + Raul::URI uri() const { return Raul::URI("ingen:/clients/sig"); } INGEN_SIGNAL(response, void, int32_t, Status, std::string) INGEN_SIGNAL(bundle_begin, void) diff --git a/ingen/client/ThreadedSigClientInterface.hpp b/ingen/client/ThreadedSigClientInterface.hpp index a89108bc..0b53a15a 100644 --- a/ingen/client/ThreadedSigClientInterface.hpp +++ b/ingen/client/ThreadedSigClientInterface.hpp @@ -65,7 +65,7 @@ public: , property_change_slot(_signal_property_change.make_slot()) {} - virtual Raul::URI uri() const { return Raul::URI("ingen:threadedSigClient"); } + virtual Raul::URI uri() const { return Raul::URI("ingen:/clients/sig_queue"); } void bundle_begin() { push_sig(bundle_begin_slot); } diff --git a/scripts/ingen.py b/scripts/ingen.py index dcfe7206..041a7de6 100644 --- a/scripts/ingen.py +++ b/scripts/ingen.py @@ -210,14 +210,14 @@ class Remote(Interface): return self.send(''' [] a patch:Get ; - patch:subject <ingen:root%s> . + patch:subject <ingen:/root%s> . ''' % path) def put(self, path, body): return self.send(''' [] a patch:Put ; - patch:subject <ingen:root%s> ; + patch:subject <ingen:/root%s> ; patch:body [ %s ] . @@ -227,7 +227,7 @@ class Remote(Interface): return self.send(''' [] a patch:Set ; - patch:subject <ingen:root%s> ; + patch:subject <ingen:/root%s> ; patch:body [ %s ] . @@ -237,11 +237,11 @@ class Remote(Interface): return self.send(''' [] a patch:Put ; - patch:subject <ingen:root%s> ; + patch:subject <ingen:/root%s> ; patch:body [ a ingen:Edge ; - ingen:tail <ingen:root%s> ; - ingen:head <ingen:root%s> ; + ingen:tail <ingen:/root%s> ; + ingen:head <ingen:/root%s> ; ] . ''' % (os.path.commonprefix([tail, head]), tail, head)) @@ -251,8 +251,8 @@ class Remote(Interface): a patch:Delete ; patch:body [ a ingen:Edge ; - ingen:tail <ingen:root%s> ; - ingen:head <ingen:root%s> ; + ingen:tail <ingen:/root%s> ; + ingen:head <ingen:/root%s> ; ] . ''' % (tail, head)) @@ -260,6 +260,6 @@ class Remote(Interface): return self.send(''' [] a patch:Delete ; - patch:subject <ingen:root%s> . + patch:subject <ingen:/root%s> . ''' % path) diff --git a/src/gui/App.cpp b/src/gui/App.cpp index b458bc3c..389020e2 100644 --- a/src/gui/App.cpp +++ b/src/gui/App.cpp @@ -197,7 +197,7 @@ void App::request_plugins_if_necessary() { if (!_requested_plugins) { - _world->interface()->get(Raul::URI("ingen:plugins")); + _world->interface()->get(Raul::URI("ingen:/plugins")); _requested_plugins = true; } } diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp index 7951b479..36827489 100644 --- a/src/gui/ConnectWindow.cpp +++ b/src/gui/ConnectWindow.cpp @@ -255,7 +255,7 @@ ConnectWindow::disconnect() void ConnectWindow::activate() { - _app->interface()->set_property(Raul::URI("ingen:driver"), + _app->interface()->set_property(Raul::URI("ingen:/driver"), _app->uris().ingen_enabled, _app->forge().make(true)); } @@ -263,7 +263,7 @@ ConnectWindow::activate() void ConnectWindow::deactivate() { - _app->interface()->set_property(Raul::URI("ingen:driver"), + _app->interface()->set_property(Raul::URI("ingen:/driver"), _app->uris().ingen_enabled, _app->forge().make(false)); } @@ -390,7 +390,7 @@ ConnectWindow::gtk_callback() _ping_id = g_random_int(); _app->interface()->set_response_id(_ping_id); - _app->interface()->get(Raul::URI("ingen:engine")); + _app->interface()->get(Raul::URI("ingen:/engine")); if (_widgets_loaded) { _progress_label->set_text("Connecting to engine..."); @@ -407,7 +407,7 @@ ConnectWindow::gtk_callback() (now.tv_usec - last.tv_usec) * 0.001f; if (ms_since_last > 1000) { _app->interface()->set_response_id(_ping_id); - _app->interface()->get(Raul::URI("ingen:engine")); + _app->interface()->get(Raul::URI("ingen:/engine")); last = now; } } @@ -423,14 +423,14 @@ ConnectWindow::gtk_callback() if (root) { set_connected_to(_app->interface()); _app->window_factory()->present_graph(root); - _app->interface()->get(Raul::URI("ingen:plugins")); + _app->interface()->get(Raul::URI("ingen:/plugins")); if (_widgets_loaded) _progress_label->set_text(string("Loading plugins...")); ++_connect_stage; } } } else if (_connect_stage == 4) { - _app->interface()->get(Raul::URI("ingen:plugins")); + _app->interface()->get(Raul::URI("ingen:/plugins")); hide(); if (_widgets_loaded) _progress_label->set_text("Connected to engine"); diff --git a/src/ingen/main.cpp b/src/ingen/main.cpp index 4c6a5925..3cd2ccf6 100644 --- a/src/ingen/main.cpp +++ b/src/ingen/main.cpp @@ -175,7 +175,7 @@ main(int argc, char** argv) conf.option("load").get_string() : conf.files().front(); - engine_interface->get(Raul::URI("ingen:plugins")); + engine_interface->get(Raul::URI("ingen:/plugins")); engine_interface->get(Node::root_uri()); world->parser()->parse_file( world, engine_interface.get(), path, parent, symbol); diff --git a/src/server/Broadcaster.hpp b/src/server/Broadcaster.hpp index 541e8e95..157b07ea 100644 --- a/src/server/Broadcaster.hpp +++ b/src/server/Broadcaster.hpp @@ -123,7 +123,7 @@ public: BROADCAST(set_property, subject, predicate, value); } - Raul::URI uri() const { return Raul::URI("ingen:broadcaster"); } + Raul::URI uri() const { return Raul::URI("ingen:/broadcaster"); } void set_response_id(int32_t id) {} ///< N/A void get(const Raul::URI& uri) {} ///< N/A diff --git a/src/server/EventWriter.hpp b/src/server/EventWriter.hpp index 5c44c5b6..c2fc0b81 100644 --- a/src/server/EventWriter.hpp +++ b/src/server/EventWriter.hpp @@ -40,7 +40,7 @@ public: explicit EventWriter(Engine& engine); virtual ~EventWriter(); - Raul::URI uri() const { return Raul::URI("ingen:eventWriter"); } + Raul::URI uri() const { return Raul::URI("ingen:/clients/event_writer"); } virtual SharedPtr<Interface> respondee() const { return _respondee; diff --git a/src/server/events/Get.cpp b/src/server/events/Get.cpp index 949e8c49..b65b47bf 100644 --- a/src/server/events/Get.cpp +++ b/src/server/events/Get.cpp @@ -55,10 +55,10 @@ Get::pre_process() { _lock.acquire(); - if (_uri == "ingen:plugins") { + if (_uri == "ingen:/plugins") { _plugins = _engine.block_factory()->plugins(); return Event::pre_process_done(SUCCESS); - } else if (_uri == "ingen:engine") { + } else if (_uri == "ingen:/engine") { return Event::pre_process_done(SUCCESS); } else if (Node::uri_is_path(_uri)) { _object = _engine.store()->get(Node::uri_to_path(_uri)); @@ -131,9 +131,9 @@ Get::post_process() { Broadcaster::Transfer t(*_engine.broadcaster()); if (!respond() && _request_client) { - if (_uri == "ingen:plugins") { + if (_uri == "ingen:/plugins") { _engine.broadcaster()->send_plugins_to(_request_client.get(), _plugins); - } else if (_uri == "ingen:engine") { + } else if (_uri == "ingen:/engine") { // TODO: Keep a proper RDF model of the engine URIs& uris = _engine.world()->uris(); _request_client->set_property( diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp index f0a4c2df..f8f4b7c3 100644 --- a/src/server/ingen_lv2.cpp +++ b/src/server/ingen_lv2.cpp @@ -606,7 +606,7 @@ ingen_instantiate(const LV2_Descriptor* descriptor, Since we are not yet rolling, it won't be drained, causing a deadlock. */ SharedPtr<Interface> client(&driver->writer(), NullDeleter<Interface>); interface->set_respondee(client); - engine->register_client(Raul::URI("ingen:lv2"), client); + engine->register_client(Raul::URI("ingen:/clients/lv2"), client); return (LV2_Handle)plugin; } diff --git a/src/socket/SocketReader.cpp b/src/socket/SocketReader.cpp index 12fb112f..cc5da947 100644 --- a/src/socket/SocketReader.cpp +++ b/src/socket/SocketReader.cpp @@ -101,9 +101,9 @@ SocketReader::_run() return; } - // Use <ingen:root/> as base URI so e.g. </foo/bar> will be a path + // Use <ingen:/root/> as base URI so e.g. </foo/bar> will be a path SordNode* base_uri = sord_new_uri( - world->c_obj(), (const uint8_t*)"ingen:root/"); + world->c_obj(), (const uint8_t*)"ingen:/root/"); // Set up sratom and a forge to build LV2 atoms from model Sratom* sratom = sratom_new(map); diff --git a/src/socket/SocketWriter.cpp b/src/socket/SocketWriter.cpp index 19a1c713..d2652dec 100644 --- a/src/socket/SocketWriter.cpp +++ b/src/socket/SocketWriter.cpp @@ -50,8 +50,8 @@ SocketWriter::SocketWriter(URIMap& map, , _uri(uri) , _socket(sock) { - // Use <ingen:root/> as base URI so e.g. </foo/bar> will be a path - _base = serd_node_from_string(SERD_URI, (const uint8_t*)"ingen:root/"); + // Use <ingen:/root/> as base URI so e.g. </foo/bar> will be a path + _base = serd_node_from_string(SERD_URI, (const uint8_t*)"ingen:/root/"); serd_uri_parse(_base.buf, &_base_uri); diff --git a/tests/ingen_test.cpp b/tests/ingen_test.cpp index 2e532701..ade41aa7 100644 --- a/tests/ingen_test.cpp +++ b/tests/ingen_test.cpp @@ -203,7 +203,7 @@ main(int argc, char** argv) SharedPtr<Interface> client(new TestClient(world->log())); world->interface()->set_respondee(client); - world->engine()->register_client(Raul::URI("ingen:testClient"), + world->engine()->register_client(Raul::URI("ingen:/clients/test"), client); SerdURI cmds_base; |