jack2 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.

47 lines
919B

  1. #include <stdio.h>
  2. #include <unistd.h>
  3. #include <stdlib.h>
  4. #include <string.h>
  5. #include <jack/jack.h>
  6. #define TRUE 1
  7. #define FALSE 0
  8. int
  9. main (int argc, char *argv[])
  10. {
  11. jack_client_t *client;
  12. char *my_name = strrchr(argv[0], '/');
  13. if (my_name == 0) {
  14. my_name = argv[0];
  15. } else {
  16. my_name ++;
  17. }
  18. if (argc != 2) {
  19. fprintf (stderr, "Usage: %s client\n", my_name);
  20. return 1;
  21. }
  22. if ((client = jack_client_open ("input monitoring", JackNullOption, NULL)) == 0) {
  23. fprintf (stderr, "jack server not running?\n");
  24. return 1;
  25. }
  26. if (jack_port_request_monitor_by_name (client, argv[1], TRUE)) {
  27. fprintf (stderr, "could not enable monitoring for %s\n", argv[1]);
  28. jack_client_close (client);
  29. return 1;
  30. }
  31. sleep (30);
  32. if (jack_port_request_monitor_by_name (client, argv[1], FALSE)) {
  33. fprintf (stderr, "could not disable monitoring for %s\n", argv[1]);
  34. }
  35. jack_client_close (client);
  36. exit (0);
  37. }