diff options
| author | Gary Scavone <gary@music.mcgill.ca> | 2014-01-18 16:35:12 -0500 |
|---|---|---|
| committer | Gary Scavone <gary@music.mcgill.ca> | 2014-01-18 16:35:12 -0500 |
| commit | b8f788ee2ab8da7fdd12b7fc09475e7529512cd1 (patch) | |
| tree | dafd295f3eafb4d39e8acca1133ed83f48f71ee3 /tests/playsaw.cpp | |
| parent | ee76af899f7f27f4784d3bbae27f2c63f0f1e6ce (diff) | |
Changes to fix display issue for non-ASCII device names and some compile warnings on the Windows platform (most from Pavel Mogilevskiy).
Diffstat (limited to 'tests/playsaw.cpp')
| -rw-r--r-- | tests/playsaw.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/playsaw.cpp b/tests/playsaw.cpp index a590ca1..cd5f1e1 100644 --- a/tests/playsaw.cpp +++ b/tests/playsaw.cpp @@ -64,6 +64,17 @@ void usage( void ) { exit( 0 ); } +void errorCallback( RtAudioError::Type type, const std::string &errorText ) +{ + // This example error handling function does exactly the same thing + // as the embedded RtAudio::error() function. + std::cout << "in errorCallback" << std::endl; + if ( type == RtAudioError::WARNING ) + std::cerr << '\n' << errorText << "\n\n"; + else if ( type != RtAudioError::WARNING ) + throw( RtAudioError( errorText, type ) ); +} + unsigned int channels; RtAudio::StreamOptions options; unsigned int frameCounter = 0; @@ -169,7 +180,7 @@ int main( int argc, char *argv[] ) options.flags |= RTAUDIO_NONINTERLEAVED; #endif try { - dac.openStream( &oParams, NULL, FORMAT, fs, &bufferFrames, &saw, (void *)data, &options ); + dac.openStream( &oParams, NULL, FORMAT, fs, &bufferFrames, &saw, (void *)data, &options, &errorCallback ); dac.startStream(); } catch ( RtAudioError& e ) { |
