From 5ecfcca7e4b3707ec810437a3232b6eb48012e46 Mon Sep 17 00:00:00 2001 From: ehofman Date: Fri, 9 May 2003 18:44:33 +0000 Subject: [PATCH] Extract the sound code from FlightGear and move it to SimGear --- src/ATC/ATC.cxx | 5 +- src/Aircraft/aircraft.cxx | 2 - src/Cockpit/kr_87.cxx | 4 +- src/Cockpit/marker_beacon.cxx | 6 +- src/Cockpit/navcom.cxx | 6 +- src/Main/Makefile.am | 2 +- src/Main/fg_init.cxx | 6 +- src/Main/fg_props.cxx | 4 +- src/Main/globals.hxx | 8 +- src/Main/main.cxx | 1 - src/Sound/Makefile.am | 4 +- src/Sound/beacon.cxx | 6 +- src/Sound/beacon.hxx | 14 +- src/Sound/fg_fx.cxx | 10 +- src/Sound/fg_fx.hxx | 4 +- src/Sound/fg_sound.cxx | 418 ---------------------------------- src/Sound/fg_sound.hxx | 100 -------- src/Sound/morse.cxx | 6 +- src/Sound/morse.hxx | 7 +- src/Sound/soundmgr.cxx | 406 --------------------------------- src/Sound/soundmgr.hxx | 203 ----------------- 21 files changed, 47 insertions(+), 1175 deletions(-) delete mode 100644 src/Sound/fg_sound.cxx delete mode 100644 src/Sound/fg_sound.hxx delete mode 100644 src/Sound/soundmgr.cxx delete mode 100644 src/Sound/soundmgr.hxx diff --git a/src/ATC/ATC.cxx b/src/ATC/ATC.cxx index e5649bbdc..11705bdee 100644 --- a/src/ATC/ATC.cxx +++ b/src/ATC/ATC.cxx @@ -18,9 +18,10 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +#include + #include
#include
-#include #include "ATC.hxx" #include "ATCdisplay.hxx" @@ -73,7 +74,7 @@ void FGATC::Render(string msg, string refname, bool repeating) { int len; unsigned char* buf = vPtr->WriteMessage((char*)msg.c_str(), len, voice); if(voice) { - FGSimpleSound* simple = new FGSimpleSound(buf, len); + SimpleSound* simple = new SimpleSound(buf, len); // TODO - at the moment the volume is always set off comm1 // and can't be changed after the transmission has started. simple->set_volume(5.0 * fgGetDouble("/radios/comm[0]/volume")); diff --git a/src/Aircraft/aircraft.cxx b/src/Aircraft/aircraft.cxx index 681dd48e8..bfe7c81ba 100644 --- a/src/Aircraft/aircraft.cxx +++ b/src/Aircraft/aircraft.cxx @@ -36,8 +36,6 @@ #include
#include
#include
-#include -#include #include #include #include diff --git a/src/Cockpit/kr_87.cxx b/src/Cockpit/kr_87.cxx index a516443ca..fcffd0d11 100644 --- a/src/Cockpit/kr_87.cxx +++ b/src/Cockpit/kr_87.cxx @@ -445,7 +445,7 @@ void FGKR_87::update( double dt ) { // play station ident via audio system if on + ant mode, // otherwise turn it off if ( vol_btn >= 0.01 && audio_btn ) { - FGSimpleSound *sound; + SimpleSound *sound; sound = globals->get_soundmgr()->find( "adf-ident" ); if ( sound != NULL ) { if ( !adf_btn ) { @@ -514,7 +514,7 @@ void FGKR_87::search() { if ( globals->get_soundmgr()->exists( "adf-ident" ) ) { globals->get_soundmgr()->remove( "adf-ident" ); } - FGSimpleSound *sound; + SimpleSound *sound; sound = morse.make_ident( trans_ident, LO_FREQUENCY ); sound->set_volume( 0.3 ); globals->get_soundmgr()->add( sound, "adf-ident" ); diff --git a/src/Cockpit/marker_beacon.cxx b/src/Cockpit/marker_beacon.cxx index 1f7c7882b..d40a02c4a 100644 --- a/src/Cockpit/marker_beacon.cxx +++ b/src/Cockpit/marker_beacon.cxx @@ -193,7 +193,7 @@ void FGMarkerBeacon::search() // cout << "OUTER MARKER" << endl; if ( last_beacon != FGMkrBeacon::OUTER ) { if ( ! globals->get_soundmgr()->exists( "outer-marker" ) ) { - FGSimpleSound *sound = beacon.get_outer(); + SimpleSound *sound = beacon.get_outer(); sound->set_volume( 0.3 ); globals->get_soundmgr()->add( sound, "outer-marker" ); } @@ -210,7 +210,7 @@ void FGMarkerBeacon::search() // cout << "MIDDLE MARKER" << endl; if ( last_beacon != FGMkrBeacon::MIDDLE ) { if ( ! globals->get_soundmgr()->exists( "middle-marker" ) ) { - FGSimpleSound *sound = beacon.get_middle(); + SimpleSound *sound = beacon.get_middle(); sound->set_volume( 0.3 ); globals->get_soundmgr()->add( sound, "middle-marker" ); } @@ -227,7 +227,7 @@ void FGMarkerBeacon::search() // cout << "INNER MARKER" << endl; if ( last_beacon != FGMkrBeacon::INNER ) { if ( ! globals->get_soundmgr()->exists( "inner-marker" ) ) { - FGSimpleSound *sound = beacon.get_inner(); + SimpleSound *sound = beacon.get_inner(); sound->set_volume( 0.3 ); globals->get_soundmgr()->add( sound, "inner-marker" ); } diff --git a/src/Cockpit/navcom.cxx b/src/Cockpit/navcom.cxx index 0a7d0bbb8..bdcdbd2a4 100644 --- a/src/Cockpit/navcom.cxx +++ b/src/Cockpit/navcom.cxx @@ -410,7 +410,7 @@ FGNavCom::update(double dt) if ( power_btn && (bus_power->getDoubleValue() > 1.0) && nav_ident_btn && audio_btn ) { - FGSimpleSound *sound; + SimpleSound *sound; sound = globals->get_soundmgr()->find( nav_fx_name ); if ( sound != NULL ) { sound->set_volume( nav_vol_btn ); @@ -522,7 +522,7 @@ void FGNavCom::search() if ( globals->get_soundmgr()->exists( nav_fx_name ) ) { globals->get_soundmgr()->remove( nav_fx_name ); } - FGSimpleSound *sound; + SimpleSound *sound; sound = morse.make_ident( nav_trans_ident, LO_FREQUENCY ); sound->set_volume( 0.3 ); globals->get_soundmgr()->add( sound, nav_fx_name ); @@ -572,7 +572,7 @@ void FGNavCom::search() if ( globals->get_soundmgr()->exists( nav_fx_name ) ) { globals->get_soundmgr()->remove( nav_fx_name ); } - FGSimpleSound *sound; + SimpleSound *sound; sound = morse.make_ident( nav_trans_ident, LO_FREQUENCY ); sound->set_volume( 0.3 ); if ( globals->get_soundmgr()->add( sound, nav_fx_name ) ) { diff --git a/src/Main/Makefile.am b/src/Main/Makefile.am index d47288528..5eca5f290 100644 --- a/src/Main/Makefile.am +++ b/src/Main/Makefile.am @@ -90,7 +90,7 @@ fgfs_LDADD = \ $(WEATHER_LIBS) \ -lsgroute -lsgsky -lsgephem -lsgmodel -lsgtiming -lsgio -lsgscreen \ -lsgmath -lsgbucket -lsgprops -lsgdebug -lsgmagvar -lsgmisc -lsgxml \ - -lsgserial \ + -lsgsound -lsgserial \ $(THREAD_LIBS) \ -lplibpu -lplibfnt -lplibjs -lplibnet -lplibssg -lplibsg -lplibul \ $(PSL_LIBS) \ diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 81be29a5b..22977d0a7 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -110,7 +110,6 @@ #include #endif #include -#include #include #include