summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Scavone <gary@music.mcgill.ca>2007-11-22 16:12:08 +0000
committerStephen Sinclair <sinclair@music.mcgill.ca>2013-10-11 01:29:21 +0200
commit552c2436cf26a4d4c37906bdf855109cf8dd4373 (patch)
treef6b34942e5d09b0326d733df5d7e15c5856628b0
parentaf95dc23a7b4c12d74f050ba6a725f6fd9fa17f6 (diff)
Syntax changes to test programs and restoration of Windows VC++ project files (gps).
-rw-r--r--tests/Makefile.in6
-rw-r--r--tests/audioprobe.cpp (renamed from tests/probe.cpp)2
-rw-r--r--tests/duplex.cpp6
-rw-r--r--tests/playraw.cpp6
-rw-r--r--tests/playsaw.cpp11
-rw-r--r--tests/testall.cpp10
6 files changed, 20 insertions, 21 deletions
diff --git a/tests/Makefile.in b/tests/Makefile.in
index be9cc8b..449dcf4 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1,6 +1,6 @@
### RtAudio tests Makefile - for various flavors of unix
-PROGRAMS = probe playsaw playraw record duplex testall
+PROGRAMS = audioprobe playsaw playraw record duplex testall
RM = /bin/rm
SRC_PATH = ../
INCLUDE = ../
@@ -22,8 +22,8 @@ LIBRARY += @frameworks@
all : $(PROGRAMS)
-probe : probe.cpp $(OBJECTS)
- $(CC) $(CFLAGS) $(DEFS) -o probe probe.cpp $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
+audioprobe : audioprobe.cpp $(OBJECTS)
+ $(CC) $(CFLAGS) $(DEFS) -o audioprobe audioprobe.cpp $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
playsaw : playsaw.cpp $(OBJECTS)
$(CC) $(CFLAGS) $(DEFS) -o playsaw playsaw.cpp $(OBJECT_PATH)/RtAudio.o $(LIBRARY)
diff --git a/tests/probe.cpp b/tests/audioprobe.cpp
index e756346..f7246fb 100644
--- a/tests/probe.cpp
+++ b/tests/audioprobe.cpp
@@ -1,6 +1,6 @@
/******************************************/
/*
- probe.cpp
+ audioprobe.cpp
by Gary P. Scavone, 2001
Probe audio system and prints device info.
diff --git a/tests/duplex.cpp b/tests/duplex.cpp
index 5e63cd7..f416bad 100644
--- a/tests/duplex.cpp
+++ b/tests/duplex.cpp
@@ -56,7 +56,7 @@ int inout( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames,
return 0;
}
-int main(int argc, char *argv[])
+int main( int argc, char *argv[] )
{
unsigned int channels, fs, bufferBytes, oDevice = 0, iDevice = 0, iOffset = 0, oOffset = 0;
@@ -66,7 +66,7 @@ int main(int argc, char *argv[])
RtAudio adac;
if ( adac.getDeviceCount() < 1 ) {
std::cout << "\nNo audio devices found!\n";
- exit( 0 );
+ exit( 1 );
}
channels = (unsigned int) atoi(argv[1]);
@@ -101,7 +101,7 @@ int main(int argc, char *argv[])
}
catch ( RtError& e ) {
std::cout << '\n' << e.getMessage() << '\n' << std::endl;
- exit( 0 );
+ exit( 1 );
}
bufferBytes = bufferFrames * channels * sizeof( MY_TYPE );
diff --git a/tests/playraw.cpp b/tests/playraw.cpp
index 3b70cdb..a9e4db1 100644
--- a/tests/playraw.cpp
+++ b/tests/playraw.cpp
@@ -58,7 +58,7 @@ void usage( void ) {
std::cout << " file = the raw file to play,\n";
std::cout << " device = optional device to use (default = 0),\n";
std::cout << " and channelOffset = an optional channel offset on the device (default = 0).\n\n";
- exit(0);
+ exit( 0 );
}
struct OutputData {
@@ -106,13 +106,13 @@ int main( int argc, char *argv[] )
if ( argc > 4 )
device = (unsigned int) atoi( argv[4] );
if ( argc > 5 )
- offset = (unsigned int) atoi(argv[5]);
+ offset = (unsigned int) atoi( argv[5] );
OutputData data;
data.fd = fopen( file, "rb" );
if ( !data.fd ) {
std::cout << "Unable to find or open file!\n";
- exit( 0 );
+ exit( 1 );
}
// Set our stream parameters for output only.
diff --git a/tests/playsaw.cpp b/tests/playsaw.cpp
index cbe4203..772881c 100644
--- a/tests/playsaw.cpp
+++ b/tests/playsaw.cpp
@@ -119,15 +119,15 @@ int main( int argc, char *argv[] )
RtAudio dac;
if ( dac.getDeviceCount() < 1 ) {
std::cout << "\nNo audio devices found!\n";
- exit( 0 );
+ exit( 1 );
}
- channels = (unsigned int) atoi(argv[1]);
- fs = (unsigned int) atoi(argv[2]);
+ channels = (unsigned int) atoi( argv[1] );
+ fs = (unsigned int) atoi( argv[2] );
if ( argc > 3 )
- device = (unsigned int) atoi(argv[3]);
+ device = (unsigned int) atoi( argv[3] );
if ( argc > 4 )
- offset = (unsigned int) atoi(argv[4]);
+ offset = (unsigned int) atoi( argv[4] );
double *data;
data = (double *) calloc( channels, sizeof( double ) );
@@ -142,7 +142,6 @@ int main( int argc, char *argv[] )
oParams.nChannels = channels;
oParams.firstChannel = offset;
-
options.flags |= RTAUDIO_HOG_DEVICE;
#if !defined( USE_INTERLEAVED )
options.flags |= RTAUDIO_NONINTERLEAVED;
diff --git a/tests/testall.cpp b/tests/testall.cpp
index af14809..5efb0dd 100644
--- a/tests/testall.cpp
+++ b/tests/testall.cpp
@@ -98,15 +98,15 @@ int main( int argc, char *argv[] )
RtAudio dac;
if ( dac.getDeviceCount() < 1 ) {
std::cout << "\nNo audio devices found!\n";
- exit( 0 );
+ exit( 1 );
}
- channels = (unsigned int) atoi(argv[1]);
- fs = (unsigned int) atoi(argv[2]);
+ channels = (unsigned int) atoi( argv[1] );
+ fs = (unsigned int) atoi( argv[2] );
if ( argc > 3 )
- device = (unsigned int) atoi(argv[3]);
+ device = (unsigned int) atoi( argv[3] );
if ( argc > 4 )
- offset = (unsigned int) atoi(argv[4]);
+ offset = (unsigned int) atoi( argv[4] );
double *data;
data = (double *) calloc( channels, sizeof( double ) );