From a645d2b8be4d7d31f6eef1649156b166a01e0c31 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 2 Feb 2010 20:37:50 +0000 Subject: 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 --- src/client/PluginUI.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/client/PluginUI.cpp') diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp index 4c8016fd..0df3b060 100644 --- a/src/client/PluginUI.cpp +++ b/src/client/PluginUI.cpp @@ -55,8 +55,7 @@ lv2_ui_write(LV2UI_Controller controller, SharedPtr port = ui->node()->ports()[port_index]; - SharedPtr map = PtrCast( - ui->world()->lv2_features->feature(LV2_URI_MAP_URI)); + SharedPtr map = ui->world()->uris; // float (special case, always 0) if (format == 0) { @@ -64,18 +63,18 @@ lv2_ui_write(LV2UI_Controller controller, if (*(float*)buffer == port->value().get_float()) return; // do nothing (handle stupid plugin UIs that feed back) - ui->world()->engine->set_property(port->path(), "ingen:value", Atom(*(float*)buffer)); + ui->world()->engine->set_property(port->path(), map->ingen_value, Atom(*(float*)buffer)); - } else if (format == map->ui_format_events) { + } else if (format == map->ui_format_events.id) { LV2_Event_Buffer* buf = (LV2_Event_Buffer*)buffer; LV2_Event_Iterator iter; uint8_t* data; lv2_event_begin(&iter, buf); while (lv2_event_is_valid(&iter)) { LV2_Event* const ev = lv2_event_get(&iter, &data); - if (ev->type == map->midi_event) { + if (ev->type == map->midi_event.id) { // FIXME: bundle multiple events by writing an entire buffer here - ui->world()->engine->set_property(port->path(), "ingen:value", + ui->world()->engine->set_property(port->path(), map->ingen_value, Atom("lv2midi:MidiEvent", ev->size, data)); } else { warn << "Unable to send event type " << ev->type << @@ -85,11 +84,11 @@ lv2_ui_write(LV2UI_Controller controller, lv2_event_increment(&iter); } - } else if (format == map->object_transfer) { + } else if (format == map->object_transfer.id) { LV2_Object* buf = (LV2_Object*)buffer; Raul::Atom val; Shared::LV2Object::to_atom(ui->world(), buf, val); - ui->world()->engine->set_property(port->path(), "ingen:value", val); + ui->world()->engine->set_property(port->path(), map->ingen_value, val); } else { warn << "Unknown value format " << format -- cgit v1.2.1