diff options
| author | JP Cimalando <jp-dev@inbox.ru> | 2016-07-26 09:58:47 +0200 |
|---|---|---|
| committer | JP Cimalando <jp-dev@inbox.ru> | 2016-07-26 09:58:47 +0200 |
| commit | 6318b5166166c87ac33842a4c9fcb42d202b5f27 (patch) | |
| tree | a09d6eab0b8dd1d06882afcd042804734f50e3a7 /RtAudio.cpp | |
| parent | 3cfbc9a5f3336b6015c615aae8f87b2a4eea8cc4 (diff) | |
a JACK-specific flag to disable automatic connection of ports
Diffstat (limited to 'RtAudio.cpp')
| -rw-r--r-- | RtAudio.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/RtAudio.cpp b/RtAudio.cpp index 882fa0e..d41c408 100644 --- a/RtAudio.cpp +++ b/RtAudio.cpp @@ -1943,7 +1943,7 @@ struct JackHandle { static void jackSilentError( const char * ) {};
RtApiJack :: RtApiJack()
-{
+ :shouldAutoconnect_(true) {
// Nothing to do here.
#if !defined(__RTAUDIO_DEBUG__)
// Turn off Jack's internal error reporting.
@@ -2354,6 +2354,8 @@ bool RtApiJack :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne // here.
if ( stream_.doConvertBuffer[mode] ) setConvertInfo( mode, 0 );
+ if ( options && options->flags & RTAUDIO_JACK_DONT_CONNECT ) shouldAutoconnect_ = false;
+
return SUCCESS;
error:
@@ -2443,7 +2445,7 @@ void RtApiJack :: startStream( void ) const char **ports;
// Get the list of available ports.
- if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) {
+ if ( shouldAutoconnect_ && (stream_.mode == OUTPUT || stream_.mode == DUPLEX) ) {
result = 1;
ports = jack_get_ports( handle->client, handle->deviceName[0].c_str(), NULL, JackPortIsInput);
if ( ports == NULL) {
@@ -2467,7 +2469,7 @@ void RtApiJack :: startStream( void ) free(ports);
}
- if ( stream_.mode == INPUT || stream_.mode == DUPLEX ) {
+ if ( shouldAutoconnect_ && (stream_.mode == INPUT || stream_.mode == DUPLEX) ) {
result = 1;
ports = jack_get_ports( handle->client, handle->deviceName[1].c_str(), NULL, JackPortIsOutput );
if ( ports == NULL) {
|
