summaryrefslogtreecommitdiffstats
path: root/src/engine/LADSPAPlugin.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-02-02 20:37:50 +0000
committerDavid Robillard <d@drobilla.net>2010-02-02 20:37:50 +0000
commita645d2b8be4d7d31f6eef1649156b166a01e0c31 (patch)
tree3d83c08e9a5460cc6582482bcfc673dff956a1e7 /src/engine/LADSPAPlugin.cpp
parent653679e967f11a0e008521885fcaf6994d2961fa (diff)
downloadingen-a645d2b8be4d7d31f6eef1649156b166a01e0c31.tar.gz
ingen-a645d2b8be4d7d31f6eef1649156b166a01e0c31.tar.bz2
ingen-a645d2b8be4d7d31f6eef1649156b166a01e0c31.zip
Use Glib string interning (quarks) to make Path/URI operator== very fast.
This avoids a ton of string comparison overhead in Ingen when setting various properties (e.g. "ingen:value" was compared several times every time a port value was changed, now this is just a single pointer comparison and the full round trip of a value change does no string comparison at all, but is still property based and RDFey). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2408 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/LADSPAPlugin.cpp')
-rw-r--r--src/engine/LADSPAPlugin.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/engine/LADSPAPlugin.cpp b/src/engine/LADSPAPlugin.cpp
index 1f316849..e1fdff40 100644
--- a/src/engine/LADSPAPlugin.cpp
+++ b/src/engine/LADSPAPlugin.cpp
@@ -18,6 +18,8 @@
#include <cassert>
#include <ladspa.h>
#include <raul/Symbol.hpp>
+#include "module/ingen_module.hpp"
+#include "shared/LV2URIMap.hpp"
#include "LADSPAPlugin.hpp"
#include "LADSPANode.hpp"
#include "Engine.hpp"
@@ -38,18 +40,19 @@ LADSPAPlugin::LADSPAPlugin(
: PluginImpl(Plugin::LADSPA, uri, library_path)
, _id(id)
, _label(label)
- , _name(Raul::Atom::STRING, name)
+ , _name(name)
{
- set_property("rdf:type", Atom(Atom::URI, "ingen:LADSPAPlugin"));
- set_property("lv2:symbol", Atom(Atom::STRING, Symbol::symbolify(label)));
- set_property("doap:name", Atom(Atom::STRING, name));
+ const LV2URIMap& uris = *ingen_get_world()->uris;
+ set_property(uris.rdf_type, uris.ingen_LADSPAPlugin);
+ set_property(uris.lv2_symbol, Symbol::symbolify(label));
+ set_property(uris.doap_name, name);
}
const Raul::Atom&
LADSPAPlugin::get_property(const Raul::URI& uri) const
{
- if (uri.str() == "doap:name")
+ if (uri == ingen_get_world()->uris->doap_name)
return _name;
else
return ResourceImpl::get_property(uri);