Last active
April 18, 2017 09:04
-
-
Save udoprog/c01ecef035972ab254184bc0b99ce235 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <jack/jack.h> | |
void | |
query_status (jack_client_t *client) | |
{ | |
float load = jack_cpu_load (client); | |
printf ("DSP: %.03f%\n", load); | |
} | |
int | |
main (int argc, char *argv[]) | |
{ | |
jack_client_t *client; | |
if ((client = jack_client_open ("status", JackNullOption, NULL)) == 0) { | |
fprintf (stderr, "jack server not running?\n"); | |
return 1; | |
} | |
if (jack_activate (client)) { | |
fprintf (stderr, "cannot activate client"); | |
return 1; | |
} | |
query_status (client); | |
jack_client_close (client); | |
exit (0); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: all | |
all: | |
gcc -ljack jack_status.c -o jack_status |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment