diff options
author | David Robillard <d@drobilla.net> | 2010-02-02 20:37:50 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-02-02 20:37:50 +0000 |
commit | a645d2b8be4d7d31f6eef1649156b166a01e0c31 (patch) | |
tree | 3d83c08e9a5460cc6582482bcfc673dff956a1e7 /src/gui/PortMenu.cpp | |
parent | 653679e967f11a0e008521885fcaf6994d2961fa (diff) | |
download | ingen-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/gui/PortMenu.cpp')
-rw-r--r-- | src/gui/PortMenu.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/gui/PortMenu.cpp b/src/gui/PortMenu.cpp index ffa3422f..d52500bc 100644 --- a/src/gui/PortMenu.cpp +++ b/src/gui/PortMenu.cpp @@ -18,6 +18,7 @@ #include <gtkmm.h> #include "raul/SharedPtr.hpp" #include "interface/EngineInterface.hpp" +#include "shared/LV2URIMap.hpp" #include "client/PatchModel.hpp" #include "client/PortModel.hpp" #include "App.hpp" @@ -98,27 +99,29 @@ PortMenu::on_menu_disconnect() void PortMenu::on_menu_set_min() { + const LV2URIMap& uris = App::instance().uris(); SharedPtr<PortModel> model = PtrCast<PortModel>(_object); - const Raul::Atom& value = model->get_property("ingen:value"); - std::cout << model->path() << " SET MIN " << value << std::endl; + const Raul::Atom& value = model->get_property(uris.ingen_value); if (value.is_valid()) - App::instance().engine()->set_property(_object->path(), "lv2:minimum", value); + App::instance().engine()->set_property(_object->path(), uris.lv2_minimum, value); } void PortMenu::on_menu_set_max() { + const LV2URIMap& uris = App::instance().uris(); SharedPtr<PortModel> model = PtrCast<PortModel>(_object); - const Raul::Atom& value = model->get_property("ingen:value"); + const Raul::Atom& value = model->get_property(uris.ingen_value); if (value.is_valid()) - App::instance().engine()->set_property(_object->path(), "lv2:maximum", value); + App::instance().engine()->set_property(_object->path(), uris.lv2_maximum, value); } void PortMenu::on_menu_reset_range() { + const LV2URIMap& uris = App::instance().uris(); SharedPtr<PortModel> model = PtrCast<PortModel>(_object); SharedPtr<NodeModel> parent = PtrCast<NodeModel>(_object->parent()); @@ -126,10 +129,10 @@ PortMenu::on_menu_reset_range() parent->default_port_value_range(model, min, max); if (!isnan(min)) - App::instance().engine()->set_property(_object->path(), "lv2:minimum", min); + App::instance().engine()->set_property(_object->path(), uris.lv2_minimum, min); if (!isnan(max)) - App::instance().engine()->set_property(_object->path(), "lv2:maximum", max); + App::instance().engine()->set_property(_object->path(), uris.lv2_maximum, max); } |