X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=tests%2Fplaysaw.cpp;h=cd5f1e102b11ca2e8beaf68e5176904a9ac7de67;hb=b8f788ee2ab8da7fdd12b7fc09475e7529512cd1;hp=c39bcb49967716fa7055ec0af55ad7e3ae538fd6;hpb=f6708f5edc4719fdc5a54cfcb11159d197dd6dcd;p=rtaudio.git diff --git a/tests/playsaw.cpp b/tests/playsaw.cpp index c39bcb4..cd5f1e1 100644 --- a/tests/playsaw.cpp +++ b/tests/playsaw.cpp @@ -10,51 +10,77 @@ #include "RtAudio.h" #include +#include /* -typedef signed long MY_TYPE; -#define FORMAT RTAUDIO_SINT24 -#define SCALE 2147483647.0 - -typedef char MY_TYPE; +typedef char MY_TYPE; #define FORMAT RTAUDIO_SINT8 #define SCALE 127.0 +*/ -typedef signed short MY_TYPE; +typedef signed short MY_TYPE; #define FORMAT RTAUDIO_SINT16 #define SCALE 32767.0 -typedef signed long MY_TYPE; +/* +typedef S24 MY_TYPE; +#define FORMAT RTAUDIO_SINT24 +#define SCALE 8388607.0 + +typedef signed long MY_TYPE; #define FORMAT RTAUDIO_SINT32 #define SCALE 2147483647.0 -*/ -typedef float MY_TYPE; +typedef float MY_TYPE; #define FORMAT RTAUDIO_FLOAT32 #define SCALE 1.0 -/* -typedef double MY_TYPE; +typedef double MY_TYPE; #define FORMAT RTAUDIO_FLOAT64 #define SCALE 1.0 */ +// Platform-dependent sleep routines. +#if defined( __WINDOWS_ASIO__ ) || defined( __WINDOWS_DS__ ) + #include + #define SLEEP( milliseconds ) Sleep( (DWORD) milliseconds ) +#else // Unix variants + #include + #define SLEEP( milliseconds ) usleep( (unsigned long) (milliseconds * 1000.0) ) +#endif + #define BASE_RATE 0.005 #define TIME 1.0 void usage( void ) { // Error function in case of incorrect command-line // argument specifications - std::cout << "\nuseage: playsaw N fs \n"; + std::cout << "\nuseage: playsaw N fs