jack connect confusion
Robert Hamilton <seedpress <at> yahoo.com>
2005-03-06 22:51:56 GMT
Folks,
I'm puzzled by a snippet of code from one of Jack's example clients,
called "simple_client.c," as follows:
/* connect the ports. Note: you can't do this before
the client is activated, because we can't allow
connections to be made to clients that aren't
running.
*/
if ((ports = jack_get_ports (client, NULL, NULL,
JackPortIsPhysical|JackPortIsInput)) == NULL) {
fprintf(stderr, "Cannot find any physical playback ports\n");
exit(1);
}
if (jack_connect (client, jack_port_name (output_port), ports[0])) {
fprintf (stderr, "cannot connect output ports\n");
}
free (ports);
One point of confusion for me is that the above-cited error messages refer
to "playback" and "output" ports, and the "jack_connect" function is
dealing with the "output_port;" however, the accompanying bit OR statement
seems to be handling the Input--as in "JackPortIsInput." Similarly, the
adjacent code within simple_client.c that handles "JackPortIsOutput" has
error messages that refer to the "capture" and "input" ports. On the face
of it, this would seem to be backwards, though I know the code is correct.
But not why it IS so!
My second point of confusion is regarding what is actually happening here.
Is the physical port being connected to the client's output port? Or are
the input and output ports within the client merely being connected to
each other (via the additional code not completely cited above, but which
parallels it). Or are both actions being accomplished?
Thanks,
Robert Hamilton a.k.a. seedpress
__________________________________
Celebrate Yahoo!'s 10th Birthday!
Yahoo! Netrospective: 100 Moments of the Web
http://birthday.yahoo.com/netrospective/
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click