mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-01-31 13:40:35 +00:00
Make audio.jack.autoconnect connect all available ports (#923)
This commit is contained in:
parent
95e3693779
commit
92089e0a0f
1 changed files with 16 additions and 5 deletions
|
@ -614,14 +614,14 @@ new_fluid_jack_audio_driver2(fluid_settings_t *settings, fluid_audio_func_t func
|
||||||
{
|
{
|
||||||
jack_ports = jack_get_ports(client, NULL, NULL, JackPortIsInput | JackPortIsPhysical);
|
jack_ports = jack_get_ports(client, NULL, NULL, JackPortIsInput | JackPortIsPhysical);
|
||||||
|
|
||||||
if(jack_ports)
|
if(jack_ports && jack_ports[0])
|
||||||
{
|
{
|
||||||
int err;
|
int err, o = 0;
|
||||||
int connected = 0;
|
int connected = 0;
|
||||||
|
|
||||||
for(i = 0; jack_ports[i] && i < 2 * dev->num_output_ports; ++i)
|
for(i = 0; i < 2 * dev->num_output_ports; ++i)
|
||||||
{
|
{
|
||||||
err = jack_connect(client, jack_port_name(dev->output_ports[i]), jack_ports[i]);
|
err = jack_connect(client, jack_port_name(dev->output_ports[i]), jack_ports[o++]);
|
||||||
|
|
||||||
if(err)
|
if(err)
|
||||||
{
|
{
|
||||||
|
@ -631,11 +631,17 @@ new_fluid_jack_audio_driver2(fluid_settings_t *settings, fluid_audio_func_t func
|
||||||
{
|
{
|
||||||
connected++;
|
connected++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!jack_ports[o])
|
||||||
|
{
|
||||||
|
o = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
o = 0;
|
||||||
for(i = 0; jack_ports[i] && i < 2 * dev->num_fx_ports; ++i)
|
for(i = 0; jack_ports[i] && i < 2 * dev->num_fx_ports; ++i)
|
||||||
{
|
{
|
||||||
err = jack_connect(client, jack_port_name(dev->fx_ports[i]), jack_ports[i]);
|
err = jack_connect(client, jack_port_name(dev->fx_ports[i]), jack_ports[o++]);
|
||||||
|
|
||||||
if(err)
|
if(err)
|
||||||
{
|
{
|
||||||
|
@ -645,6 +651,11 @@ new_fluid_jack_audio_driver2(fluid_settings_t *settings, fluid_audio_func_t func
|
||||||
{
|
{
|
||||||
connected++;
|
connected++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!jack_ports[o])
|
||||||
|
{
|
||||||
|
o = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
jack_free(jack_ports); /* free jack ports array (not the port values!) */
|
jack_free(jack_ports); /* free jack ports array (not the port values!) */
|
||||||
|
|
Loading…
Reference in a new issue