diff options
author | David Robillard <d@drobilla.net> | 2008-01-21 15:14:53 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-01-21 15:14:53 +0000 |
commit | 0bf92c1f25a854566212e42deafe72ecd2a5f1a1 (patch) | |
tree | 7933e54159426aee99a3c6493d9d4852da094baf /utils | |
parent | 42aa3c32cdd4c6a0cc1e3372d57ac99511b2f46d (diff) | |
download | lilv-0bf92c1f25a854566212e42deafe72ecd2a5f1a1.tar.gz lilv-0bf92c1f25a854566212e42deafe72ecd2a5f1a1.tar.bz2 lilv-0bf92c1f25a854566212e42deafe72ecd2a5f1a1.zip |
Work on generic LV2 events.
git-svn-id: http://svn.drobilla.net/lad/slv2@1090 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'utils')
-rw-r--r-- | utils/lv2_inspect.c | 44 |
1 files changed, 8 insertions, 36 deletions
diff --git a/utils/lv2_inspect.c b/utils/lv2_inspect.c index 55c6478..585678f 100644 --- a/utils/lv2_inspect.c +++ b/utils/lv2_inspect.c @@ -22,6 +22,8 @@ #include <string.h> #include <slv2/slv2.h> +SLV2Value event_class = NULL; +SLV2Value control_class = NULL; void print_port(SLV2Plugin p, uint32_t index) @@ -32,44 +34,14 @@ print_port(SLV2Plugin p, uint32_t index) printf("\n\tPort %d:\n", index); - SLV2PortDirection dir = slv2_port_get_direction(p, port); - - printf("\t\tDirection: "); - switch (dir) { - case SLV2_PORT_DIRECTION_INPUT: - printf("Input"); - break; - case SLV2_PORT_DIRECTION_OUTPUT: - printf("Output"); - break; - default: - printf("Unknown"); - } + SLV2Values classes = slv2_port_get_classes(p, port); - SLV2PortDataType type = slv2_port_get_data_type(p, port); - - printf("\n\t\tType: "); - switch (type) { - case SLV2_PORT_DATA_TYPE_CONTROL: - printf("Control"); - break; - case SLV2_PORT_DATA_TYPE_AUDIO: - printf("Audio"); - break; - case SLV2_PORT_DATA_TYPE_MIDI: - printf("MIDI"); - break; - case SLV2_PORT_DATA_TYPE_OSC: - printf("OSC"); - break; - case SLV2_PORT_DATA_TYPE_EVENT: - printf("Event"); - break; - default: - printf("Unknown"); + printf("\t\tClasses:\n"); + for (unsigned i=0; i < slv2_values_size(classes); ++i) { + printf("\t\t\t%s\n", slv2_value_as_uri(slv2_values_get_at(classes, i))); } - if (type == SLV2_PORT_DATA_TYPE_EVENT) { + if (slv2_port_is_a(p, port, event_class)) { SLV2Values supported = slv2_port_get_value(p, port, "lv2ev:supportsEvent"); if (slv2_values_size(supported) > 0) { @@ -89,7 +61,7 @@ print_port(SLV2Plugin p, uint32_t index) printf("\t\tName: %s\n", str); free(str); - if (type == SLV2_PORT_DATA_TYPE_CONTROL) { + if (slv2_port_is_a(p, port, control_class)) { printf("\t\tMinimum: %f\n", slv2_port_get_minimum_value(p, port)); printf("\t\tMaximum: %f\n", slv2_port_get_maximum_value(p, port)); printf("\t\tDefault: %f\n", slv2_port_get_default_value(p, port)); |