diff options
author | David Robillard <d@drobilla.net> | 2007-10-22 19:43:31 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-10-22 19:43:31 +0000 |
commit | b03655afdbcc901755492eae07bef92d9c65be8c (patch) | |
tree | 20496484634d0bb426420d0fc1112ed28b8146c1 /src/libs/client | |
parent | e9d99340c9ac29aaa7912db0554a88820c4a776a (diff) | |
download | ingen-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')
-rw-r--r-- | src/libs/client/NodeModel.cpp | 2 | ||||
-rw-r--r-- | src/libs/client/PluginModel.cpp | 28 | ||||
-rw-r--r-- | src/libs/client/PluginModel.hpp | 4 |
3 files changed, 32 insertions, 2 deletions
diff --git a/src/libs/client/NodeModel.cpp b/src/libs/client/NodeModel.cpp index fff01aee..b429d356 100644 --- a/src/libs/client/NodeModel.cpp +++ b/src/libs/client/NodeModel.cpp @@ -176,8 +176,6 @@ NodeModel::port_value_range(SharedPtr<PortModel> port, float& min, float& max) min = min_atom.get_float(); if (max_atom.type() == Atom::FLOAT) max = max_atom.get_float(); - - cerr << port->path() << " VALUE RANGE: " << min << ", " << max << endl; } 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 diff --git a/src/libs/client/PluginModel.hpp b/src/libs/client/PluginModel.hpp index 56b33723..75cf70f5 100644 --- a/src/libs/client/PluginModel.hpp +++ b/src/libs/client/PluginModel.hpp @@ -90,6 +90,9 @@ public: } SLV2UIInstance ui(Ingen::Shared::EngineInterface* engine, NodeModel* node) const; + + const string& icon_path() const; + static string get_lv2_icon_path(SLV2Plugin plugin); #endif static void set_rdf_world(Raul::RDF::World& world) { @@ -109,6 +112,7 @@ private: static SLV2Plugins _slv2_plugins; SLV2Plugin _slv2_plugin; + mutable string _icon_path; #endif static Raul::RDF::World* _rdf_world; |