2 This program is free software; you can redistribute it and/or modify
3 it under the terms of the GNU General Public License as published by
4 the Free Software Foundation; either version 2 of the License, or
5 (at your option) any later version.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
12 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software
14 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include <jack/jack.h>
30 //fprintf (stderr, "%s: JACK Audio Connection Kit version " VERSION "\n", my_name);
37 fprintf (stderr
, "\nUsage: %s [options] portname alias\n", my_name
);
38 fprintf (stderr
, "List active Jack ports, and optionally display extra information.\n\n");
39 fprintf (stderr
, "Display options:\n");
40 fprintf (stderr
, " -u, --unalias remove `alias' as an alias for `port'\n");
41 fprintf (stderr
, " -h, --help Display this help message\n");
42 fprintf (stderr
, " --version Output version information and exit\n\n");
43 fprintf (stderr
, "For more information see http://jackaudio.org/\n");
47 main (int argc
, char *argv
[])
49 jack_client_t
*client
;
60 struct option long_options
[] = {
61 { "unalias", 0, 0, 'u' },
62 { "help", 0, 0, 'h' },
63 { "version", 0, 0, 'v' },
72 my_name
= strrchr(argv
[0], '/');
79 while ((c
= getopt_long (argc
, argv
, "uhv", long_options
, &option_index
)) >= 0) {
99 portname
= argv
[optind
++];
100 alias
= argv
[optind
];
102 /* Open a client connection to the JACK server. Starting a
103 * new server only to list its ports seems pointless, so we
104 * specify JackNoStartServer. */
105 //JOQ: need a new server name option
107 client
= jack_client_open ("lsp", JackNoStartServer
, &status
);
109 if (client
== NULL
) {
110 if (status
& JackServerFailed
) {
111 fprintf (stderr
, "JACK server not running\n");
113 fprintf (stderr
, "jack_client_open() failed, "
114 "status = 0x%2.0x\n", status
);
119 if ((port
= jack_port_by_name (client
, portname
)) == 0) {
120 fprintf (stderr
, "No port named \"%s\"\n", portname
);
125 ret
= jack_port_set_alias (port
, alias
);
127 ret
= jack_port_unset_alias (port
, alias
);
130 jack_client_close (client
);