16 fprintf (stderr
, "%s: JACK Audio Connection Kit version " VERSION
"\n",
24 fprintf (stderr
, "\nUsage: %s [options] portname alias\n", my_name
);
25 fprintf (stderr
, "List active Jack ports, and optionally display extra information.\n\n");
26 fprintf (stderr
, "Display options:\n");
27 fprintf (stderr
, " -u, --unalias remove `alias' as an alias for `port'\n");
28 fprintf (stderr
, " -h, --help Display this help message\n");
29 fprintf (stderr
, " --version Output version information and exit\n\n");
30 fprintf (stderr
, "For more information see http://jackaudio.org/\n");
34 main (int argc
, char *argv
[])
36 jack_client_t
*client
;
47 struct option long_options
[] = {
48 { "unalias", 0, 0, 'u' },
49 { "help", 0, 0, 'h' },
50 { "version", 0, 0, 'v' },
59 my_name
= strrchr(argv
[0], '/');
66 while ((c
= getopt_long (argc
, argv
, "uhv", long_options
, &option_index
)) >= 0) {
86 portname
= argv
[optind
++];
89 /* Open a client connection to the JACK server. Starting a
90 * new server only to list its ports seems pointless, so we
91 * specify JackNoStartServer. */
92 //JOQ: need a new server name option
94 client
= jack_client_open ("lsp", JackNoStartServer
, &status
);
97 if (status
& JackServerFailed
) {
98 fprintf (stderr
, "JACK server not running\n");
100 fprintf (stderr
, "jack_client_open() failed, "
101 "status = 0x%2.0x\n", status
);
106 if ((port
= jack_port_by_name (client
, portname
)) == 0) {
107 fprintf (stderr
, "No port named \"%s\"\n", portname
);
112 ret
= jack_port_set_alias (port
, alias
);
114 ret
= jack_port_unset_alias (port
, alias
);
117 jack_client_close (client
);