do not throw an error if no physical ports are available

This commit is contained in:
Volker Fischer 2013-12-27 15:34:37 +00:00
parent a848f69f16
commit 572cee0143

View file

@ -99,17 +99,11 @@ void CSound::OpenJack()
// the client is activated, because we cannot allow // the client is activated, because we cannot allow
// connections to be made to clients that are not // connections to be made to clients that are not
// running // 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 ) ) ) if ( jack_connect ( pJackClient, ports[0], jack_port_name ( input_port_left ) ) )
{ {
throw CGenErr ( tr ( "Cannot connect the Jack input ports" ) ); throw CGenErr ( tr ( "Cannot connect the Jack input ports" ) );
@ -126,19 +120,12 @@ void CSound::OpenJack()
} }
free ( ports ); 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] ) ) if ( jack_connect ( pJackClient, jack_port_name ( output_port_left ), ports[0] ) )
{ {
throw CGenErr ( tr ( "Cannot connect the Jack output ports." ) ); throw CGenErr ( tr ( "Cannot connect the Jack output ports." ) );
@ -156,6 +143,7 @@ void CSound::OpenJack()
free ( ports ); free ( ports );
} }
}
void CSound::CloseJack() void CSound::CloseJack()
{ {