X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=tests%2Fplaysaw.cpp;h=d1953b6ca164c0a14ffc3ef136b08d60f5072c26;hb=77cfec0f03ce712410620d93fd698561901bdaf7;hp=b89d5f901bc4a09a0c307a8d0008047b7d594b6d;hpb=1022a7876a6ef1980ad5518340df177814783c7f;p=rtaudio.git diff --git a/tests/playsaw.cpp b/tests/playsaw.cpp index b89d5f9..d1953b6 100644 --- a/tests/playsaw.cpp +++ b/tests/playsaw.cpp @@ -13,49 +13,74 @@ #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__ ) || defined( __WINDOWS_WASAPI__ ) + #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