/*
Connect to jack and tell sample rate.
Compile with: cc -o jack-dev-1 jack-dev-1.c `pkg-config --cflags --libs jack`
*/
#include <stdio.h>
#include <jack/jack.h>

int main(void)
{
    // connect to jack server
    jack_client_t *client = jack_client_open(
        "jack-dev-1",       // name under which this client will be visible
        JackNoStartServer,  // options
        NULL);              // status information, NULL = not using
    if(client == NULL)
    {
        fprintf(stderr, "Connecting to jack failed\n");
        return 1;
    }

    // display sample rate
    jack_nframes_t sample_rate = jack_get_sample_rate(client);
    printf("sample rate is %u\n", sample_rate);

    // disconnect from jack server
    jack_client_close(client);

    return 0;
}
