summaryrefslogtreecommitdiffstats
path: root/src/libs/client/PluginModel.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-10-22 19:43:31 +0000
committerDavid Robillard <d@drobilla.net>2007-10-22 19:43:31 +0000
commitb03655afdbcc901755492eae07bef92d9c65be8c (patch)
tree20496484634d0bb426420d0fc1112ed28b8146c1 /src/libs/client/PluginModel.cpp
parente9d99340c9ac29aaa7912db0554a88820c4a776a (diff)
downloadingen-b03655afdbcc901755492eae07bef92d9c65be8c.tar.gz
ingen-b03655afdbcc901755492eae07bef92d9c65be8c.tar.bz2
ingen-b03655afdbcc901755492eae07bef92d9c65be8c.zip
LV2 icons in plugin menu.
git-svn-id: http://svn.drobilla.net/lad/ingen@899 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client/PluginModel.cpp')
-rw-r--r--src/libs/client/PluginModel.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/libs/client/PluginModel.cpp b/src/libs/client/PluginModel.cpp
index 8a9ecc7d..0e6c06b3 100644
--- a/src/libs/client/PluginModel.cpp
+++ b/src/libs/client/PluginModel.cpp
@@ -166,6 +166,34 @@ PluginModel::ui(EngineInterface* engine, NodeModel* node) const
return ret;
}
+
+const string&
+PluginModel::icon_path() const
+{
+ if (_icon_path == "" && _type == LV2)
+ _icon_path = get_lv2_icon_path(_slv2_plugin);
+
+ return _icon_path;
+}
+
+
+string
+PluginModel::get_lv2_icon_path(SLV2Plugin plugin)
+{
+ string result;
+ SLV2Values paths = slv2_plugin_get_value(plugin, SLV2_URI,
+ "http://ll-plugins.nongnu.org/lv2/namespace#svgIcon");
+
+ if (slv2_values_size(paths) > 0) {
+ SLV2Value value = slv2_values_get_at(paths, 0);
+ if (slv2_value_is_uri(value))
+ result = slv2_uri_to_path(slv2_value_as_string(value));
+ slv2_values_free(paths);
+ }
+
+ return result;
+}
+
#endif
} // namespace Client