3 * @brief This simple client demonstrates the basic features of JACK
4 * as they would be used by many applications.
13 #include <jack/jack.h>
15 jack_client_t
*client
;
16 static int reorder
= 0;
18 static int Jack_Graph_Order_Callback(void *arg
)
23 printf("Jack_Graph_Order_Callback count = %d\n", reorder
++);
25 ports
= jack_get_ports(client
, NULL
, NULL
, JackPortIsPhysical
|JackPortIsOutput
);
27 for (i
= 0; ports
[i
]; ++i
) {
28 printf("name: %s\n", ports
[i
]);
33 ports
= jack_get_ports(client
, NULL
, NULL
, JackPortIsPhysical
|JackPortIsInput
);
35 for (i
= 0; ports
[i
]; ++i
) {
36 printf("name: %s\n", ports
[i
]);
45 main (int argc
, char *argv
[])
47 jack_options_t options
= JackNullOption
;
50 /* open a client connection to the JACK server */
52 client
= jack_client_open("control_client", options
, &status
);
54 printf("jack_client_open() failed \n");
58 if (jack_set_graph_order_callback(client
, Jack_Graph_Order_Callback
, 0) != 0) {
59 printf("Error when calling jack_set_graph_order_callback() !\n");
62 /* Tell the JACK server that we are ready to roll. Our
63 * process() callback will start running now. */
65 if (jack_activate(client
)) {
66 printf("cannot activate client");
70 printf("Type 'q' to quit\n");
71 while ((getchar() != 'q')) {}
73 jack_client_close(client
);