[LAD] jack client autoconnection

Kjetil S. Matheussen k.s.matheussen at notam02.no
Mon Feb 4 14:14:54 UTC 2008



On Mon, 4 Feb 2008, Bob Ham wrote:

> On Fri, 2008-02-01 at 19:34 +0100, Kjetil S. Matheussen wrote:
>
>>   int jack_autoconnect_playback (jack_client_t *,
>>                                  int portnum,
>>                                  const char *source_port);
>>   int jack_autoconnect_record (jack_client_t *,
>>                                int portnum,
>>                                const char *destination_port);
>>
>> The reason is that this API will make it easier
>> for programs to make autoconnection configurabe.
>> Autoconnecting the old way (which includes finding
>> the physical ports and/or checking environment variables
>> for ports to connect to, etc.) is a lot more
>> hassle than just calling the functions above.
>
> Even less hassle is for clients to do nothing at all and leave the whole
> business entirely for jackd.  I suggest the following function instead:
>
>  int jack_set_autoconnect(jack_client_t *, int autoconnect);
>
> This enables a control interface that can present the user with a simple
> system-wide toggle switch that would dictate whether or not ports are
> automatically connected.
>

I'm not sure what you mean by the last sentence.
Is the "autoconnect" variable either 0 or 1?

But how do libjack know the order of ports? By just
using creation order? Well, I guess that will work.



How about this interface then?

void jack_enable_autoconnect(jack_client_t *);
void jack_disable_autoconnect(jack_client_t *);

And then a typical playback client would work like this:

jack_client_t *client=...
jack_enable_autoconnect(client);
jack_port_t *out_port[0]=jack_port_register(client,...);
jack_port_t *out_port[1]=jack_port_register(client,...);
jack_disable_autoconnect(client);





More information about the Linux-audio-dev mailing list