Skip to content

Instantly share code, notes, and snippets.

@udoprog
Last active April 18, 2017 09:04
Show Gist options
  • Save udoprog/c01ecef035972ab254184bc0b99ce235 to your computer and use it in GitHub Desktop.
Save udoprog/c01ecef035972ab254184bc0b99ce235 to your computer and use it in GitHub Desktop.
#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);
}
.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