summaryrefslogtreecommitdiffstats
path: root/src/engine/Engine.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/Engine.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/Engine.cpp')
-rw-r--r--src/engine/Engine.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/engine/Engine.cpp b/src/engine/Engine.cpp
index 437389d3..26febf3b 100644
--- a/src/engine/Engine.cpp
+++ b/src/engine/Engine.cpp
@@ -65,10 +65,8 @@ Engine::Engine(Ingen::Shared::World* world)
, _broadcaster(new ClientBroadcaster())
, _node_factory(new NodeFactory(world))
, _message_context(new MessageContext(*this))
- , _buffer_factory(new BufferFactory(*this, PtrCast<LV2URIMap>(
- world->lv2_features->feature(LV2_URI_MAP_URI))))
- , _control_bindings(new ControlBindings(*this, PtrCast<LV2URIMap>(
- world->lv2_features->feature(LV2_URI_MAP_URI))))
+ , _buffer_factory(new BufferFactory(*this, world->uris))
+ , _control_bindings(new ControlBindings(*this, world->uris))
, _quit_flag(false)
, _activated(false)
{
@@ -165,14 +163,16 @@ Engine::activate()
for (EventSources::iterator i = _event_sources.begin(); i != _event_sources.end(); ++i)
(*i)->activate_source();
+ const LV2URIMap& uris = *world()->uris;
+
// Create root patch
PatchImpl* root_patch = _driver->root_patch();
if (!root_patch) {
- root_patch = new PatchImpl(*this, "", 1, NULL,
+ root_patch = new PatchImpl(*this, "root", 1, NULL,
_driver->sample_rate(), _driver->buffer_size(), 1);
- root_patch->meta().set_property("rdf:type", Raul::Atom(Raul::Atom::URI, "ingen:Patch"));
- root_patch->meta().set_property("ingen:polyphony", Raul::Atom(int32_t(1)));
- root_patch->set_property("rdf:type", Raul::Atom(Raul::Atom::URI, "ingen:Node"));
+ root_patch->meta().set_property(uris.rdf_type, Raul::Atom(Raul::Atom::URI, "ingen:Patch"));
+ root_patch->meta().set_property(uris.ingen_polyphony, Raul::Atom(int32_t(1)));
+ root_patch->set_property(uris.rdf_type, Raul::Atom(Raul::Atom::URI, "ingen:Node"));
root_patch->activate();
_world->store->add(root_patch);
root_patch->compiled_patch(root_patch->compile());
@@ -180,7 +180,7 @@ Engine::activate()
// Add control port
Shared::Resource::Properties properties;
- properties.insert(make_pair("lv2:name", "Control"));
+ properties.insert(make_pair(uris.lv2_name, "Control"));
Events::CreatePort* ev = new Events::CreatePort(*this, SharedPtr<Responder>(), 0,
"/ingen_control", "lv2ev:EventPort", false, NULL, properties);
ev->pre_process();