Browse Source

add options and functionality to jack_lsp

git-svn-id: svn+ssh://jackaudio.org/trunk/jack@282 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.109.0
pbd 23 years ago
parent
commit
d2ebadeed6
2 changed files with 44 additions and 6 deletions
  1. +1
    -1
      configure.in
  2. +43
    -5
      example-clients/lsp.c

+ 1
- 1
configure.in View File

@@ -13,7 +13,7 @@ dnl micro version = incremented when implementation-only
dnl changes are made
dnl ---
JACK_MAJOR_VERSION=0
JACK_MINOR_VERSION=41
JACK_MINOR_VERSION=42
JACK_MICRO_VERSION=2

dnl ---


+ 43
- 5
example-clients/lsp.c View File

@@ -2,6 +2,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <getopt.h>

#include <jack/jack.h>

@@ -13,13 +14,28 @@ main (int argc, char *argv[])
unsigned int i, j;
int show_con = 0;
int show_latency = 0;
int show_properties = 0;
int c;
int option_index;

for (i = 1; i < argc; i++) {
if (!strcmp(argv[i], "-c")) {
struct option long_options[] = {
{ "connections", 0, 0, 'c' },
{ "latency", 0, 0, 'l' },
{ "properties", 0, 0, 'p' },
{ 0, 0, 0, 0 }
};

while ((c = getopt_long (argc, argv, "clp", long_options, &option_index)) >= 0) {
switch (c) {
case 'c':
show_con = 1;
}
if (!strcmp(argv[i], "-l")) {
break;
case 'l':
show_latency = 1;
break;
case 'p':
show_properties = 1;
break;
}
}

@@ -49,8 +65,30 @@ main (int argc, char *argv[])
free (port);
}
}
if (show_properties) {
jack_port_t *port = jack_port_by_name (client, ports[i]);
if (port) {
int flags = jack_port_flags (port);
printf (" properties: ");
if (flags & JackPortIsInput) {
fputs ("input,", stdout);
}
if (flags & JackPortIsOutput) {
fputs ("output,", stdout);
}
if (flags & JackPortCanMonitor) {
fputs ("can-monitor,", stdout);
}
if (flags & JackPortIsPhysical) {
fputs ("physical,", stdout);
}
if (flags & JackPortIsTerminal) {
fputs ("terminal,", stdout);
}
putc ('\n', stdout);
}
}
}
jack_client_close (client);
exit (0);
}

Loading…
Cancel
Save