summaryrefslogtreecommitdiff
path: root/RtAudio.cpp
diff options
context:
space:
mode:
authorgaryscavone <garyscavone@users.noreply.github.com>2017-08-24 13:34:04 -0700
committerGitHub <noreply@github.com>2017-08-24 13:34:04 -0700
commit4ee8b95d791a54aca593ad24d4eabbaac90355c0 (patch)
tree1b6d4c8457ea4f7bc929512d1dbf58e281ebafb0 /RtAudio.cpp
parent89d9757f80b5abb10da88300c1217b062fe5925b (diff)
parent6318b5166166c87ac33842a4c9fcb42d202b5f27 (diff)
Merge pull request #68 from jpcima/master
a JACK-specific flag to disable automatic connection of ports
Diffstat (limited to 'RtAudio.cpp')
-rw-r--r--RtAudio.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/RtAudio.cpp b/RtAudio.cpp
index 61b4708..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) {