summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGary Scavone <gary@music.mcgill.ca>2014-04-26 09:44:39 -0400
committerGary Scavone <gary@music.mcgill.ca>2014-04-26 09:44:39 -0400
commit097b83163e65b9828a2bddffd15dc1504a1acab4 (patch)
treefaca35df8e765e395daea3b7949ce0971c7f90c7 /tests
parent1bf562b79a9a4940b2da19f7adbd6f065837c4d7 (diff)
Updates to test programs when specifying default device numbers.
Diffstat (limited to 'tests')
-rw-r--r--tests/duplex.cpp5
-rw-r--r--tests/playraw.cpp3
-rw-r--r--tests/playsaw.cpp3
-rw-r--r--tests/testall.cpp5
-rw-r--r--tests/teststops.cpp5
5 files changed, 21 insertions, 0 deletions
diff --git a/tests/duplex.cpp b/tests/duplex.cpp
index 291d2aa..06462f2 100644
--- a/tests/duplex.cpp
+++ b/tests/duplex.cpp
@@ -97,6 +97,11 @@ int main( int argc, char *argv[] )
oParams.nChannels = channels;
oParams.firstChannel = oOffset;
+ if ( iDevice == 0 )
+ iParams.deviceId = adac.getDefaultInputDevice();
+ if ( oDevice == 0 )
+ oParams.deviceId = adac.getDefaultOutputDevice();
+
RtAudio::StreamOptions options;
//options.flags |= RTAUDIO_NONINTERLEAVED;
diff --git a/tests/playraw.cpp b/tests/playraw.cpp
index 75e7d13..f11f83c 100644
--- a/tests/playraw.cpp
+++ b/tests/playraw.cpp
@@ -125,6 +125,9 @@ int main( int argc, char *argv[] )
oParams.nChannels = channels;
oParams.firstChannel = offset;
+ if ( device == 0 )
+ oParams.deviceId = dac.getDefaultOutputDevice();
+
data.channels = channels;
try {
dac.openStream( &oParams, NULL, FORMAT, fs, &bufferFrames, &output, (void *)&data );
diff --git a/tests/playsaw.cpp b/tests/playsaw.cpp
index 2be179b..d1953b6 100644
--- a/tests/playsaw.cpp
+++ b/tests/playsaw.cpp
@@ -174,6 +174,9 @@ int main( int argc, char *argv[] )
oParams.nChannels = channels;
oParams.firstChannel = offset;
+ if ( device == 0 )
+ oParams.deviceId = dac.getDefaultOutputDevice();
+
options.flags = RTAUDIO_HOG_DEVICE;
options.flags |= RTAUDIO_SCHEDULE_REALTIME;
#if !defined( USE_INTERLEAVED )
diff --git a/tests/testall.cpp b/tests/testall.cpp
index ec7107b..419f27b 100644
--- a/tests/testall.cpp
+++ b/tests/testall.cpp
@@ -128,6 +128,9 @@ int main( int argc, char *argv[] )
oParams.nChannels = channels;
oParams.firstChannel = oOffset;
+ if ( oDevice == 0 )
+ oParams.deviceId = dac.getDefaultOutputDevice();
+
RtAudio::StreamOptions options;
options.flags = RTAUDIO_HOG_DEVICE;
try {
@@ -192,6 +195,8 @@ int main( int argc, char *argv[] )
iParams.deviceId = iDevice;
iParams.nChannels = channels;
iParams.firstChannel = iOffset;
+ if ( iDevice == 0 )
+ iParams.deviceId = dac.getDefaultInputDevice();
options.flags = RTAUDIO_NONINTERLEAVED;
try {
dac.openStream( &oParams, &iParams, RTAUDIO_SINT32, fs, &bufferFrames, &inout, (void *)&bufferBytes, &options );
diff --git a/tests/teststops.cpp b/tests/teststops.cpp
index 5c6ed38..e24c064 100644
--- a/tests/teststops.cpp
+++ b/tests/teststops.cpp
@@ -121,6 +121,11 @@ int main( int argc, char *argv[] )
iParams.nChannels = mydata.channels;
iParams.firstChannel = iOffset;
+ if ( iDevice == 0 )
+ iParams.deviceId = adc->getDefaultInputDevice();
+ if ( oDevice == 0 )
+ oParams.deviceId = adc->getDefaultOutputDevice();
+
// First, test external stopStream() calls.
mydata.pulseCount = PULSE_RATE * fs;
mydata.nFrames = 50 * fs;