summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-07-23 06:03:39 +0000
committerDavid Robillard <d@drobilla.net>2007-07-23 06:03:39 +0000
commit043e683a796e1338a8874b0e7c195292ff32b7de (patch)
treed580453b0d91ec7bdf304714ce52e9749a73db1d /utils
parent64b48129d10118a9fbf11aec46fa557b5d302f31 (diff)
downloadlilv-043e683a796e1338a8874b0e7c195292ff32b7de.tar.gz
lilv-043e683a796e1338a8874b0e7c195292ff32b7de.tar.bz2
lilv-043e683a796e1338a8874b0e7c195292ff32b7de.zip
Broke API to separate input/output from type (less code repetition and SLV2 is more useful with unknown extended port types this way).
Switched enum symbol naming scheme to be more typical and future proof. Added LV2 OSC support. git-svn-id: http://svn.drobilla.net/lad/slv2@600 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'utils')
-rw-r--r--utils/lv2_inspect.c49
1 files changed, 27 insertions, 22 deletions
diff --git a/utils/lv2_inspect.c b/utils/lv2_inspect.c
index a3b1b5d..d96a193 100644
--- a/utils/lv2_inspect.c
+++ b/utils/lv2_inspect.c
@@ -27,47 +27,52 @@ print_port(SLV2Plugin p, uint32_t index)
SLV2Port port = slv2_plugin_get_port_by_index(p, index);
char* str = NULL;
- SLV2PortClass cl = SLV2_UNKNOWN_PORT_CLASS;
printf("\n\tPort %d:\n", index);
- cl = slv2_port_get_class(p, port);
- printf("\t\tClass: ");
- switch (cl) {
- case SLV2_CONTROL_INPUT:
- printf("Control input");
+ SLV2PortDirection dir = slv2_port_get_direction(p, port);
+
+ printf("\t\tDirection: ");
+ switch (dir) {
+ case SLV2_PORT_DIRECTION_INPUT:
+ printf("Input");
break;
- case SLV2_CONTROL_OUTPUT:
- printf("Control output");
+ case SLV2_PORT_DIRECTION_OUTPUT:
+ printf("Output");
break;
- case SLV2_AUDIO_INPUT:
- printf("Audio input");
+ default:
+ printf("Unknown");
+ }
+
+ SLV2PortType type = slv2_port_get_type(p, port);
+
+ printf("\n\t\tType: ");
+ switch (type) {
+ case SLV2_PORT_TYPE_CONTROL:
+ printf("Control");
break;
- case SLV2_AUDIO_OUTPUT:
- printf("Audio output");
+ case SLV2_PORT_TYPE_AUDIO:
+ printf("Audio");
break;
- case SLV2_MIDI_INPUT:
- printf("MIDI input");
+ case SLV2_PORT_TYPE_MIDI:
+ printf("MIDI");
break;
- case SLV2_MIDI_OUTPUT:
- printf("MIDI output");
+ case SLV2_PORT_TYPE_OSC:
+ printf("OSC");
break;
- case SLV2_UNKNOWN_PORT_CLASS:
+ default:
printf("Unknown");
- break;
}
- printf("\n");
str = slv2_port_get_symbol(p, port);
- printf("\t\tSymbol: %s\n", str);
+ printf("\n\t\tSymbol: %s\n", str);
free(str);
str = slv2_port_get_name(p, port);
printf("\t\tName: %s\n", str);
free(str);
- if (cl == SLV2_CONTROL_INPUT ||
- cl == SLV2_CONTROL_OUTPUT) {
+ if (type == SLV2_PORT_TYPE_CONTROL) {
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));