summaryrefslogtreecommitdiff
path: root/tests/playsaw.cpp
diff options
context:
space:
mode:
authorGary Scavone <gary.scavone@mcgill.ca>2022-03-17 20:42:57 -0400
committerGary Scavone <gary.scavone@mcgill.ca>2022-03-17 20:42:57 -0400
commitcfb361a7dbf0f597ad5bf26f73527fabbba87980 (patch)
tree537024bbd19501219a2ebbf2e6c1fbc71ca055a9 /tests/playsaw.cpp
parenteaa0bd3db6233ef3992a4410e5855e0154383ac6 (diff)
Added getErrorText() function, other minor updates.
Diffstat (limited to 'tests/playsaw.cpp')
-rw-r--r--tests/playsaw.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/playsaw.cpp b/tests/playsaw.cpp
index 9dea11b..c23163e 100644
--- a/tests/playsaw.cpp
+++ b/tests/playsaw.cpp
@@ -222,14 +222,19 @@ int main( int argc, char *argv[] )
// An error in the openStream() function can be detected either by
// checking for a non-zero return value OR by a subsequent call to
// isStreamOpen().
- if ( dac.openStream( &oParams, NULL, FORMAT, fs, &bufferFrames, &saw, (void *)data, &options ) )
+ if ( dac.openStream( &oParams, NULL, FORMAT, fs, &bufferFrames, &saw, (void *)data, &options ) ) {
+ std::cout << dac.getErrorText() << std::endl;
goto cleanup;
+ }
if ( dac.isStreamOpen() == false ) goto cleanup;
//std::cout << "Stream latency = " << dac.getStreamLatency() << "\n" << std::endl;
// Stream is open ... now start it.
- if ( dac.startStream() ) goto cleanup;
+ if ( dac.startStream() ) {
+ std::cout << dac.getErrorText() << std::endl;
+ goto cleanup;
+ }
if ( checkCount ) {
while ( dac.isStreamRunning() == true ) SLEEP( 100 );