aboutsummaryrefslogtreecommitdiffstats
path: root/src/jalv_gtk.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-11-01 02:39:29 +0000
committerDavid Robillard <d@drobilla.net>2013-11-01 02:39:29 +0000
commit6f24e3c12694a2ec697be35b16b47c0dbe47d507 (patch)
tree0a9984e5c8c8b4c930ff7e907abdd2629de3987b /src/jalv_gtk.c
parentc6c9c32f922a86c4b4816cefbda0805774f0d1a6 (diff)
downloadjalv-6f24e3c12694a2ec697be35b16b47c0dbe47d507.tar.gz
jalv-6f24e3c12694a2ec697be35b16b47c0dbe47d507.tar.bz2
jalv-6f24e3c12694a2ec697be35b16b47c0dbe47d507.zip
Hide controls for ports with notOnGUI property in generic UI.
Based on #936. git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@5165 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/jalv_gtk.c')
-rw-r--r--src/jalv_gtk.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/jalv_gtk.c b/src/jalv_gtk.c
index 1698f32..29df231 100644
--- a/src/jalv_gtk.c
+++ b/src/jalv_gtk.c
@@ -87,6 +87,8 @@ jalv_init(int* argc, char*** argv, JalvOptions* opts)
"Load state from save directory", "DIR" },
{ "dump", 'd', 0, G_OPTION_ARG_NONE, &opts->dump,
"Dump plugin <=> UI communication", NULL },
+ { "show-hidden", 's', 0, G_OPTION_ARG_NONE, &opts->show_hidden,
+ "Show controls for ports with notOnGUI property on generic UI", NULL },
{ "generic-ui", 'g', 0, G_OPTION_ARG_NONE, &opts->generic_ui,
"Use Jalv generic UI and not the plugin UI", NULL},
{ "buffer-size", 'b', 0, G_OPTION_ARG_INT, &opts->buffer_size,
@@ -608,6 +610,7 @@ build_control_widget(Jalv* jalv, GtkWidget* window)
LilvNode* lv2_toggled = lilv_new_uri(world, LV2_CORE__toggled);
LilvNode* patch_writable = lilv_new_uri(world, LV2_PATCH__writable);
LilvNode* rdfs_comment = lilv_new_uri(world, LILV_NS_RDFS "comment");
+ LilvNode* pprop_notOnGUI = lilv_new_uri(world, LV2_PORT_PROPS__notOnGUI);
GtkWidget* port_table = gtk_table_new(jalv->num_ports, 3, false);
/* Get the min and max of all ports (or NaN if unavailable) */
@@ -629,6 +632,12 @@ build_control_widget(Jalv* jalv, GtkWidget* window)
int n_rows = 0;
for (unsigned i = 0; i < control_ports->len; ++i) {
const LilvPort* port = g_array_index(control_ports, LilvPort*, i);
+
+ if (!jalv->opts.show_hidden &&
+ lilv_port_has_property(plugin, port, pprop_notOnGUI)) {
+ continue;
+ }
+
uint32_t index = lilv_port_get_index(plugin, port);
LilvNode* name = lilv_port_get_name(plugin, port);
@@ -729,6 +738,7 @@ build_control_widget(Jalv* jalv, GtkWidget* window)
lilv_node_free(lv2_sampleRate);
lilv_node_free(lv2_integer);
lilv_node_free(lv2_enumeration);
+ lilv_node_free(pprop_notOnGUI);
lilv_node_free(logarithmic);
if (n_rows > 0) {