continue;
}
+ const std::string param_docs = plugin->get_parameter_docs(i);
+ if (param_docs != "") {
+ ARDOUR_UI::instance()->set_tip(cui, param_docs.c_str());
+ }
+
if (cui->controller || cui->clickbox || cui->combo) {
// Get all of the controls into a list, so that
// we can lay them out a bit more nicely later.
const char* name () const;
const char* maker () const;
- uint32_t num_ports () const;
- uint32_t parameter_count () const;
- float default_value (uint32_t port);
- framecnt_t signal_latency () const;
- void set_parameter (uint32_t port, float val);
- float get_parameter (uint32_t port) const;
- int get_parameter_descriptor (uint32_t which, ParameterDescriptor&) const;
- uint32_t nth_parameter (uint32_t port, bool& ok) const;
+ uint32_t num_ports () const;
+ uint32_t parameter_count () const;
+ float default_value (uint32_t port);
+ framecnt_t signal_latency () const;
+ void set_parameter (uint32_t port, float val);
+ float get_parameter (uint32_t port) const;
+ std::string get_parameter_docs(uint32_t which) const;
+ int get_parameter_descriptor (uint32_t which, ParameterDescriptor&) const;
+ uint32_t nth_parameter (uint32_t port, bool& ok) const;
const void* extension_data (const char* uri) const;
virtual uint32_t parameter_count () const = 0;
virtual float default_value (uint32_t port) = 0;
virtual float get_parameter(uint32_t which) const = 0;
+ virtual std::string get_parameter_docs(uint32_t which) const { return ""; }
virtual int get_parameter_descriptor (uint32_t which, ParameterDescriptor&) const = 0;
virtual uint32_t nth_parameter (uint32_t which, bool& ok) const = 0;
LilvNode* lv2_sampleRate;
LilvNode* lv2_toggled;
LilvNode* midi_MidiEvent;
+ LilvNode* rdfs_comment;
LilvNode* ui_GtkUI;
LilvNode* ui_external;
};
return 0.0f;
}
+std::string
+LV2Plugin::get_parameter_docs(uint32_t which) const
+{
+ LilvNodes* comments = lilv_port_get_value(
+ _impl->plugin,
+ lilv_plugin_get_port_by_index(_impl->plugin, which),
+ _world.rdfs_comment);
+
+ if (comments) {
+ const std::string docs(lilv_node_as_string(lilv_nodes_get_first(comments)));
+ lilv_nodes_free(comments);
+ return docs;
+ }
+
+ return "";
+}
+
uint32_t
LV2Plugin::nth_parameter(uint32_t n, bool& ok) const
{
lv2_toggled = lilv_new_uri(world, LILV_NS_LV2 "toggled");
lv2_enumeration = lilv_new_uri(world, LILV_NS_LV2 "enumeration");
midi_MidiEvent = lilv_new_uri(world, LILV_URI_MIDI_EVENT);
+ rdfs_comment = lilv_new_uri(world, LILV_NS_RDFS "comment");
ui_GtkUI = lilv_new_uri(world, NS_UI "GtkUI");
ui_external = lilv_new_uri(world, NS_UI "external");
}