static void jackSilentError( const char * ) {};\r
\r
RtApiJack :: RtApiJack()\r
-{\r
+ :shouldAutoconnect_(true) {\r
// Nothing to do here.\r
#if !defined(__RTAUDIO_DEBUG__)\r
// Turn off Jack's internal error reporting.\r
// here.\r
if ( stream_.doConvertBuffer[mode] ) setConvertInfo( mode, 0 );\r
\r
+ if ( options && options->flags & RTAUDIO_JACK_DONT_CONNECT ) shouldAutoconnect_ = false;\r
+\r
return SUCCESS;\r
\r
error:\r
const char **ports;\r
\r
// Get the list of available ports.\r
- if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) {\r
+ if ( shouldAutoconnect_ && (stream_.mode == OUTPUT || stream_.mode == DUPLEX) ) {\r
result = 1;\r
ports = jack_get_ports( handle->client, handle->deviceName[0].c_str(), NULL, JackPortIsInput);\r
if ( ports == NULL) {\r
free(ports);\r
}\r
\r
- if ( stream_.mode == INPUT || stream_.mode == DUPLEX ) {\r
+ if ( shouldAutoconnect_ && (stream_.mode == INPUT || stream_.mode == DUPLEX) ) {\r
result = 1;\r
ports = jack_get_ports( handle->client, handle->deviceName[1].c_str(), NULL, JackPortIsOutput );\r
if ( ports == NULL) {\r
- \e RTAUDIO_MINIMIZE_LATENCY: Attempt to set stream parameters for lowest possible latency.
- \e RTAUDIO_HOG_DEVICE: Attempt grab device for exclusive use.
- \e RTAUDIO_ALSA_USE_DEFAULT: Use the "default" PCM device (ALSA only).
+ - \e RTAUDIO_JACK_DONT_CONNECT: Do not automatically connect ports (JACK only).
By default, RtAudio streams pass and receive audio data from the
client in an interleaved format. By passing the
If the RTAUDIO_ALSA_USE_DEFAULT flag is set, RtAudio will attempt to
open the "default" PCM device when using the ALSA API. Note that this
will override any specified input or output device id.
+
+ If the RTAUDIO_JACK_DONT_CONNECT flag is set, RtAudio will not attempt
+ to automatically connect the ports of the client to the audio device.
*/
typedef unsigned int RtAudioStreamFlags;
static const RtAudioStreamFlags RTAUDIO_NONINTERLEAVED = 0x1; // Use non-interleaved buffers (default = interleaved).
static const RtAudioStreamFlags RTAUDIO_HOG_DEVICE = 0x4; // Attempt grab device and prevent use by others.
static const RtAudioStreamFlags RTAUDIO_SCHEDULE_REALTIME = 0x8; // Try to select realtime scheduling for callback thread.
static const RtAudioStreamFlags RTAUDIO_ALSA_USE_DEFAULT = 0x10; // Use the "default" PCM device (ALSA only).
+static const RtAudioStreamFlags RTAUDIO_JACK_DONT_CONNECT = 0x20; // Do not automatically connect ports (JACK only).
/*! \typedef typedef unsigned long RtAudioStreamStatus;
\brief RtAudio stream status (over- or underflow) flags.
unsigned int firstChannel, unsigned int sampleRate,
RtAudioFormat format, unsigned int *bufferSize,
RtAudio::StreamOptions *options );
+
+ bool shouldAutoconnect_;
};
#endif