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>
29 //fprintf (stderr, "%s: JACK Audio Connection Kit version " VERSION "\n", my_name);
36 fprintf (stderr
, "\nUsage: %s [options] portname alias\n", my_name
);
37 fprintf (stderr
, "List active Jack ports, and optionally display extra information.\n\n");
38 fprintf (stderr
, "Display options:\n");
39 fprintf (stderr
, " -u, --unalias remove `alias' as an alias for `port'\n");
40 fprintf (stderr
, " -h, --help Display this help message\n");
41 fprintf (stderr
, " --version Output version information and exit\n\n");
42 fprintf (stderr
, "For more information see http://jackaudio.org/\n");
46 main (int argc
, char *argv
[])
48 jack_client_t
*client
;
59 struct option long_options
[] = {
60 { "unalias", 0, 0, 'u' },
61 { "help", 0, 0, 'h' },
62 { "version", 0, 0, 'v' },
71 my_name
= strrchr(argv
[0], '/');
78 while ((c
= getopt_long (argc
, argv
, "uhv", long_options
, &option_index
)) >= 0) {
98 portname
= argv
[optind
++];
101 /* Open a client connection to the JACK server. Starting a
102 * new server only to list its ports seems pointless, so we
103 * specify JackNoStartServer. */
104 //JOQ: need a new server name option
106 client
= jack_client_open ("lsp", JackNoStartServer
, &status
);
108 if (client
== NULL
) {
109 if (status
& JackServerFailed
) {
110 fprintf (stderr
, "JACK server not running\n");
112 fprintf (stderr
, "jack_client_open() failed, "
113 "status = 0x%2.0x\n", status
);
118 if ((port
= jack_port_by_name (client
, portname
)) == 0) {
119 fprintf (stderr
, "No port named \"%s\"\n", portname
);
124 ret
= jack_port_set_alias (port
, alias
);
126 ret
= jack_port_unset_alias (port
, alias
);
129 jack_client_close (client
);