X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=RtAudio.cpp;h=0b952f02ec8812c169d3eb17d1ca5c94ae151070;hb=4ee8b95d791a54aca593ad24d4eabbaac90355c0;hp=5d49366358f450fcfdf400206b31df22437e7673;hpb=62f62cf90364040706863bd574d340e7c82216c3;p=rtaudio-cdist.git diff --git a/RtAudio.cpp b/RtAudio.cpp index 5d49366..0b952f0 100644 --- a/RtAudio.cpp +++ b/RtAudio.cpp @@ -1947,7 +1947,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. @@ -2358,6 +2358,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: @@ -2447,7 +2449,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) { @@ -2471,7 +2473,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) { @@ -5287,6 +5289,8 @@ Exit: // Various revisions for RtAudio 4.0 by Gary Scavone, April 2007 // Changed device query structure for RtAudio 4.0.7, January 2010 +#include +#include #include #include #include