From: curt Date: Wed, 3 Jun 1998 22:01:06 +0000 (+0000) Subject: Tweaking sound library usage. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=88ceb3dbb8706e370f1ceac5155e35aa488550d4;p=flightgear.git Tweaking sound library usage. --- diff --git a/Main/GLUTmain.cxx b/Main/GLUTmain.cxx index e5aab2f37..0536ecec0 100644 --- a/Main/GLUTmain.cxx +++ b/Main/GLUTmain.cxx @@ -89,8 +89,8 @@ int displayInstruments; #ifdef HAVE_OSS_AUDIO slScheduler audio_sched ( 8000 ) ; smMixer audio_mixer ; -slSample *s1; -slSample *s2; +slSample s1; +slSample s2; #endif @@ -632,6 +632,7 @@ int main( int argc, char **argv ) { fgFLIGHT *f; fgOPTIONS *o; char config[256]; + char path[256], slfile[256]; int result; // Used in command line argument. f = current_aircraft.flight; @@ -708,11 +709,22 @@ int main( int argc, char **argv ) { #ifdef HAVE_OSS_AUDIO audio_mixer . setMasterVolume ( 30 ) ; /* 50% of max volume. */ audio_sched . setSafetyMargin ( 1.0 ) ; - s1 = new slSample ( "/dos/X-System-HSR/sounds/xp_recip.wav", &audio_sched ); - s2 = new slSample ( "/dos/X-System-HSR/sounds/wind.wav", &audio_sched ); - s2 -> adjustVolume(0.5); - audio_sched . loopSample ( s1 ); - audio_sched . loopSample ( s2 ); + strcpy(path, o->fg_root); + strcat(path, "/Sounds/"); + + strcpy(slfile, path); + strcat(slfile, "prpidle.wav"); + // s1 . loadFile ( slfile ); + s1 . loadFile ( slfile ); + printf("Rate = %d Bps = %d Stereo = %d\n", + s1.getRate(), s1.getBps(), s1.getStereo()); + audio_sched . playSample ( &s1 ); + + strcpy(slfile, path); + strcat(slfile, "thunder.wav"); + // s2 . loadFile ( slfile ); + // s2 . adjustVolume(0.5); + // audio_sched . playSample ( &s2 ); #endif // pass control off to the master GLUT event handler @@ -732,6 +744,9 @@ extern "C" { // $Log$ +// Revision 1.21 1998/06/03 22:01:06 curt +// Tweaking sound library usage. +// // Revision 1.20 1998/06/03 00:47:11 curt // Updated to compile in audio support if OSS available. // Updated for new version of Steve's audio library. diff --git a/Main/airports.cxx b/Main/airports.cxx index d3a4ca137..5652916b1 100644 --- a/Main/airports.cxx +++ b/Main/airports.cxx @@ -50,9 +50,8 @@ int fgAIRPORTS::load( char *file ) { o = ¤t_options; - // build the path name to the ambient lookup table - path[0] = '\0'; - strcat(path, o->fg_root); + // build the path name to the airport file + strcpy(path, o->fg_root); strcat(path, "/Scenery/"); strcat(path, "Airports"); strcpy(fgpath, path); @@ -104,6 +103,9 @@ fgAIRPORTS::~fgAIRPORTS( void ) { // $Log$ +// Revision 1.7 1998/06/03 22:01:07 curt +// Tweaking sound library usage. +// // Revision 1.6 1998/06/03 00:47:13 curt // Updated to compile in audio support if OSS available. // Updated for new version of Steve's audio library.