diff options
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/Windows/audioprobe.dsp | 8 | ||||
| -rwxr-xr-x | tests/Windows/duplex.dsp | 8 | ||||
| -rwxr-xr-x | tests/Windows/playraw.dsp | 8 | ||||
| -rwxr-xr-x | tests/Windows/playsaw.dsp | 8 | ||||
| -rwxr-xr-x | tests/Windows/record.dsp | 8 | ||||
| -rwxr-xr-x | tests/Windows/testall.dsp | 8 | ||||
| -rwxr-xr-x | tests/Windows/teststops.dsp | 8 | ||||
| -rw-r--r-- | tests/audioprobe.cpp | 1 | ||||
| -rw-r--r-- | tests/duplex.cpp | 8 | ||||
| -rw-r--r-- | tests/playraw.cpp | 8 | ||||
| -rw-r--r-- | tests/playsaw.cpp | 23 | ||||
| -rw-r--r-- | tests/record.cpp | 10 | ||||
| -rw-r--r-- | tests/testall.cpp | 18 | ||||
| -rw-r--r-- | tests/teststops.cpp | 16 |
14 files changed, 62 insertions, 78 deletions
diff --git a/tests/Windows/audioprobe.dsp b/tests/Windows/audioprobe.dsp index 679bf9a..a44ae33 100755 --- a/tests/Windows/audioprobe.dsp +++ b/tests/Windows/audioprobe.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../include" /D "NDEBUG" /D "__WINDOW_DS__" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../include" /D "NDEBUG" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /D "__WINDOWS_WASAPI__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@@ -66,7 +66,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /I "../../include" /D "_DEBUG" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /I "../../include" /D "_DEBUG" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /D "__WINDOWS_WASAPI__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
@@ -149,10 +149,6 @@ SOURCE=..\..\include\iasiothiscallresolver.h SOURCE=..\..\RtAudio.h
# End Source File
-# Begin Source File
-
-SOURCE=..\..\RtError.h
-# End Source File
# End Group
# Begin Group "Resource Files"
diff --git a/tests/Windows/duplex.dsp b/tests/Windows/duplex.dsp index c9ba294..475000a 100755 --- a/tests/Windows/duplex.dsp +++ b/tests/Windows/duplex.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../include" /D "NDEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../include" /D "NDEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_WASAPI__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@@ -66,7 +66,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /I "../../include" /D "_DEBUG" /D "__WINDOWS_ASIO__.__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /I "../../include" /D "_DEBUG" /D "__WINDOWS_ASIO__.__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /D "__WINDOWS_WASAPI__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
@@ -149,10 +149,6 @@ SOURCE=..\..\include\iasiothiscallresolver.h SOURCE=..\..\RtAudio.h
# End Source File
-# Begin Source File
-
-SOURCE=..\..\RtError.h
-# End Source File
# End Group
# Begin Group "Resource Files"
diff --git a/tests/Windows/playraw.dsp b/tests/Windows/playraw.dsp index 849890d..58d8db7 100755 --- a/tests/Windows/playraw.dsp +++ b/tests/Windows/playraw.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /D "__WINDOWS_WASAPI__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@@ -66,7 +66,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /D "__WINDOWS_WASAPI__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
@@ -149,10 +149,6 @@ SOURCE=..\..\include\iasiothiscallresolver.h SOURCE=..\..\RtAudio.h
# End Source File
-# Begin Source File
-
-SOURCE=..\..\RtError.h
-# End Source File
# End Group
# Begin Group "Resource Files"
diff --git a/tests/Windows/playsaw.dsp b/tests/Windows/playsaw.dsp index 7923c1c..cca887a 100755 --- a/tests/Windows/playsaw.dsp +++ b/tests/Windows/playsaw.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /D "__WINDOWS_WASAPI__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@@ -66,7 +66,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /D "__WINDOWS_WASAPI__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
@@ -149,10 +149,6 @@ SOURCE=..\..\include\iasiothiscallresolver.h SOURCE=..\..\RtAudio.h
# End Source File
-# Begin Source File
-
-SOURCE=..\..\RtError.h
-# End Source File
# End Group
# Begin Group "Resource Files"
diff --git a/tests/Windows/record.dsp b/tests/Windows/record.dsp index 9ba312c..0b3e892 100755 --- a/tests/Windows/record.dsp +++ b/tests/Windows/record.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /D "__WINDOWS_WASAPI__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@@ -66,7 +66,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /D "__WINDOWS_WASAPI__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
@@ -149,10 +149,6 @@ SOURCE=..\..\include\iasiothiscallresolver.h SOURCE=..\..\RtAudio.h
# End Source File
-# Begin Source File
-
-SOURCE=..\..\RtError.h
-# End Source File
# End Group
# Begin Group "Resource Files"
diff --git a/tests/Windows/testall.dsp b/tests/Windows/testall.dsp index 72b6259..4a327c8 100755 --- a/tests/Windows/testall.dsp +++ b/tests/Windows/testall.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /D "__WINDOWS_WASAPI__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@@ -66,7 +66,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /D "__WINDOWS_WASAPI__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
@@ -149,10 +149,6 @@ SOURCE=..\..\include\iasiothiscallresolver.h SOURCE=..\..\RtAudio.h
# End Source File
-# Begin Source File
-
-SOURCE=..\..\RtError.h
-# End Source File
# End Group
# Begin Group "Resource Files"
diff --git a/tests/Windows/teststops.dsp b/tests/Windows/teststops.dsp index 1543bc8..15d09bd 100755 --- a/tests/Windows/teststops.dsp +++ b/tests/Windows/teststops.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /D "__WINDOWS_WASAPI__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@@ -66,7 +66,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /D "__WINDOWS_WASAPI__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
@@ -149,10 +149,6 @@ SOURCE=..\..\include\iasiothiscallresolver.h SOURCE=..\..\RtAudio.h
# End Source File
-# Begin Source File
-
-SOURCE=..\..\RtError.h
-# End Source File
# End Group
# Begin Group "Resource Files"
diff --git a/tests/audioprobe.cpp b/tests/audioprobe.cpp index a69437f..1b93908 100644 --- a/tests/audioprobe.cpp +++ b/tests/audioprobe.cpp @@ -18,6 +18,7 @@ int main() apiMap[RtAudio::MACOSX_CORE] = "OS-X Core Audio"; apiMap[RtAudio::WINDOWS_ASIO] = "Windows ASIO"; apiMap[RtAudio::WINDOWS_DS] = "Windows Direct Sound"; + apiMap[RtAudio::WINDOWS_WASAPI] = "Windows WASAPI"; apiMap[RtAudio::UNIX_JACK] = "Jack Client"; apiMap[RtAudio::LINUX_ALSA] = "Linux ALSA"; apiMap[RtAudio::LINUX_PULSE] = "Linux PulseAudio"; diff --git a/tests/duplex.cpp b/tests/duplex.cpp index 2c60aad..291d2aa 100644 --- a/tests/duplex.cpp +++ b/tests/duplex.cpp @@ -48,8 +48,8 @@ void usage( void ) { exit( 0 ); } -int inout( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, - double streamTime, RtAudioStreamStatus status, void *data ) +int inout( void *outputBuffer, void *inputBuffer, unsigned int /*nBufferFrames*/, + double /*streamTime*/, RtAudioStreamStatus status, void *data ) { // Since the number of input and output channels is equal, we can do // a simple buffer copy operation here. @@ -103,7 +103,7 @@ int main( int argc, char *argv[] ) try { adac.openStream( &oParams, &iParams, FORMAT, fs, &bufferFrames, &inout, (void *)&bufferBytes, &options ); } - catch ( RtError& e ) { + catch ( RtAudioError& e ) { std::cout << '\n' << e.getMessage() << '\n' << std::endl; exit( 1 ); } @@ -123,7 +123,7 @@ int main( int argc, char *argv[] ) // Stop the stream. adac.stopStream(); } - catch ( RtError& e ) { + catch ( RtAudioError& e ) { std::cout << '\n' << e.getMessage() << '\n' << std::endl; goto cleanup; } diff --git a/tests/playraw.cpp b/tests/playraw.cpp index f57c0b0..75e7d13 100644 --- a/tests/playraw.cpp +++ b/tests/playraw.cpp @@ -44,7 +44,7 @@ typedef double MY_TYPE; */ // Platform-dependent sleep routines. -#if defined( __WINDOWS_ASIO__ ) || defined( __WINDOWS_DS__ ) +#if defined( __WINDOWS_ASIO__ ) || defined( __WINDOWS_DS__ ) || defined( __WINDOWS_WASAPI__ ) #include <windows.h> #define SLEEP( milliseconds ) Sleep( (DWORD) milliseconds ) #else // Unix variants @@ -70,8 +70,8 @@ struct OutputData { }; // Interleaved buffers -int output( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, - double streamTime, RtAudioStreamStatus status, void *data ) +int output( void *outputBuffer, void * /*inputBuffer*/, unsigned int nBufferFrames, + double /*streamTime*/, RtAudioStreamStatus /*status*/, void *data ) { OutputData *oData = (OutputData*) data; @@ -130,7 +130,7 @@ int main( int argc, char *argv[] ) dac.openStream( &oParams, NULL, FORMAT, fs, &bufferFrames, &output, (void *)&data ); dac.startStream(); } - catch ( RtError& e ) { + catch ( RtAudioError& e ) { std::cout << '\n' << e.getMessage() << '\n' << std::endl; goto cleanup; } diff --git a/tests/playsaw.cpp b/tests/playsaw.cpp index 100d8d9..2be179b 100644 --- a/tests/playsaw.cpp +++ b/tests/playsaw.cpp @@ -41,7 +41,7 @@ typedef double MY_TYPE; */ // Platform-dependent sleep routines. -#if defined( __WINDOWS_ASIO__ ) || defined( __WINDOWS_DS__ ) +#if defined( __WINDOWS_ASIO__ ) || defined( __WINDOWS_DS__ ) || defined( __WINDOWS_WASAPI__ ) #include <windows.h> #define SLEEP( milliseconds ) Sleep( (DWORD) milliseconds ) #else // Unix variants @@ -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; @@ -101,8 +112,8 @@ int saw( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, #else // Use non-interleaved buffers -int saw( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, - double streamTime, RtAudioStreamStatus status, void *data ) +int saw( void *outputBuffer, void * /*inputBuffer*/, unsigned int nBufferFrames, + double /*streamTime*/, RtAudioStreamStatus status, void *data ) { unsigned int i, j; extern unsigned int channels; @@ -169,10 +180,10 @@ 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 ( RtError& e ) { + catch ( RtAudioError& e ) { e.printMessage(); goto cleanup; } @@ -190,7 +201,7 @@ int main( int argc, char *argv[] ) // Stop the stream dac.stopStream(); } - catch ( RtError& e ) { + catch ( RtAudioError& e ) { e.printMessage(); } } diff --git a/tests/record.cpp b/tests/record.cpp index 5aa0ef3..d16ea49 100644 --- a/tests/record.cpp +++ b/tests/record.cpp @@ -38,7 +38,7 @@ typedef double MY_TYPE; */ // Platform-dependent sleep routines. -#if defined( __WINDOWS_ASIO__ ) || defined( __WINDOWS_DS__ ) +#if defined( __WINDOWS_ASIO__ ) || defined( __WINDOWS_DS__ ) || defined( __WINDOWS_WASAPI__ ) #include <windows.h> #define SLEEP( milliseconds ) Sleep( (DWORD) milliseconds ) #else // Unix variants @@ -67,8 +67,8 @@ struct InputData { }; // Interleaved buffers -int input( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, - double streamTime, RtAudioStreamStatus status, void *data ) +int input( void * /*outputBuffer*/, void *inputBuffer, unsigned int nBufferFrames, + double /*streamTime*/, RtAudioStreamStatus /*status*/, void *data ) { InputData *iData = (InputData *) data; @@ -126,7 +126,7 @@ int main( int argc, char *argv[] ) try { adc.openStream( NULL, &iParams, FORMAT, fs, &bufferFrames, &input, (void *)&data ); } - catch ( RtError& e ) { + catch ( RtAudioError& e ) { std::cout << '\n' << e.getMessage() << '\n' << std::endl; goto cleanup; } @@ -148,7 +148,7 @@ int main( int argc, char *argv[] ) try { adc.startStream(); } - catch ( RtError& e ) { + catch ( RtAudioError& e ) { std::cout << '\n' << e.getMessage() << '\n' << std::endl; goto cleanup; } diff --git a/tests/testall.cpp b/tests/testall.cpp index f518a57..ec7107b 100644 --- a/tests/testall.cpp +++ b/tests/testall.cpp @@ -32,8 +32,8 @@ void usage( void ) { unsigned int channels; // Interleaved buffers -int sawi( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, - double streamTime, RtAudioStreamStatus status, void *data ) +int sawi( void *outputBuffer, void * /*inputBuffer*/, unsigned int nBufferFrames, + double /*streamTime*/, RtAudioStreamStatus status, void *data ) { unsigned int i, j; extern unsigned int channels; @@ -55,8 +55,8 @@ int sawi( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, } // Non-interleaved buffers -int sawni( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, - double streamTime, RtAudioStreamStatus status, void *data ) +int sawni( void *outputBuffer, void * /*inputBuffer*/, unsigned int nBufferFrames, + double /*streamTime*/, RtAudioStreamStatus status, void *data ) { unsigned int i, j; extern unsigned int channels; @@ -79,8 +79,8 @@ int sawni( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, return 0; } -int inout( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, - double streamTime, RtAudioStreamStatus status, void *data ) +int inout( void *outputBuffer, void *inputBuffer, unsigned int /*nBufferFrames*/, + double /*streamTime*/, RtAudioStreamStatus status, void *data ) { // Since the number of input and output channels is equal, we can do // a simple buffer copy operation here. @@ -160,7 +160,7 @@ int main( int argc, char *argv[] ) std::cout << "Playing again ... press <enter> to close the stream.\n"; std::cin.get( input ); } - catch ( RtError& e ) { + catch ( RtAudioError& e ) { e.printMessage(); goto cleanup; } @@ -180,7 +180,7 @@ int main( int argc, char *argv[] ) std::cout << "\nPlaying ... press <enter> to stop.\n"; std::cin.get( input ); } - catch ( RtError& e ) { + catch ( RtAudioError& e ) { e.printMessage(); goto cleanup; } @@ -216,7 +216,7 @@ int main( int argc, char *argv[] ) std::cout << "\nRunning ... press <enter> to stop.\n"; std::cin.get( input ); } - catch ( RtError& e ) { + catch ( RtAudioError& e ) { e.printMessage(); } diff --git a/tests/teststops.cpp b/tests/teststops.cpp index ab71dbd..5c6ed38 100644 --- a/tests/teststops.cpp +++ b/tests/teststops.cpp @@ -21,7 +21,7 @@ #define REPETITIONS 10
// Platform-dependent sleep routines.
-#if defined( __WINDOWS_ASIO__ ) || defined( __WINDOWS_DS__ )
+#if defined( __WINDOWS_ASIO__ ) || defined( __WINDOWS_DS__ ) || defined( __WINDOWS_WASAPI__ )
#include <windows.h>
#define SLEEP( milliseconds ) Sleep( (DWORD) milliseconds )
#else // Unix variants
@@ -51,8 +51,8 @@ struct MyData { };
// Interleaved buffers
-int pulse( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames,
- double streamTime, RtAudioStreamStatus status, void *mydata )
+int pulse( void *outputBuffer, void * /*inputBuffer*/, unsigned int nBufferFrames,
+ double /*streamTime*/, RtAudioStreamStatus status, void *mydata )
{
// Write out a pulse signal and ignore the input buffer.
unsigned int i, j;
@@ -141,7 +141,7 @@ int main( int argc, char *argv[] ) SLEEP( pausetime );
}
}
- catch ( RtError& e ) {
+ catch ( RtAudioError& e ) {
e.printMessage();
goto cleanup;
}
@@ -168,7 +168,7 @@ int main( int argc, char *argv[] ) SLEEP( pausetime );
}
}
- catch ( RtError& e ) {
+ catch ( RtAudioError& e ) {
e.printMessage();
goto cleanup;
}
@@ -193,7 +193,7 @@ int main( int argc, char *argv[] ) SLEEP( pausetime );
}
}
- catch ( RtError& e ) {
+ catch ( RtAudioError& e ) {
e.printMessage();
goto cleanup;
}
@@ -222,7 +222,7 @@ int main( int argc, char *argv[] ) SLEEP( pausetime );
}
}
- catch ( RtError& e ) {
+ catch ( RtAudioError& e ) {
e.printMessage();
goto cleanup;
}
@@ -253,7 +253,7 @@ int main( int argc, char *argv[] ) SLEEP( pausetime );
}
}
- catch ( RtError& e ) {
+ catch ( RtAudioError& e ) {
e.printMessage();
goto cleanup;
}
|
