summaryrefslogtreecommitdiffstats
path: root/src/gui/PatchTreeWindow.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/gui/PatchTreeWindow.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/gui/PatchTreeWindow.cpp')
-rw-r--r--src/gui/PatchTreeWindow.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gui/PatchTreeWindow.cpp b/src/gui/PatchTreeWindow.cpp
index feb0606c..0ccc7344 100644
--- a/src/gui/PatchTreeWindow.cpp
+++ b/src/gui/PatchTreeWindow.cpp
@@ -18,6 +18,7 @@
#include "raul/log.hpp"
#include "raul/Path.hpp"
#include "interface/EngineInterface.hpp"
+#include "shared/LV2URIMap.hpp"
#include "client/ClientStore.hpp"
#include "client/PatchModel.hpp"
#include "App.hpp"
@@ -93,7 +94,7 @@ PatchTreeWindow::add_patch(SharedPtr<PatchModel> pm)
if (pm->path().is_root()) {
row[_patch_tree_columns.name_col] = App::instance().engine()->uri().str();
} else {
- row[_patch_tree_columns.name_col] = pm->path().name();
+ row[_patch_tree_columns.name_col] = pm->symbol().c_str();
}
row[_patch_tree_columns.enabled_col] = pm->enabled();
row[_patch_tree_columns.patch_model_col] = pm;
@@ -105,7 +106,7 @@ PatchTreeWindow::add_patch(SharedPtr<PatchModel> pm)
if (c != children.end()) {
Gtk::TreeModel::iterator iter = _patch_treestore->append(c->children());
Gtk::TreeModel::Row row = *iter;
- row[_patch_tree_columns.name_col] = pm->path().name();
+ row[_patch_tree_columns.name_col] = pm->symbol().c_str();
row[_patch_tree_columns.enabled_col] = pm->enabled();
row[_patch_tree_columns.patch_model_col] = pm;
_patches_treeview->expand_row(_patch_treestore->get_path(iter), true);
@@ -191,7 +192,8 @@ PatchTreeWindow::event_patch_enabled_toggled(const Glib::ustring& path_str)
assert(pm);
if (_enable_signal)
- App::instance().engine()->set_property(pm->path(), "ingen:enabled", (bool)!pm->enabled());
+ App::instance().engine()->set_property(pm->path(),
+ App::instance().uris().ingen_enabled, (bool)!pm->enabled());
}
@@ -199,8 +201,9 @@ void
PatchTreeWindow::patch_property_changed(const URI& key, const Atom& value,
SharedPtr<PatchModel> patch)
{
+ const LV2URIMap& uris = App::instance().uris();
_enable_signal = false;
- if (key.str() == "ingen:enabled" && value.type() == Atom::BOOL) {
+ if (key == uris.ingen_enabled && value.type() == Atom::BOOL) {
Gtk::TreeModel::iterator i = find_patch(_patch_treestore->children(), patch);
if (i != _patch_treestore->children().end()) {
Gtk::TreeModel::Row row = *i;
@@ -223,7 +226,7 @@ PatchTreeWindow::patch_moved(SharedPtr<PatchModel> patch)
if (i != _patch_treestore->children().end()) {
Gtk::TreeModel::Row row = *i;
- row[_patch_tree_columns.name_col] = patch->path().name();
+ row[_patch_tree_columns.name_col] = patch->symbol().c_str();
} else {
LOG(error) << "Unable to find patch " << patch->path() << endl;
}