From 8ec295a0f2a40086ed83e8d2ad8ad38c8125bcb4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 10 May 2012 04:02:24 +0000 Subject: LV2URIMap => URIMap. Trim unnecessary includes. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4337 a436a847-0d15-0410-975c-d299462d15a1 --- src/client/ClientStore.cpp | 7 +-- src/client/NodeModel.cpp | 5 +- src/client/ObjectModel.cpp | 1 - src/client/PatchModel.cpp | 11 ++-- src/client/PluginModel.cpp | 2 - src/client/PluginUI.cpp | 1 - src/client/PortModel.cpp | 3 +- src/gui/App.cpp | 6 +-- src/gui/Configuration.cpp | 11 ++-- src/gui/LoadPatchWindow.cpp | 13 ++--- src/gui/LoadPluginWindow.cpp | 1 - src/gui/NewSubpatchWindow.cpp | 6 +-- src/gui/NodeMenu.cpp | 1 - src/gui/NodeModule.cpp | 15 +++--- src/gui/ObjectMenu.cpp | 1 - src/gui/PatchBox.cpp | 1 - src/gui/PatchCanvas.cpp | 1 - src/gui/PatchPortModule.cpp | 9 ++-- src/gui/PatchTreeWindow.cpp | 1 - src/gui/PatchView.cpp | 1 - src/gui/Port.cpp | 1 - src/gui/PortMenu.cpp | 5 +- src/gui/PortPropertiesWindow.cpp | 3 +- src/gui/RenameWindow.cpp | 5 +- src/gui/SubpatchModule.cpp | 2 - src/gui/ingen_gui_lv2.cpp | 6 +-- src/serialisation/Parser.cpp | 6 +-- src/serialisation/Serialiser.cpp | 6 +-- src/server/Buffer.cpp | 4 +- src/server/BufferFactory.cpp | 1 - src/server/ConnectionImpl.cpp | 1 - src/server/ControlBindings.cpp | 1 - src/server/ControlBindings.hpp | 1 - src/server/DuplexPort.cpp | 1 - src/server/Engine.cpp | 12 ++--- src/server/InputPort.cpp | 1 - src/server/InternalPlugin.cpp | 1 - src/server/JackDriver.cpp | 1 - src/server/LV2Node.cpp | 4 +- src/server/LV2Plugin.cpp | 1 - src/server/Notification.cpp | 1 - src/server/ObjectSender.cpp | 1 - src/server/OutputPort.cpp | 1 - src/server/PatchImpl.cpp | 1 - src/server/PortImpl.cpp | 1 - src/server/events/CreateNode.cpp | 1 - src/server/events/CreatePatch.cpp | 1 - src/server/events/CreatePort.cpp | 7 +-- src/server/events/SetMetadata.cpp | 6 +-- src/server/events/SetPortValue.cpp | 1 - src/server/ingen_lv2.cpp | 4 +- src/server/internals/Controller.cpp | 1 - src/server/internals/Delay.cpp | 1 - src/server/internals/Note.cpp | 1 - src/server/internals/Trigger.cpp | 1 - src/shared/AtomReader.cpp | 3 +- src/shared/AtomWriter.cpp | 3 +- src/shared/Builder.cpp | 8 ++- src/shared/Forge.cpp | 3 +- src/shared/LV2Features.cpp | 2 +- src/shared/LV2URIMap.cpp | 105 ------------------------------------ src/shared/ResourceImpl.cpp | 5 +- src/shared/URIMap.cpp | 105 ++++++++++++++++++++++++++++++++++++ src/shared/URIs.cpp | 7 +-- src/shared/World.cpp | 22 ++++---- src/shared/wscript | 2 +- src/socket/SocketClient.hpp | 2 +- src/socket/SocketReader.cpp | 8 +-- src/socket/SocketServer.hpp | 2 +- src/socket/SocketWriter.cpp | 10 ++-- src/socket/SocketWriter.hpp | 24 ++++----- 71 files changed, 234 insertions(+), 266 deletions(-) delete mode 100644 src/shared/LV2URIMap.cpp create mode 100644 src/shared/URIMap.cpp (limited to 'src') diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 445dc182..301737ae 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -14,11 +14,6 @@ along with Ingen. If not, see . */ -#include "raul/log.hpp" -#include "raul/PathTable.hpp" - -#include "ingen/shared/LV2URIMap.hpp" - #include "ingen/client/ClientStore.hpp" #include "ingen/client/EdgeModel.hpp" #include "ingen/client/NodeModel.hpp" @@ -27,6 +22,8 @@ #include "ingen/client/PluginModel.hpp" #include "ingen/client/PortModel.hpp" #include "ingen/client/SigClientInterface.hpp" +#include "raul/PathTable.hpp" +#include "raul/log.hpp" #define LOG(s) s << "[ClientStore] " diff --git a/src/client/NodeModel.cpp b/src/client/NodeModel.cpp index cab4dafa..652ed318 100644 --- a/src/client/NodeModel.cpp +++ b/src/client/NodeModel.cpp @@ -18,10 +18,9 @@ #include #include "ingen/Port.hpp" -#include "ingen/shared/World.hpp" -#include "ingen/shared/LV2URIMap.hpp" -#include "ingen/shared/URIs.hpp" #include "ingen/client/NodeModel.hpp" +#include "ingen/shared/URIs.hpp" +#include "ingen/shared/World.hpp" using namespace std; using namespace Raul; diff --git a/src/client/ObjectModel.cpp b/src/client/ObjectModel.cpp index dab09c21..452a6a3b 100644 --- a/src/client/ObjectModel.cpp +++ b/src/client/ObjectModel.cpp @@ -16,7 +16,6 @@ #include "ingen/GraphObject.hpp" #include "ingen/client/ObjectModel.hpp" -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "raul/TableImpl.hpp" diff --git a/src/client/PatchModel.cpp b/src/client/PatchModel.cpp index 2513ca70..91c0c7f1 100644 --- a/src/client/PatchModel.cpp +++ b/src/client/PatchModel.cpp @@ -15,15 +15,14 @@ */ #include -#include "raul/log.hpp" -#include "ingen/shared/LV2URIMap.hpp" -#include "ingen/shared/URIs.hpp" +#include "raul/log.hpp" -#include "ingen/client/PatchModel.hpp" -#include "ingen/client/NodeModel.hpp" -#include "ingen/client/EdgeModel.hpp" #include "ingen/client/ClientStore.hpp" +#include "ingen/client/EdgeModel.hpp" +#include "ingen/client/NodeModel.hpp" +#include "ingen/client/PatchModel.hpp" +#include "ingen/shared/URIs.hpp" using namespace std; using namespace Raul; diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp index 7d5aa993..1612be45 100644 --- a/src/client/PluginModel.cpp +++ b/src/client/PluginModel.cpp @@ -21,8 +21,6 @@ #include "raul/Atom.hpp" #include "raul/Path.hpp" -#include "ingen/shared/LV2URIMap.hpp" - #include "ingen/client/PatchModel.hpp" #include "ingen/client/PluginModel.hpp" #include "ingen/client/PluginUI.hpp" diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp index dee00fea..939716ef 100644 --- a/src/client/PluginUI.cpp +++ b/src/client/PluginUI.cpp @@ -19,7 +19,6 @@ #include "ingen/client/NodeModel.hpp" #include "ingen/client/PluginUI.hpp" #include "ingen/client/PortModel.hpp" -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "lv2/lv2plug.in/ns/ext/atom/atom.h" #include "lv2/lv2plug.in/ns/extensions/ui/ui.h" diff --git a/src/client/PortModel.cpp b/src/client/PortModel.cpp index 4cb13afd..5298615d 100644 --- a/src/client/PortModel.cpp +++ b/src/client/PortModel.cpp @@ -14,9 +14,8 @@ along with Ingen. If not, see . */ -#include "ingen/shared/LV2URIMap.hpp" -#include "ingen/client/PortModel.hpp" #include "ingen/client/NodeModel.hpp" +#include "ingen/client/PortModel.hpp" namespace Ingen { namespace Client { diff --git a/src/gui/App.cpp b/src/gui/App.cpp index 525a5885..c4c9cfe6 100644 --- a/src/gui/App.cpp +++ b/src/gui/App.cpp @@ -21,20 +21,18 @@ #include #include "ganv/Edge.hpp" -#include "ingen/Interface.hpp" #include "ingen/EngineBase.hpp" +#include "ingen/Interface.hpp" #include "ingen/client/ClientStore.hpp" #include "ingen/client/ObjectModel.hpp" #include "ingen/client/PatchModel.hpp" #include "ingen/client/SigClientInterface.hpp" +#include "ingen/shared/World.hpp" #include "ingen/shared/runtime_paths.hpp" #include "lilv/lilv.h" #include "raul/Path.hpp" #include "raul/log.hpp" -#include "ingen/shared/LV2URIMap.hpp" -#include "ingen/shared/World.hpp" - #include "App.hpp" #include "Configuration.hpp" #include "ConnectWindow.hpp" diff --git a/src/gui/Configuration.cpp b/src/gui/Configuration.cpp index a6d06487..6754fd42 100644 --- a/src/gui/Configuration.cpp +++ b/src/gui/Configuration.cpp @@ -14,18 +14,19 @@ along with Ingen. If not, see . */ -#include "Configuration.hpp" #include #include #include #include -#include "raul/log.hpp" -#include "ingen/client/PortModel.hpp" + +#include "ganv/Port.hpp" #include "ingen/client/PluginModel.hpp" +#include "ingen/client/PortModel.hpp" #include "ingen/serialisation/Parser.hpp" -#include "ingen/shared/LV2URIMap.hpp" -#include "ganv/Port.hpp" +#include "raul/log.hpp" + #include "App.hpp" +#include "Configuration.hpp" #include "Port.hpp" using namespace std; diff --git a/src/gui/LoadPatchWindow.cpp b/src/gui/LoadPatchWindow.cpp index 75c0b4d8..68d51d2d 100644 --- a/src/gui/LoadPatchWindow.cpp +++ b/src/gui/LoadPatchWindow.cpp @@ -15,21 +15,22 @@ */ #include + #include #include + #include "ingen/Interface.hpp" -#include "ingen/shared/LV2URIMap.hpp" +#include "ingen/client/ClientStore.hpp" #include "ingen/client/NodeModel.hpp" #include "ingen/client/PatchModel.hpp" -#include "ingen/client/ClientStore.hpp" #include "ingen/shared/runtime_paths.hpp" + #include "App.hpp" +#include "Configuration.hpp" #include "LoadPatchWindow.hpp" #include "PatchView.hpp" -#include "Configuration.hpp" #include "ThreadedLoader.hpp" -using boost::optional; using namespace std; using namespace Raul; @@ -161,8 +162,8 @@ LoadPatchWindow::ok_clicked() if (_import) { // If unset load_patch will load value - optional parent; - optional symbol; + boost::optional parent; + boost::optional symbol; if (!_patch->path().is_root()) { parent = _patch->path().parent(); symbol = _patch->symbol(); diff --git a/src/gui/LoadPluginWindow.cpp b/src/gui/LoadPluginWindow.cpp index 2977ceca..09830642 100644 --- a/src/gui/LoadPluginWindow.cpp +++ b/src/gui/LoadPluginWindow.cpp @@ -22,7 +22,6 @@ #include "ingen/Interface.hpp" #include "ingen/client/ClientStore.hpp" #include "ingen/client/PatchModel.hpp" -#include "ingen/shared/LV2URIMap.hpp" #include "App.hpp" #include "LoadPluginWindow.hpp" diff --git a/src/gui/NewSubpatchWindow.cpp b/src/gui/NewSubpatchWindow.cpp index 720f8876..8b99a921 100644 --- a/src/gui/NewSubpatchWindow.cpp +++ b/src/gui/NewSubpatchWindow.cpp @@ -14,11 +14,11 @@ along with Ingen. If not, see . */ -#include "App.hpp" #include "ingen/Interface.hpp" -#include "ingen/shared/LV2URIMap.hpp" -#include "ingen/client/PatchModel.hpp" #include "ingen/client/ClientStore.hpp" +#include "ingen/client/PatchModel.hpp" + +#include "App.hpp" #include "NewSubpatchWindow.hpp" #include "PatchView.hpp" diff --git a/src/gui/NodeMenu.cpp b/src/gui/NodeMenu.cpp index 08f27c2a..750baf08 100644 --- a/src/gui/NodeMenu.cpp +++ b/src/gui/NodeMenu.cpp @@ -19,7 +19,6 @@ #include "ingen/Interface.hpp" #include "ingen/client/NodeModel.hpp" #include "ingen/client/PluginModel.hpp" -#include "ingen/shared/LV2URIMap.hpp" #include "lv2/lv2plug.in/ns/ext/presets/presets.h" #include "App.hpp" diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index 510d63bf..b471d525 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -15,25 +15,26 @@ */ #include -#include "raul/log.hpp" -#include "raul/Atom.hpp" + #include "ingen/Interface.hpp" -#include "ingen/shared/LV2URIMap.hpp" -#include "ingen/client/PatchModel.hpp" #include "ingen/client/NodeModel.hpp" +#include "ingen/client/PatchModel.hpp" #include "ingen/client/PluginModel.hpp" #include "ingen/client/PluginUI.hpp" +#include "raul/Atom.hpp" +#include "raul/log.hpp" + #include "App.hpp" -#include "WidgetFactory.hpp" +#include "Configuration.hpp" +#include "NodeMenu.hpp" #include "NodeModule.hpp" #include "PatchCanvas.hpp" #include "PatchWindow.hpp" #include "Port.hpp" #include "RenameWindow.hpp" #include "SubpatchModule.hpp" +#include "WidgetFactory.hpp" #include "WindowFactory.hpp" -#include "Configuration.hpp" -#include "NodeMenu.hpp" using namespace std; using namespace Raul; diff --git a/src/gui/ObjectMenu.cpp b/src/gui/ObjectMenu.cpp index 60b170f7..b1d1a766 100644 --- a/src/gui/ObjectMenu.cpp +++ b/src/gui/ObjectMenu.cpp @@ -20,7 +20,6 @@ #include "ingen/Interface.hpp" #include "ingen/client/ObjectModel.hpp" -#include "ingen/shared/LV2URIMap.hpp" #include "App.hpp" #include "ObjectMenu.hpp" diff --git a/src/gui/PatchBox.cpp b/src/gui/PatchBox.cpp index 188e1df1..9988b252 100644 --- a/src/gui/PatchBox.cpp +++ b/src/gui/PatchBox.cpp @@ -24,7 +24,6 @@ #include "ingen/Interface.hpp" #include "ingen/client/ClientStore.hpp" #include "ingen/client/PatchModel.hpp" -#include "ingen/shared/LV2URIMap.hpp" #include "App.hpp" #include "BreadCrumbs.hpp" diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp index 8cb9d384..9bbf3bc5 100644 --- a/src/gui/PatchCanvas.cpp +++ b/src/gui/PatchCanvas.cpp @@ -30,7 +30,6 @@ #include "ingen/serialisation/Serialiser.hpp" #include "ingen/shared/Builder.hpp" #include "ingen/shared/ClashAvoider.hpp" -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/World.hpp" #include "lv2/lv2plug.in/ns/ext/atom/atom.h" #include "raul/log.hpp" diff --git a/src/gui/PatchPortModule.cpp b/src/gui/PatchPortModule.cpp index 16451821..c663f926 100644 --- a/src/gui/PatchPortModule.cpp +++ b/src/gui/PatchPortModule.cpp @@ -16,19 +16,20 @@ #include #include -#include "PatchPortModule.hpp" + #include "ingen/Interface.hpp" -#include "ingen/shared/LV2URIMap.hpp" -#include "ingen/client/PatchModel.hpp" #include "ingen/client/NodeModel.hpp" +#include "ingen/client/PatchModel.hpp" + #include "App.hpp" #include "Configuration.hpp" -#include "WidgetFactory.hpp" #include "PatchCanvas.hpp" +#include "PatchPortModule.hpp" #include "PatchWindow.hpp" #include "Port.hpp" #include "PortMenu.hpp" #include "RenameWindow.hpp" +#include "WidgetFactory.hpp" #include "WindowFactory.hpp" using namespace std; diff --git a/src/gui/PatchTreeWindow.cpp b/src/gui/PatchTreeWindow.cpp index 638ba7fc..b17e8a71 100644 --- a/src/gui/PatchTreeWindow.cpp +++ b/src/gui/PatchTreeWindow.cpp @@ -17,7 +17,6 @@ #include "raul/log.hpp" #include "raul/Path.hpp" #include "ingen/Interface.hpp" -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/client/ClientStore.hpp" #include "ingen/client/PatchModel.hpp" #include "App.hpp" diff --git a/src/gui/PatchView.cpp b/src/gui/PatchView.cpp index 252772a9..282e83bc 100644 --- a/src/gui/PatchView.cpp +++ b/src/gui/PatchView.cpp @@ -18,7 +18,6 @@ #include #include "raul/log.hpp" #include "ingen/Interface.hpp" -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/client/PatchModel.hpp" #include "App.hpp" #include "PatchView.hpp" diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp index e99b0285..c9c858cb 100644 --- a/src/gui/Port.cpp +++ b/src/gui/Port.cpp @@ -18,7 +18,6 @@ #include "raul/log.hpp" #include "ganv/Module.hpp" #include "ingen/Interface.hpp" -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/client/PatchModel.hpp" #include "ingen/client/PortModel.hpp" #include "App.hpp" diff --git a/src/gui/PortMenu.cpp b/src/gui/PortMenu.cpp index e774dc29..19a6770a 100644 --- a/src/gui/PortMenu.cpp +++ b/src/gui/PortMenu.cpp @@ -16,11 +16,12 @@ #include #include -#include "raul/SharedPtr.hpp" + #include "ingen/Interface.hpp" -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/client/PatchModel.hpp" #include "ingen/client/PortModel.hpp" +#include "raul/SharedPtr.hpp" + #include "App.hpp" #include "PortMenu.hpp" #include "WindowFactory.hpp" diff --git a/src/gui/PortPropertiesWindow.cpp b/src/gui/PortPropertiesWindow.cpp index 62e7d4ac..ca48e239 100644 --- a/src/gui/PortPropertiesWindow.cpp +++ b/src/gui/PortPropertiesWindow.cpp @@ -16,10 +16,11 @@ #include #include + #include "ingen/Interface.hpp" -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/client/NodeModel.hpp" #include "ingen/client/PluginModel.hpp" + #include "App.hpp" #include "PortPropertiesWindow.hpp" diff --git a/src/gui/RenameWindow.cpp b/src/gui/RenameWindow.cpp index 5a426eeb..e10c3fcf 100644 --- a/src/gui/RenameWindow.cpp +++ b/src/gui/RenameWindow.cpp @@ -17,11 +17,10 @@ #include #include -#include "ingen/shared/LV2URIMap.hpp" - #include "ingen/Interface.hpp" -#include "ingen/client/ObjectModel.hpp" #include "ingen/client/ClientStore.hpp" +#include "ingen/client/ObjectModel.hpp" +#include "lv2/lv2plug.in/ns/lv2core/lv2.h" #include "App.hpp" #include "RenameWindow.hpp" diff --git a/src/gui/SubpatchModule.cpp b/src/gui/SubpatchModule.cpp index cbdc8a8f..6c74ec69 100644 --- a/src/gui/SubpatchModule.cpp +++ b/src/gui/SubpatchModule.cpp @@ -20,8 +20,6 @@ #include "ingen/Interface.hpp" #include "ingen/client/PatchModel.hpp" -#include "ingen/shared/LV2URIMap.hpp" - #include "App.hpp" #include "NodeModule.hpp" #include "PatchCanvas.hpp" diff --git a/src/gui/ingen_gui_lv2.cpp b/src/gui/ingen_gui_lv2.cpp index ae70e441..3448f4a9 100644 --- a/src/gui/ingen_gui_lv2.cpp +++ b/src/gui/ingen_gui_lv2.cpp @@ -99,7 +99,7 @@ instantiate(const LV2UI_Descriptor* descriptor, ui->world = new Ingen::Shared::World( &ui->conf, ui->argc, ui->argv, map, unmap); - ui->forge = new Ingen::Forge(*ui->world->lv2_uri_map().get()); + ui->forge = new Ingen::Forge(*ui->world->uri_map().get()); if (!ui->world->load_module("client")) { delete ui; @@ -111,7 +111,7 @@ instantiate(const LV2UI_Descriptor* descriptor, // Set up an engine interface that writes LV2 atoms ui->engine = SharedPtr( - new Ingen::Shared::AtomWriter(*ui->world->lv2_uri_map().get(), + new Ingen::Shared::AtomWriter(*ui->world->uri_map().get(), *ui->world->uris().get(), *ui->sink)); @@ -124,7 +124,7 @@ instantiate(const LV2UI_Descriptor* descriptor, ui->app->attach(ui->client); ui->reader = SharedPtr( - new Ingen::Shared::AtomReader(*ui->world->lv2_uri_map().get(), + new Ingen::Shared::AtomReader(*ui->world->uri_map().get(), *ui->world->uris().get(), ui->world->forge(), *ui->client.get())); diff --git a/src/serialisation/Parser.cpp b/src/serialisation/Parser.cpp index 24b96b8d..c1cce1ee 100644 --- a/src/serialisation/Parser.cpp +++ b/src/serialisation/Parser.cpp @@ -23,7 +23,7 @@ #include "ingen/Interface.hpp" #include "ingen/serialisation/Parser.hpp" -#include "ingen/shared/LV2URIMap.hpp" +#include "ingen/shared/URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "ingen/shared/World.hpp" #include "raul/Atom.hpp" @@ -99,8 +99,8 @@ get_properties(Ingen::Shared::World* world, const Sord::Node& subject) { SerdChunk out = { NULL, 0 }; - LV2_URID_Map* map = &world->lv2_uri_map()->urid_map_feature()->urid_map; - LV2_URID_Unmap* unmap = &world->lv2_uri_map()->urid_unmap_feature()->urid_unmap; + LV2_URID_Map* map = &world->uri_map()->urid_map_feature()->urid_map; + LV2_URID_Unmap* unmap = &world->uri_map()->urid_unmap_feature()->urid_unmap; Sratom* sratom = sratom_new(map); LV2_Atom_Forge forge; diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp index f16ed1d7..792d7f92 100644 --- a/src/serialisation/Serialiser.cpp +++ b/src/serialisation/Serialiser.cpp @@ -35,9 +35,9 @@ #include "ingen/Plugin.hpp" #include "ingen/Port.hpp" #include "ingen/serialisation/Serialiser.hpp" -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/ResourceImpl.hpp" #include "ingen/shared/Store.hpp" +#include "ingen/shared/URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "ingen/shared/World.hpp" #include "lv2/lv2plug.in/ns/ext/state/state.h" @@ -544,8 +544,8 @@ Serialiser::Impl::serialise_properties(const GraphObject* o, { const GraphObject::Properties props = o->properties(context); - LV2_URID_Map* map = &_world.lv2_uri_map()->urid_map_feature()->urid_map; - LV2_URID_Unmap* unmap = &_world.lv2_uri_map()->urid_unmap_feature()->urid_unmap; + LV2_URID_Map* map = &_world.uri_map()->urid_map_feature()->urid_map; + LV2_URID_Unmap* unmap = &_world.uri_map()->urid_unmap_feature()->urid_unmap; Sratom* sratom = sratom_new(map); SerdNode base = serd_node_from_string(SERD_URI, (const uint8_t*)_base_uri.c_str()); diff --git a/src/server/Buffer.cpp b/src/server/Buffer.cpp index b112d8ea..a89d19df 100644 --- a/src/server/Buffer.cpp +++ b/src/server/Buffer.cpp @@ -22,7 +22,7 @@ #include #include "ingen/shared/LV2Features.hpp" -#include "ingen/shared/LV2URIMap.hpp" +#include "ingen/shared/URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "ingen/shared/World.hpp" #include "ingen_config.h" @@ -118,7 +118,7 @@ Buffer::port_data(PortType port_type, SampleCount offset) } else { Raul::warn << "Audio data requested from non-audio buffer " << this << " :: " << _atom->type << " - " - << _factory.engine().world()->lv2_uri_map()->unmap_uri(_atom->type) + << _factory.engine().world()->uri_map()->unmap_uri(_atom->type) << std::endl; assert(false); return NULL; diff --git a/src/server/BufferFactory.cpp b/src/server/BufferFactory.cpp index fcbf1189..fce074da 100644 --- a/src/server/BufferFactory.cpp +++ b/src/server/BufferFactory.cpp @@ -16,7 +16,6 @@ #include -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "raul/log.hpp" diff --git a/src/server/ConnectionImpl.cpp b/src/server/ConnectionImpl.cpp index 1fde56b4..c91b7403 100644 --- a/src/server/ConnectionImpl.cpp +++ b/src/server/ConnectionImpl.cpp @@ -17,7 +17,6 @@ #include #include -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "lv2/lv2plug.in/ns/ext/atom/util.h" #include "raul/Maid.hpp" diff --git a/src/server/ControlBindings.cpp b/src/server/ControlBindings.cpp index 0cfd5042..ac0d5018 100644 --- a/src/server/ControlBindings.cpp +++ b/src/server/ControlBindings.cpp @@ -16,7 +16,6 @@ #include -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "ingen/shared/World.hpp" #include "lv2/lv2plug.in/ns/ext/atom/util.h" diff --git a/src/server/ControlBindings.hpp b/src/server/ControlBindings.hpp index 0a3a92c0..2a107dfc 100644 --- a/src/server/ControlBindings.hpp +++ b/src/server/ControlBindings.hpp @@ -20,7 +20,6 @@ #include #include -#include "ingen/shared/LV2URIMap.hpp" #include "raul/Atom.hpp" #include "raul/Path.hpp" #include "raul/SharedPtr.hpp" diff --git a/src/server/DuplexPort.cpp b/src/server/DuplexPort.cpp index 6050e669..e63de6e2 100644 --- a/src/server/DuplexPort.cpp +++ b/src/server/DuplexPort.cpp @@ -18,7 +18,6 @@ #include #include -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "Buffer.hpp" diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp index f3b5e476..004a9806 100644 --- a/src/server/Engine.cpp +++ b/src/server/Engine.cpp @@ -17,16 +17,16 @@ #include #include #include -#include "raul/log.hpp" -#include "raul/Deletable.hpp" -#include "raul/Maid.hpp" -#include "raul/SharedPtr.hpp" + #include "events/CreatePort.hpp" -#include "ingen/shared/World.hpp" #include "ingen/shared/LV2Features.hpp" -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/Store.hpp" #include "ingen/shared/URIs.hpp" +#include "ingen/shared/World.hpp" +#include "raul/Deletable.hpp" +#include "raul/Maid.hpp" +#include "raul/SharedPtr.hpp" +#include "raul/log.hpp" #include "BufferFactory.hpp" #include "ClientBroadcaster.hpp" diff --git a/src/server/InputPort.cpp b/src/server/InputPort.cpp index a6b377c7..3f3dcdd0 100644 --- a/src/server/InputPort.cpp +++ b/src/server/InputPort.cpp @@ -29,7 +29,6 @@ #include "OutputPort.hpp" #include "ProcessContext.hpp" #include "ThreadManager.hpp" -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "mix.hpp" #include "util.hpp" diff --git a/src/server/InternalPlugin.cpp b/src/server/InternalPlugin.cpp index bad76364..edfc75a2 100644 --- a/src/server/InternalPlugin.cpp +++ b/src/server/InternalPlugin.cpp @@ -16,7 +16,6 @@ #include #include -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "internals/Controller.hpp" #include "internals/Delay.hpp" diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp index 24e5f86c..370a4ce8 100644 --- a/src/server/JackDriver.cpp +++ b/src/server/JackDriver.cpp @@ -44,7 +44,6 @@ #include "ProcessSlave.hpp" #include "ThreadManager.hpp" #include "ingen/shared/LV2Features.hpp" -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/World.hpp" #include "util.hpp" diff --git a/src/server/LV2Node.cpp b/src/server/LV2Node.cpp index dfba7177..a3d8b104 100644 --- a/src/server/LV2Node.cpp +++ b/src/server/LV2Node.cpp @@ -27,7 +27,7 @@ #include "raul/Maid.hpp" #include "raul/Array.hpp" -#include "ingen/shared/LV2URIMap.hpp" +#include "ingen/shared/URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "AudioBuffer.hpp" @@ -248,7 +248,7 @@ LV2Node::instantiate(BufferFactory& bufs) if (lilv_node_is_uri(type)) { port->add_property(uris.atom_bufferType, forge.alloc_uri(lilv_node_as_uri(type))); - buffer_type = bufs.engine().world()->lv2_uri_map()->map_uri( + buffer_type = bufs.engine().world()->uri_map()->map_uri( lilv_node_as_uri(type)); } } diff --git a/src/server/LV2Plugin.cpp b/src/server/LV2Plugin.cpp index 42b9f2d4..0989f881 100644 --- a/src/server/LV2Plugin.cpp +++ b/src/server/LV2Plugin.cpp @@ -18,7 +18,6 @@ #include #include -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "raul/log.hpp" #include "sord/sordmm.hpp" diff --git a/src/server/Notification.cpp b/src/server/Notification.cpp index 3d7efe23..05570a0f 100644 --- a/src/server/Notification.cpp +++ b/src/server/Notification.cpp @@ -14,7 +14,6 @@ along with Ingen. If not, see . */ -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "ClientBroadcaster.hpp" diff --git a/src/server/ObjectSender.cpp b/src/server/ObjectSender.cpp index 85be4efd..9565bd82 100644 --- a/src/server/ObjectSender.cpp +++ b/src/server/ObjectSender.cpp @@ -16,7 +16,6 @@ #include "ObjectSender.hpp" #include "ingen/Interface.hpp" -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "EngineStore.hpp" #include "PatchImpl.hpp" diff --git a/src/server/OutputPort.cpp b/src/server/OutputPort.cpp index b8ad0169..16984e3b 100644 --- a/src/server/OutputPort.cpp +++ b/src/server/OutputPort.cpp @@ -21,7 +21,6 @@ #include "NodeImpl.hpp" #include "OutputPort.hpp" #include "ProcessContext.hpp" -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" using namespace std; diff --git a/src/server/PatchImpl.cpp b/src/server/PatchImpl.cpp index 4fa13a40..912ce9c2 100644 --- a/src/server/PatchImpl.cpp +++ b/src/server/PatchImpl.cpp @@ -18,7 +18,6 @@ #include #include -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "ingen/shared/World.hpp" #include "raul/log.hpp" diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp index 051ecc8e..a775ab91 100644 --- a/src/server/PortImpl.cpp +++ b/src/server/PortImpl.cpp @@ -14,7 +14,6 @@ along with Ingen. If not, see . */ -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "lv2/lv2plug.in/ns/ext/worker/worker.h" #include "raul/Array.hpp" diff --git a/src/server/events/CreateNode.cpp b/src/server/events/CreateNode.cpp index 5e070235..231cf2e2 100644 --- a/src/server/events/CreateNode.cpp +++ b/src/server/events/CreateNode.cpp @@ -14,7 +14,6 @@ along with Ingen. If not, see . */ -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "raul/Maid.hpp" #include "raul/Path.hpp" diff --git a/src/server/events/CreatePatch.cpp b/src/server/events/CreatePatch.cpp index 794ff7d6..ed31130b 100644 --- a/src/server/events/CreatePatch.cpp +++ b/src/server/events/CreatePatch.cpp @@ -14,7 +14,6 @@ along with Ingen. If not, see . */ -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "raul/Maid.hpp" #include "raul/Path.hpp" diff --git a/src/server/events/CreatePort.cpp b/src/server/events/CreatePort.cpp index 386f1d59..d2377a36 100644 --- a/src/server/events/CreatePort.cpp +++ b/src/server/events/CreatePort.cpp @@ -14,12 +14,13 @@ along with Ingen. If not, see . */ +#include "ingen/shared/URIMap.hpp" +#include "ingen/shared/URIs.hpp" #include "raul/Array.hpp" #include "raul/Atom.hpp" #include "raul/Maid.hpp" #include "raul/Path.hpp" -#include "ingen/shared/LV2URIMap.hpp" -#include "ingen/shared/URIs.hpp" + #include "ClientBroadcaster.hpp" #include "ControlBindings.hpp" #include "CreatePort.hpp" @@ -79,7 +80,7 @@ CreatePort::CreatePort(Engine& engine, const Range buffer_types = properties.equal_range(uris.atom_bufferType); for (Iterator i = buffer_types.first; i != buffer_types.second; ++i) { if (i->second.type() == _engine.world()->forge().URI) { - _buffer_type = _engine.world()->lv2_uri_map()->map_uri(i->second.get_uri()); + _buffer_type = _engine.world()->uri_map()->map_uri(i->second.get_uri()); } } diff --git a/src/server/events/SetMetadata.cpp b/src/server/events/SetMetadata.cpp index 68cdbbbd..42392a8a 100644 --- a/src/server/events/SetMetadata.cpp +++ b/src/server/events/SetMetadata.cpp @@ -21,7 +21,7 @@ #include "raul/log.hpp" #include "raul/Maid.hpp" -#include "ingen/shared/LV2URIMap.hpp" +#include "ingen/shared/URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "ClientBroadcaster.hpp" @@ -82,13 +82,13 @@ SetMetadata::SetMetadata(Engine& engine, for (iterator i = properties.begin(); i != properties.end(); ++i) { LOG(info) << " + " << i->first << " = " << engine.world()->forge().str(i->second) - << " :: " << engine.world()->lv2_uri_map()->unmap_uri(i->second.type()) << endl; + << " :: " << engine.world()->uri_map()->unmap_uri(i->second.type()) << endl; } typedef Resource::Properties::const_iterator iterator; for (iterator i = remove.begin(); i != remove.end(); ++i) { LOG(info) << " - " << i->first << " = " << engine.world()->forge().str(i->second) - << " :: " << engine.world()->lv2_uri_map()->unmap_uri(i->second.type()) << endl; + << " :: " << engine.world()->uri_map()->unmap_uri(i->second.type()) << endl; } LOG(info) << "}" << endl; */ diff --git a/src/server/events/SetPortValue.cpp b/src/server/events/SetPortValue.cpp index ab4074e9..2c21fdbb 100644 --- a/src/server/events/SetPortValue.cpp +++ b/src/server/events/SetPortValue.cpp @@ -17,7 +17,6 @@ #include #include "ingen/shared/LV2Features.hpp" -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "ingen/shared/World.hpp" #include "raul/log.hpp" diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp index 5e21f679..df88f7d8 100644 --- a/src/server/ingen_lv2.cpp +++ b/src/server/ingen_lv2.cpp @@ -141,11 +141,11 @@ private: public: LV2Driver(Engine& engine, SampleCount buffer_size, SampleCount sample_rate) : _context(engine) - , _reader(*engine.world()->lv2_uri_map().get(), + , _reader(*engine.world()->uri_map().get(), *engine.world()->uris().get(), engine.world()->forge(), *engine.world()->engine().get()) - , _writer(*engine.world()->lv2_uri_map().get(), + , _writer(*engine.world()->uri_map().get(), *engine.world()->uris().get(), *this) , _to_ui(buffer_size * sizeof(float)) // FIXME: size diff --git a/src/server/internals/Controller.cpp b/src/server/internals/Controller.cpp index 25561535..2b68966f 100644 --- a/src/server/internals/Controller.cpp +++ b/src/server/internals/Controller.cpp @@ -16,7 +16,6 @@ #include -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "internals/Controller.hpp" #include "lv2/lv2plug.in/ns/ext/atom/util.h" diff --git a/src/server/internals/Delay.cpp b/src/server/internals/Delay.cpp index e2838d31..0386b2d2 100644 --- a/src/server/internals/Delay.cpp +++ b/src/server/internals/Delay.cpp @@ -17,7 +17,6 @@ #include #include -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "raul/Array.hpp" #include "raul/Maid.hpp" diff --git a/src/server/internals/Note.cpp b/src/server/internals/Note.cpp index 6eb6ffb2..3733a274 100644 --- a/src/server/internals/Note.cpp +++ b/src/server/internals/Note.cpp @@ -16,7 +16,6 @@ #include -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "lv2/lv2plug.in/ns/ext/atom/util.h" #include "raul/Array.hpp" diff --git a/src/server/internals/Trigger.cpp b/src/server/internals/Trigger.cpp index d6d13c58..3de1ffc6 100644 --- a/src/server/internals/Trigger.cpp +++ b/src/server/internals/Trigger.cpp @@ -16,7 +16,6 @@ #include -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "lv2/lv2plug.in/ns/ext/atom/util.h" #include "raul/log.hpp" diff --git a/src/shared/AtomReader.cpp b/src/shared/AtomReader.cpp index 45b60c35..dc2aa15c 100644 --- a/src/shared/AtomReader.cpp +++ b/src/shared/AtomReader.cpp @@ -17,6 +17,7 @@ #include #include "ingen/shared/AtomReader.hpp" +#include "ingen/shared/URIMap.hpp" #include "lv2/lv2plug.in/ns/ext/atom/util.h" #include "raul/Path.hpp" #include "raul/log.hpp" @@ -24,7 +25,7 @@ namespace Ingen { namespace Shared { -AtomReader::AtomReader(LV2URIMap& map, URIs& uris, Forge& forge, Interface& iface) +AtomReader::AtomReader(URIMap& map, URIs& uris, Forge& forge, Interface& iface) : _map(map) , _uris(uris) , _forge(forge) diff --git a/src/shared/AtomWriter.cpp b/src/shared/AtomWriter.cpp index 8d88ef11..ab65f435 100644 --- a/src/shared/AtomWriter.cpp +++ b/src/shared/AtomWriter.cpp @@ -16,6 +16,7 @@ #include "ingen/shared/AtomSink.hpp" #include "ingen/shared/AtomWriter.hpp" +#include "ingen/shared/URIMap.hpp" #include "raul/Path.hpp" #include "serd/serd.h" @@ -40,7 +41,7 @@ forge_deref(LV2_Atom_Forge_Sink_Handle handle, LV2_Atom_Forge_Ref ref) return (LV2_Atom*)(chunk->buf + ref - 1); } -AtomWriter::AtomWriter(LV2URIMap& map, URIs& uris, AtomSink& sink) +AtomWriter::AtomWriter(URIMap& map, URIs& uris, AtomSink& sink) : _map(map) , _uris(uris) , _sink(sink) diff --git a/src/shared/Builder.cpp b/src/shared/Builder.cpp index 272a3394..b0f095ca 100644 --- a/src/shared/Builder.cpp +++ b/src/shared/Builder.cpp @@ -14,18 +14,16 @@ along with Ingen. If not, see . */ -#include "raul/Atom.hpp" -#include "raul/Path.hpp" - -#include "ingen/Interface.hpp" #include "ingen/Connection.hpp" +#include "ingen/Interface.hpp" #include "ingen/Node.hpp" #include "ingen/Patch.hpp" #include "ingen/Plugin.hpp" #include "ingen/Port.hpp" #include "ingen/shared/Builder.hpp" -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" +#include "raul/Atom.hpp" +#include "raul/Path.hpp" using namespace std; using namespace Raul; diff --git a/src/shared/Forge.cpp b/src/shared/Forge.cpp index fc8116c6..c481b50e 100644 --- a/src/shared/Forge.cpp +++ b/src/shared/Forge.cpp @@ -17,11 +17,12 @@ #include #include "ingen/shared/Forge.hpp" +#include "ingen/shared/URIMap.hpp" #include "lv2/lv2plug.in/ns/ext/atom/atom.h" namespace Ingen { -Forge::Forge(Shared::LV2URIMap& map) +Forge::Forge(Shared::URIMap& map) { Int = map.map_uri(LV2_ATOM__Int); Float = map.map_uri(LV2_ATOM__Float); diff --git a/src/shared/LV2Features.cpp b/src/shared/LV2Features.cpp index 0b1b7b3c..1bfd3936 100644 --- a/src/shared/LV2Features.cpp +++ b/src/shared/LV2Features.cpp @@ -17,7 +17,7 @@ #include #include "ingen/shared/LV2Features.hpp" -#include "ingen/shared/LV2URIMap.hpp" +#include "ingen/shared/URIMap.hpp" using namespace std; diff --git a/src/shared/LV2URIMap.cpp b/src/shared/LV2URIMap.cpp deleted file mode 100644 index dae8bd69..00000000 --- a/src/shared/LV2URIMap.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* - This file is part of Ingen. - Copyright 2007-2012 David Robillard - - 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 . -*/ - -#define __STDC_LIMIT_MACROS 1 - -#include -#include - -#include - -#include - -#include "ingen/shared/LV2URIMap.hpp" -#include "lv2/lv2plug.in/ns/ext/atom/atom.h" -#include "raul/log.hpp" - -using namespace std; -using namespace Raul; - -namespace Ingen { -namespace Shared { - -LV2URIMap::LV2URIMap(LV2_URID_Map* map, LV2_URID_Unmap* unmap) - : _urid_map_feature(new URIDMapFeature(this, map)) - , _urid_unmap_feature(new URIDUnmapFeature(this, unmap)) -{ -} - -LV2URIMap::URIDMapFeature::URIDMapFeature(LV2URIMap* map, - LV2_URID_Map* impl) - : Feature(LV2_URID__map, &urid_map) -{ - if (impl) { - urid_map = *impl; - } else { - urid_map.map = default_map; - urid_map.handle = NULL; - } -} - -LV2_URID -LV2URIMap::URIDMapFeature::default_map(LV2_URID_Map_Handle handle, - const char* uri) -{ - return static_cast(g_quark_from_string(uri)); -} - -LV2_URID -LV2URIMap::URIDMapFeature::map(const char* uri) -{ - return urid_map.map(urid_map.handle, uri); -} - -LV2URIMap::URIDUnmapFeature::URIDUnmapFeature(LV2URIMap* map, - LV2_URID_Unmap* impl) - : Feature(LV2_URID__unmap, &urid_unmap) -{ - if (impl) { - urid_unmap = *impl; - } else { - urid_unmap.unmap = default_unmap; - urid_unmap.handle = NULL; - } -} - -const char* -LV2URIMap::URIDUnmapFeature::default_unmap(LV2_URID_Unmap_Handle handle, - LV2_URID urid) -{ - return g_quark_to_string(urid); -} - -const char* -LV2URIMap::URIDUnmapFeature::unmap(LV2_URID urid) -{ - return urid_unmap.unmap(urid_unmap.handle, urid); -} - -uint32_t -LV2URIMap::map_uri(const char* uri) -{ - return _urid_map_feature->map(uri); -} - -const char* -LV2URIMap::unmap_uri(uint32_t urid) -{ - return _urid_unmap_feature->unmap(urid); -} - -} // namespace Shared -} // namespace Ingen diff --git a/src/shared/ResourceImpl.cpp b/src/shared/ResourceImpl.cpp index 5ec07b13..9bf7384e 100644 --- a/src/shared/ResourceImpl.cpp +++ b/src/shared/ResourceImpl.cpp @@ -14,11 +14,10 @@ along with Ingen. If not, see . */ -#include "raul/log.hpp" -#include "raul/Atom.hpp" -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/ResourceImpl.hpp" #include "ingen/shared/URIs.hpp" +#include "raul/Atom.hpp" +#include "raul/log.hpp" using namespace std; using namespace Raul; diff --git a/src/shared/URIMap.cpp b/src/shared/URIMap.cpp new file mode 100644 index 00000000..144941e9 --- /dev/null +++ b/src/shared/URIMap.cpp @@ -0,0 +1,105 @@ +/* + This file is part of Ingen. + Copyright 2007-2012 David Robillard + + 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 . +*/ + +#define __STDC_LIMIT_MACROS 1 + +#include +#include + +#include + +#include + +#include "ingen/shared/URIMap.hpp" +#include "lv2/lv2plug.in/ns/ext/atom/atom.h" +#include "raul/log.hpp" + +using namespace std; +using namespace Raul; + +namespace Ingen { +namespace Shared { + +URIMap::URIMap(LV2_URID_Map* map, LV2_URID_Unmap* unmap) + : _urid_map_feature(new URIDMapFeature(this, map)) + , _urid_unmap_feature(new URIDUnmapFeature(this, unmap)) +{ +} + +URIMap::URIDMapFeature::URIDMapFeature(URIMap* map, + LV2_URID_Map* impl) + : Feature(LV2_URID__map, &urid_map) +{ + if (impl) { + urid_map = *impl; + } else { + urid_map.map = default_map; + urid_map.handle = NULL; + } +} + +LV2_URID +URIMap::URIDMapFeature::default_map(LV2_URID_Map_Handle handle, + const char* uri) +{ + return static_cast(g_quark_from_string(uri)); +} + +LV2_URID +URIMap::URIDMapFeature::map(const char* uri) +{ + return urid_map.map(urid_map.handle, uri); +} + +URIMap::URIDUnmapFeature::URIDUnmapFeature(URIMap* map, + LV2_URID_Unmap* impl) + : Feature(LV2_URID__unmap, &urid_unmap) +{ + if (impl) { + urid_unmap = *impl; + } else { + urid_unmap.unmap = default_unmap; + urid_unmap.handle = NULL; + } +} + +const char* +URIMap::URIDUnmapFeature::default_unmap(LV2_URID_Unmap_Handle handle, + LV2_URID urid) +{ + return g_quark_to_string(urid); +} + +const char* +URIMap::URIDUnmapFeature::unmap(LV2_URID urid) +{ + return urid_unmap.unmap(urid_unmap.handle, urid); +} + +uint32_t +URIMap::map_uri(const char* uri) +{ + return _urid_map_feature->map(uri); +} + +const char* +URIMap::unmap_uri(uint32_t urid) +{ + return _urid_unmap_feature->unmap(urid); +} + +} // namespace Shared +} // namespace Ingen diff --git a/src/shared/URIs.cpp b/src/shared/URIs.cpp index 058e4216..56189ed5 100644 --- a/src/shared/URIs.cpp +++ b/src/shared/URIs.cpp @@ -23,11 +23,12 @@ #include +#include "ingen/shared/URIMap.hpp" #include "ingen/shared/URIs.hpp" -#include "lv2/lv2plug.in/ns/lv2core/lv2.h" #include "lv2/lv2plug.in/ns/ext/atom/atom.h" #include "lv2/lv2plug.in/ns/ext/midi/midi.h" #include "lv2/lv2plug.in/ns/ext/patch/patch.h" +#include "lv2/lv2plug.in/ns/lv2core/lv2.h" #include "raul/log.hpp" using namespace std; @@ -36,7 +37,7 @@ using namespace Raul; namespace Ingen { namespace Shared { -URIs::Quark::Quark(Ingen::Forge& forge, LV2URIMap* map, const char* c_str) +URIs::Quark::Quark(Ingen::Forge& forge, URIMap* map, const char* c_str) : Raul::URI(c_str) , id(map->map_uri(c_str)) , atom(forge.alloc_uri(c_str)) @@ -47,7 +48,7 @@ URIs::Quark::Quark(Ingen::Forge& forge, LV2URIMap* map, const char* c_str) #define NS_RDF "http://www.w3.org/1999/02/22-rdf-syntax-ns#" #define NS_RDFS "http://www.w3.org/2000/01/rdf-schema#" -URIs::URIs(Ingen::Forge& f, LV2URIMap* map) +URIs::URIs(Ingen::Forge& f, URIMap* map) : forge(f) , atom_AtomPort (forge, map, LV2_ATOM__AtomPort) , atom_Blank (forge, map, LV2_ATOM__Blank) diff --git a/src/shared/World.cpp b/src/shared/World.cpp index d2d5f74c..1d47100a 100644 --- a/src/shared/World.cpp +++ b/src/shared/World.cpp @@ -31,7 +31,7 @@ #include "ingen/shared/World.hpp" #include "ingen/shared/runtime_paths.hpp" #include "ingen/shared/LV2Features.hpp" -#include "ingen/shared/LV2URIMap.hpp" +#include "ingen/shared/URIMap.hpp" #include "ingen/shared/URIs.hpp" #define LOG(s) s << "[Module] " @@ -109,14 +109,14 @@ public: , conf(conf) , lv2_features(NULL) , rdf_world(new Sord::World()) - , lv2_uri_map(new Ingen::Shared::LV2URIMap(map, unmap)) - , forge(new Ingen::Forge(*lv2_uri_map)) - , uris(new Shared::URIs(*forge, lv2_uri_map.get())) + , uri_map(new Ingen::Shared::URIMap(map, unmap)) + , forge(new Ingen::Forge(*uri_map)) + , uris(new Shared::URIs(*forge, uri_map.get())) , lilv_world(lilv_world_new()) { lv2_features = new Ingen::Shared::LV2Features(); - lv2_features->add_feature(lv2_uri_map->urid_map_feature()); - lv2_features->add_feature(lv2_uri_map->urid_unmap_feature()); + lv2_features->add_feature(uri_map->urid_map_feature()); + lv2_features->add_feature(uri_map->urid_unmap_feature()); lilv_world_load_all(lilv_world); // Set up RDF namespaces @@ -173,7 +173,7 @@ public: Raul::Configuration* conf; LV2Features* lv2_features; Sord::World* rdf_world; - SharedPtr lv2_uri_map; + SharedPtr uri_map; Ingen::Forge* forge; SharedPtr uris; SharedPtr engine; @@ -218,10 +218,10 @@ Raul::Configuration* World::conf() { return _impl->conf; Ingen::Forge& World::forge() { return *_impl->forge; } LV2Features* World::lv2_features() { return _impl->lv2_features; } -LilvWorld* World::lilv_world() { return _impl->lilv_world; } -Sord::World* World::rdf_world() { return _impl->rdf_world; } -SharedPtr World::uris() { return _impl->uris; } -SharedPtr World::lv2_uri_map() { return _impl->lv2_uri_map; } +LilvWorld* World::lilv_world() { return _impl->lilv_world; } +Sord::World* World::rdf_world() { return _impl->rdf_world; } +SharedPtr World::uris() { return _impl->uris; } +SharedPtr World::uri_map() { return _impl->uri_map; } /** Load an Ingen module. * @return true on success, false on failure diff --git a/src/shared/wscript b/src/shared/wscript index 3a122306..15e6097e 100644 --- a/src/shared/wscript +++ b/src/shared/wscript @@ -20,10 +20,10 @@ def build(bld): Configuration.cpp Forge.cpp LV2Features.cpp - LV2URIMap.cpp Module.cpp ResourceImpl.cpp Store.cpp + URIMap.cpp URIs.cpp World.cpp runtime_paths.cpp diff --git a/src/socket/SocketClient.hpp b/src/socket/SocketClient.hpp index d75288e0..de2b473b 100644 --- a/src/socket/SocketClient.hpp +++ b/src/socket/SocketClient.hpp @@ -31,7 +31,7 @@ public: const std::string& uri, SharedPtr sock, SharedPtr respondee) - : SocketWriter(*world.lv2_uri_map().get(), + : SocketWriter(*world.uri_map().get(), *world.uris().get(), uri, sock) diff --git a/src/socket/SocketReader.cpp b/src/socket/SocketReader.cpp index 74d441ef..94c3abdb 100644 --- a/src/socket/SocketReader.cpp +++ b/src/socket/SocketReader.cpp @@ -18,10 +18,12 @@ #include #include "ingen/Interface.hpp" -#include "ingen/shared/World.hpp" #include "ingen/shared/AtomReader.hpp" +#include "ingen/shared/URIMap.hpp" +#include "ingen/shared/World.hpp" #include "sord/sordmm.hpp" #include "sratom/sratom.h" + #include "SocketReader.hpp" #define LOG(s) s << "[SocketReader] " @@ -88,7 +90,7 @@ void SocketReader::_run() { Sord::World* world = _world.rdf_world(); - LV2_URID_Map* map = &_world.lv2_uri_map()->urid_map_feature()->urid_map; + LV2_URID_Map* map = &_world.uri_map()->urid_map_feature()->urid_map; // Use as base URI so e.g. will be a path SordNode* base_uri = sord_new_uri( @@ -130,7 +132,7 @@ SocketReader::_run() serd_reader_start_stream(reader, f, (const uint8_t*)"(socket)", false); // Make an AtomReader to call Ingen Interface methods based on Atom - Shared::AtomReader ar(*_world.lv2_uri_map().get(), + Shared::AtomReader ar(*_world.uri_map().get(), *_world.uris().get(), _world.forge(), _iface); diff --git a/src/socket/SocketServer.hpp b/src/socket/SocketServer.hpp index 55434030..d03e7d4b 100644 --- a/src/socket/SocketServer.hpp +++ b/src/socket/SocketServer.hpp @@ -35,7 +35,7 @@ public: : Server::EventWriter(engine) , SocketReader(world, *this, sock) , _engine(engine) - , _writer(new SocketWriter(*world.lv2_uri_map().get(), + , _writer(new SocketWriter(*world.uri_map().get(), *world.uris().get(), sock->uri(), sock)) diff --git a/src/socket/SocketWriter.cpp b/src/socket/SocketWriter.cpp index 808d62cf..e704e5af 100644 --- a/src/socket/SocketWriter.cpp +++ b/src/socket/SocketWriter.cpp @@ -18,6 +18,8 @@ #include #include +#include "ingen/shared/URIMap.hpp" + #include "SocketWriter.hpp" namespace Ingen { @@ -34,10 +36,10 @@ socket_sink(const void* buf, size_t len, void* stream) return ret; } -SocketWriter::SocketWriter(Shared::LV2URIMap& map, - Shared::URIs& uris, - const Raul::URI& uri, - SharedPtr sock) +SocketWriter::SocketWriter(Shared::URIMap& map, + Shared::URIs& uris, + const Raul::URI& uri, + SharedPtr sock) : AtomWriter(map, uris, *this) , _map(map) , _sratom(sratom_new(&map.urid_map_feature()->urid_map)) diff --git a/src/socket/SocketWriter.hpp b/src/socket/SocketWriter.hpp index 902538f6..2e27ea98 100644 --- a/src/socket/SocketWriter.hpp +++ b/src/socket/SocketWriter.hpp @@ -36,10 +36,10 @@ namespace Socket { class SocketWriter : public Shared::AtomWriter, public Shared::AtomSink { public: - SocketWriter(Shared::LV2URIMap& map, - Shared::URIs& uris, - const Raul::URI& uri, - SharedPtr sock); + SocketWriter(Shared::URIMap& map, + Shared::URIs& uris, + const Raul::URI& uri, + SharedPtr sock); ~SocketWriter(); @@ -49,14 +49,14 @@ public: Raul::URI uri() const { return _uri; } protected: - Shared::LV2URIMap& _map; - Sratom* _sratom; - SerdNode _base; - SerdURI _base_uri; - SerdEnv* _env; - SerdWriter* _writer; - Raul::URI _uri; - SharedPtr _socket; + Shared::URIMap& _map; + Sratom* _sratom; + SerdNode _base; + SerdURI _base_uri; + SerdEnv* _env; + SerdWriter* _writer; + Raul::URI _uri; + SharedPtr _socket; }; } // namespace Socket -- cgit v1.2.1