diff options
author | David Robillard <d@drobilla.net> | 2012-04-23 00:18:45 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-04-23 00:18:45 +0000 |
commit | 034c8948e8fe47b487e17a8dd438f3a9857d571a (patch) | |
tree | 3ea10e8f91f411976b3a31119a660d06508e2c5d | |
parent | 170b763db7c14be1014268198d6e02769352c5db (diff) | |
download | ingen-034c8948e8fe47b487e17a8dd438f3a9857d571a.tar.gz ingen-034c8948e8fe47b487e17a8dd438f3a9857d571a.tar.bz2 ingen-034c8948e8fe47b487e17a8dd438f3a9857d571a.zip |
Use URI defines where possible.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4244 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | ingen/Plugin.hpp | 4 | ||||
-rw-r--r-- | src/client/NodeModel.cpp | 2 | ||||
-rw-r--r-- | src/client/PluginModel.cpp | 5 | ||||
-rw-r--r-- | src/client/PluginUI.cpp | 2 | ||||
-rw-r--r-- | src/gui/NodeMenu.cpp | 22 | ||||
-rw-r--r-- | src/gui/RenameWindow.cpp | 2 | ||||
-rw-r--r-- | src/serialisation/Parser.cpp | 2 | ||||
-rw-r--r-- | src/serialisation/Serialiser.cpp | 6 | ||||
-rw-r--r-- | src/server/PortType.hpp | 11 | ||||
-rw-r--r-- | src/server/ingen_lv2.cpp | 2 |
10 files changed, 32 insertions, 26 deletions
diff --git a/ingen/Plugin.hpp b/ingen/Plugin.hpp index ceb190ca..34825c0e 100644 --- a/ingen/Plugin.hpp +++ b/ingen/Plugin.hpp @@ -21,6 +21,8 @@ #include "ingen/Resource.hpp" +#include "lv2/lv2plug.in/ns/lv2core/lv2.h" + namespace Ingen { class Plugin : virtual public Resource @@ -33,7 +35,7 @@ public: static inline const Raul::URI& type_uri(Type type) { static const Raul::URI uris[] = { "http://drobilla.net/ns/ingen#nil", - "http://lv2plug.in/ns/lv2core#Plugin", + LV2_CORE__Plugin, "http://drobilla.net/ns/ingen#Internal", "http://drobilla.net/ns/ingen#Patch" }; diff --git a/src/client/NodeModel.cpp b/src/client/NodeModel.cpp index fc7873f0..d1d1108d 100644 --- a/src/client/NodeModel.cpp +++ b/src/client/NodeModel.cpp @@ -221,7 +221,7 @@ NodeModel::port_value_range(SharedPtr<const PortModel> port, std::string NodeModel::port_label(SharedPtr<const PortModel> port) const { - const Raul::Atom& name = port->get_property("http://lv2plug.in/ns/lv2core#name"); + const Raul::Atom& name = port->get_property(LV2_CORE__name); if (name.is_valid()) { return name.get_string(); } diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp index 35c6649a..4381d979 100644 --- a/src/client/PluginModel.cpp +++ b/src/client/PluginModel.cpp @@ -94,8 +94,7 @@ PluginModel::get_property(const URI& key) const else symbol = uri.str().substr(first_delim + 1, last_delim - first_delim - 1); } - set_property("http://lv2plug.in/ns/lv2core#symbol", - _uris.forge.alloc(symbol)); + set_property(LV2_CORE__symbol, _uris.forge.alloc(symbol)); return get_property(key); } @@ -152,7 +151,7 @@ PluginModel::set(SharedPtr<PluginModel> p) Symbol PluginModel::default_node_symbol() const { - const Atom& name_atom = get_property("http://lv2plug.in/ns/lv2core#symbol"); + const Atom& name_atom = get_property(LV2_CORE__symbol); if (name_atom.is_valid() && name_atom.type() == _uris.forge.String) return Symbol::symbolify(name_atom.get_string()); else diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp index ac54b2f5..a58bdabe 100644 --- a/src/client/PluginUI.cpp +++ b/src/client/PluginUI.cpp @@ -100,7 +100,7 @@ PluginUI::create(Ingen::Shared::World* world, PluginUI::ui_host = suil_host_new(lv2_ui_write, NULL, NULL, NULL); } - static const char* gtk_ui_uri = "http://lv2plug.in/ns/extensions/ui#GtkUI"; + static const char* gtk_ui_uri = LV2_UI__GtkUI; LilvNode* gtk_ui = lilv_new_uri(world->lilv_world(), gtk_ui_uri); diff --git a/src/gui/NodeMenu.cpp b/src/gui/NodeMenu.cpp index 25986038..b9b6467c 100644 --- a/src/gui/NodeMenu.cpp +++ b/src/gui/NodeMenu.cpp @@ -15,14 +15,17 @@ */ #include <gtkmm.h> + #include "ingen/Interface.hpp" -#include "ingen/shared/LV2URIMap.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" #include "NodeMenu.hpp" -#include "WindowFactory.hpp" #include "WidgetFactory.hpp" +#include "WindowFactory.hpp" using namespace std; using namespace Ingen::Client; @@ -165,15 +168,12 @@ NodeMenu::on_preset_activated(const std::string& uri) const NodeModel* const node = (NodeModel*)_object.get(); const PluginModel* const plugin = dynamic_cast<const PluginModel*>(node->plugin()); - LilvNode* port_pred = lilv_new_uri( - plugin->lilv_world(), - "http://lv2plug.in/ns/lv2core#port"); - LilvNode* symbol_pred = lilv_new_uri( - plugin->lilv_world(), - "http://lv2plug.in/ns/lv2core#symbol"); - LilvNode* value_pred = lilv_new_uri( - plugin->lilv_world(), - "http://lv2plug.in/ns/ext/presets#value"); + LilvNode* port_pred = lilv_new_uri(plugin->lilv_world(), + LV2_CORE__port); + LilvNode* symbol_pred = lilv_new_uri(plugin->lilv_world(), + LV2_CORE__symbol); + LilvNode* value_pred = lilv_new_uri(plugin->lilv_world(), + LV2_PRESETS__value); LilvNode* subject = lilv_new_uri(plugin->lilv_world(), uri.c_str()); LilvNodes* ports = lilv_world_find_nodes( plugin->lilv_world(), diff --git a/src/gui/RenameWindow.cpp b/src/gui/RenameWindow.cpp index cdeb33ac..ffda6dd4 100644 --- a/src/gui/RenameWindow.cpp +++ b/src/gui/RenameWindow.cpp @@ -62,7 +62,7 @@ RenameWindow::set_object(SharedPtr<const ObjectModel> object) { _object = object; _symbol_entry->set_text(object->path().symbol()); - const Atom& name_atom = object->get_property("http://lv2plug.in/ns/lv2core#name"); + const Atom& name_atom = object->get_property(LV2_CORE__name); _label_entry->set_text( (name_atom.type() == _app->forge().String) ? name_atom.get_string() : ""); } diff --git a/src/serialisation/Parser.cpp b/src/serialisation/Parser.cpp index c2e8be4d..838a0200 100644 --- a/src/serialisation/Parser.cpp +++ b/src/serialisation/Parser.cpp @@ -90,7 +90,7 @@ skip_property(const Sord::Node& predicate) { return (predicate.to_string() == "http://drobilla.net/ns/ingen#node" || predicate.to_string() == "http://drobilla.net/ns/ingen#edge" - || predicate.to_string() == "http://lv2plug.in/ns/lv2core#port"); + || predicate.to_string() == LV2_CORE__port); } static Resource::Properties diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp index f0062860..c26be7be 100644 --- a/src/serialisation/Serialiser.cpp +++ b/src/serialisation/Serialiser.cpp @@ -40,6 +40,8 @@ #include "ingen/shared/Store.hpp" #include "ingen/shared/URIs.hpp" #include "ingen/shared/World.hpp" +#include "lv2/lv2plug.in/ns/ext/state/state.h" +#include "lv2/lv2plug.in/ns/extensions/ui/ui.h" #include "raul/Atom.hpp" #include "raul/Path.hpp" #include "raul/log.hpp" @@ -342,10 +344,10 @@ Serialiser::Impl::serialise_patch(SharedPtr<const Patch> patch, _model->add_statement(patch_id, Sord::Curie(world, "lv2:extensionData"), - Sord::URI(world, "http://lv2plug.in/ns/ext/state#Interface")); + Sord::URI(world, LV2_STATE__interface)); _model->add_statement(patch_id, - Sord::URI(world, "http://lv2plug.in/ns/extensions/ui#ui"), + Sord::URI(world, LV2_UI__ui), Sord::URI(world, "http://drobilla.net/ns/ingen#ui")); const URIs& uris = *_world.uris().get(); diff --git a/src/server/PortType.hpp b/src/server/PortType.hpp index 41b6f636..14cb721a 100644 --- a/src/server/PortType.hpp +++ b/src/server/PortType.hpp @@ -19,6 +19,9 @@ #include "raul/URI.hpp" +#include "lv2/lv2plug.in/ns/ext/atom/atom.h" +#include "lv2/lv2plug.in/ns/lv2core/lv2.h" + namespace Ingen { /** The type of a port. @@ -74,10 +77,10 @@ private: assert(symbol_num <= ATOM); static const Raul::URI uris[] = { "http://drobilla.net/ns/ingen#nil", - "http://lv2plug.in/ns/lv2core#AudioPort", - "http://lv2plug.in/ns/lv2core#ControlPort", - "http://lv2plug.in/ns/lv2core#CVPort", - "http://lv2plug.in/ns/ext/atom#AtomPort" + LV2_CORE__AudioPort, + LV2_CORE__ControlPort, + LV2_CORE__CVPort, + LV2_ATOM__AtomPort }; return uris[symbol_num]; } diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp index 70a1482f..a8466dda 100644 --- a/src/server/ingen_lv2.cpp +++ b/src/server/ingen_lv2.cpp @@ -545,7 +545,7 @@ ingen_save(LV2_Handle instance, LV2_URID ingen_file = plugin->map->map(plugin->map->handle, NS_INGEN "file"); LV2_URID atom_Path = plugin->map->map(plugin->map->handle, - "http://lv2plug.in/ns/ext/atom#Path"); + LV2_ATOM__Path); char* real_path = make_path->path(make_path->handle, "patch.ttl"); char* state_path = map_path->abstract_path(map_path->handle, real_path); |