jack1 codebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
826B

  1. #include <stdio.h>
  2. #include <unistd.h>
  3. #include <string.h>
  4. #include <jack/jack.h>
  5. int
  6. main (int argc, char *argv[])
  7. {
  8. jack_client_t *client;
  9. const char **ports, **connections;
  10. unsigned int i, j;
  11. int show_con = 0;
  12. for (i = 1; i < argc; i++) {
  13. if (!strcmp(argv[i], "-c")) {
  14. show_con = 1;
  15. }
  16. }
  17. /* try to become a client of the JACK server */
  18. if ((client = jack_client_new ("lsp")) == 0) {
  19. fprintf (stderr, "jack server not running?\n");
  20. return 1;
  21. }
  22. ports = jack_get_ports (client, NULL, NULL, 0);
  23. for (i = 0; ports[i]; ++i) {
  24. printf ("%s\n", ports[i]);
  25. if (show_con) {
  26. connections = jack_port_get_connections (client,
  27. jack_port_by_name(client, ports[i]));
  28. for (j = 0; connections[j]; j++) {
  29. printf(" %s\n", connections[j]);
  30. }
  31. }
  32. }
  33. jack_client_close (client);
  34. exit (0);
  35. }