do not throw an error if no physical ports are available
This commit is contained in:
parent
a848f69f16
commit
572cee0143
1 changed files with 31 additions and 43 deletions
|
@ -99,17 +99,11 @@ void CSound::OpenJack()
|
|||
// the client is activated, because we cannot allow
|
||||
// connections to be made to clients that are not
|
||||
// running
|
||||
if ( ( ports = jack_get_ports ( pJackClient, NULL, NULL,
|
||||
JackPortIsPhysical | JackPortIsOutput ) ) == NULL )
|
||||
{
|
||||
throw CGenErr ( tr ( "There are no physical capture ports available. "
|
||||
"This software requires at least one input channel available. "
|
||||
"Maybe you have selected the wrong sound card in the Jack server "
|
||||
"configuration.<br>"
|
||||
"You can use a tool like <i><a href=""http://qjackctl.sourceforge.net"">QJackCtl</a></i> "
|
||||
"to adjust the Jack server settings." ) );
|
||||
}
|
||||
|
||||
// try to connect physical input ports
|
||||
if ( ( ports = jack_get_ports ( pJackClient, NULL, NULL,
|
||||
JackPortIsPhysical | JackPortIsOutput ) ) != NULL )
|
||||
{
|
||||
if ( jack_connect ( pJackClient, ports[0], jack_port_name ( input_port_left ) ) )
|
||||
{
|
||||
throw CGenErr ( tr ( "Cannot connect the Jack input ports" ) );
|
||||
|
@ -126,19 +120,12 @@ void CSound::OpenJack()
|
|||
}
|
||||
|
||||
free ( ports );
|
||||
|
||||
if ( ( ports = jack_get_ports ( pJackClient, NULL, NULL,
|
||||
JackPortIsPhysical | JackPortIsInput ) ) == NULL )
|
||||
{
|
||||
throw CGenErr ( tr ( "There are no physical playback ports available. "
|
||||
"This software requires at least one output channel available. "
|
||||
"Maybe you have selected the wrong sound card in the Jack server "
|
||||
"configuration.<br>"
|
||||
"You can use a tool like <i><a href=""http://qjackctl.sourceforge.net"">QJackCtl</a></i> "
|
||||
"to adjust the Jack server settings." ) );
|
||||
}
|
||||
|
||||
|
||||
// try to connect physical output ports
|
||||
if ( ( ports = jack_get_ports ( pJackClient, NULL, NULL,
|
||||
JackPortIsPhysical | JackPortIsInput ) ) != NULL )
|
||||
{
|
||||
if ( jack_connect ( pJackClient, jack_port_name ( output_port_left ), ports[0] ) )
|
||||
{
|
||||
throw CGenErr ( tr ( "Cannot connect the Jack output ports." ) );
|
||||
|
@ -155,6 +142,7 @@ void CSound::OpenJack()
|
|||
}
|
||||
|
||||
free ( ports );
|
||||
}
|
||||
}
|
||||
|
||||
void CSound::CloseJack()
|
||||
|
|
Loading…
Reference in a new issue