From a6c46c89eb67410c1d373b88efd5916e8a1a54dc Mon Sep 17 00:00:00 2001 From: ehofman Date: Tue, 23 Jan 2007 10:07:36 +0000 Subject: [PATCH] *** empty log message *** --- simgear/sound/Makefile.am | 2 +- simgear/sound/openal_test1.cxx | 8 +++++--- simgear/sound/openal_test2.cxx | 12 ++++++------ 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/simgear/sound/Makefile.am b/simgear/sound/Makefile.am index 86aeebea..684303f1 100644 --- a/simgear/sound/Makefile.am +++ b/simgear/sound/Makefile.am @@ -32,4 +32,4 @@ openal_test2_LDADD = \ $(top_builddir)/simgear/structure/libsgstructure.a \ $(openal_LIBS) -INCLUDES = -I$(top_srcdir) +INCLUDES = -I$(top_srcdir) -DSRC_DIR=\"$(top_srcdir)/simgear/sound\" diff --git a/simgear/sound/openal_test1.cxx b/simgear/sound/openal_test1.cxx index 25d551ad..68b01a50 100644 --- a/simgear/sound/openal_test1.cxx +++ b/simgear/sound/openal_test1.cxx @@ -20,6 +20,8 @@ static unsigned int sleep(unsigned int secs) { return 0; } # include #endif +#define AUDIOFILE SRC_DIR"/jet.wav" + #include static void print_openal_error( ALuint error ) { @@ -117,16 +119,16 @@ int main( int argc, char *argv[] ) { // Load the sample file #if defined(ALUT_API_MAJOR_VERSION) && ALUT_API_MAJOR_VERSION >= 1 - buffer = alutCreateBufferFromFile("jet.wav"); + buffer = alutCreateBufferFromFile(AUDIOFILE); if (buffer == AL_NONE) { SG_LOG( SG_GENERAL, SG_ALERT, "Failed to buffer data."); } #else # if defined (__APPLE__) - alutLoadWAVFile( (ALbyte *)"jet.wav", &format, &data, &size, &freq ); + alutLoadWAVFile( (ALbyte *)AUDIOFILE, &format, &data, &size, &freq ); # else - alutLoadWAVFile( (ALbyte *)"jet.wav", &format, &data, &size, &freq, &loop ); + alutLoadWAVFile( (ALbyte *)AUDIOFILE, &format, &data, &size, &freq, &loop ); # endif if (alGetError() != AL_NO_ERROR) { SG_LOG( SG_GENERAL, SG_ALERT, "Failed to load wav file."); diff --git a/simgear/sound/openal_test2.cxx b/simgear/sound/openal_test2.cxx index f887769c..da263620 100644 --- a/simgear/sound/openal_test2.cxx +++ b/simgear/sound/openal_test2.cxx @@ -14,37 +14,37 @@ static unsigned int sleep(unsigned int secs) { return 0; } int main( int argc, char *argv[] ) { SGSoundMgr sm; - SGSoundSample sample1( ".", "jet.wav" ); + SGSoundSample sample1( SRC_DIR, "jet.wav" ); sample1.set_volume(0.5); sample1.set_volume(0.2); sample1.play_looped(); sleep(1); - SGSoundSample sample2( ".", "jet.wav" ); + SGSoundSample sample2( SRC_DIR, "jet.wav" ); sample2.set_volume(0.5); sample2.set_pitch(0.4); sample2.play_looped(); sleep(1); - SGSoundSample sample3( ".", "jet.wav" ); + SGSoundSample sample3( SRC_DIR, "jet.wav" ); sample3.set_volume(0.5); sample3.set_pitch(0.8); sample3.play_looped(); sleep(1); - SGSoundSample sample4( ".", "jet.wav" ); + SGSoundSample sample4( SRC_DIR, "jet.wav" ); sample4.set_volume(0.5); sample4.set_pitch(1.2); sample4.play_looped(); sleep(1); - SGSoundSample sample5( ".", "jet.wav" ); + SGSoundSample sample5( SRC_DIR, "jet.wav" ); sample5.set_volume(0.5); sample5.set_pitch(1.6); sample5.play_looped(); sleep(1); - SGSoundSample sample6( ".", "jet.wav" ); + SGSoundSample sample6( SRC_DIR, "jet.wav" ); sample6.set_volume(0.5); sample6.set_pitch(2.0); sample6.play_looped(); -- 2.39.5