summaryrefslogtreecommitdiffstats
path: root/src/libs/client
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-09-15 04:15:03 +0000
committerDavid Robillard <d@drobilla.net>2008-09-15 04:15:03 +0000
commitfccfce4b1e9c9f80b38d20dd8f0e90fe83a93068 (patch)
treea2c81600ac907662f84912fa5375bfd14450811c /src/libs/client
parent966b1446fcc3fc5a4cdda778c259bb24ed59539a (diff)
downloadingen-fccfce4b1e9c9f80b38d20dd8f0e90fe83a93068.tar.gz
ingen-fccfce4b1e9c9f80b38d20dd8f0e90fe83a93068.tar.bz2
ingen-fccfce4b1e9c9f80b38d20dd8f0e90fe83a93068.zip
Make view togglable between symbols and human names (just LV2 plugins for now).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1502 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client')
-rw-r--r--src/libs/client/PluginModel.cpp33
-rw-r--r--src/libs/client/PluginModel.hpp4
2 files changed, 35 insertions, 2 deletions
diff --git a/src/libs/client/PluginModel.cpp b/src/libs/client/PluginModel.cpp
index 6246a69e..32d9fd69 100644
--- a/src/libs/client/PluginModel.cpp
+++ b/src/libs/client/PluginModel.cpp
@@ -36,12 +36,43 @@ Redland::World* PluginModel::_rdf_world = NULL;
string
-PluginModel::default_node_name()
+PluginModel::default_node_symbol()
{
return Raul::Path::nameify(_symbol);
}
+string
+PluginModel::human_name()
+{
+#ifdef HAVE_SLV2
+ if (_slv2_plugin) {
+ SLV2Value name = slv2_plugin_get_name(_slv2_plugin);
+ string ret = slv2_value_as_string(name);
+ slv2_value_free(name);
+ return ret;
+ }
+#endif
+ return default_node_symbol();
+}
+
+
+string
+PluginModel::port_human_name(uint32_t index)
+{
+#ifdef HAVE_SLV2
+ if (_slv2_plugin) {
+ SLV2Port port = slv2_port(index);
+ SLV2Value name = slv2_port_get_name(_slv2_plugin, port);
+ string ret = slv2_value_as_string(name);
+ slv2_value_free(name);
+ return ret;
+ }
+#endif
+ return "";
+}
+
+
#ifdef HAVE_SLV2
bool
PluginModel::has_ui() const
diff --git a/src/libs/client/PluginModel.hpp b/src/libs/client/PluginModel.hpp
index f8630e94..e2137e19 100644
--- a/src/libs/client/PluginModel.hpp
+++ b/src/libs/client/PluginModel.hpp
@@ -83,7 +83,9 @@ public:
}
}
- string default_node_name();
+ string default_node_symbol();
+ string human_name();
+ string port_human_name(uint32_t index);
#ifdef HAVE_SLV2
static SLV2World slv2_world() { return _slv2_world; }