]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/kr_87.cxx
Refactor morse and beacon as singleton
[flightgear.git] / src / Instrumentation / kr_87.cxx
index d0087c0985429b53db48b60a32afe512e58c742b..9b91babead8305fb9882a28fede67b2b0a4028de 100644 (file)
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/timing/sg_time.hxx>
 
-#include <Aircraft/aircraft.hxx>
 #include <Navaids/navlist.hxx>
 
 #include "kr_87.hxx"
 
+#include <Sound/morse.hxx>
 #include <string>
 using std::string;
 
@@ -117,10 +117,9 @@ FGKR_87::~FGKR_87() {
 
 
 void FGKR_87::init () {
-    SGSoundMgr *smgr = (SGSoundMgr *)globals->get_subsystem("soundmgr");
+    SGSoundMgr *smgr = globals->get_soundmgr();
     _sgr = smgr->find("avionics", true);
     _sgr->tie_to_listener();
-    morse.init();
 }
 
 
@@ -535,7 +534,7 @@ void FGKR_87::search() {
                _sgr->remove( "adf-ident" );
            }
            SGSoundSample *sound;
-           sound = morse.make_ident( trans_ident, LO_FREQUENCY );
+        sound = FGMorse::instance()->make_ident( trans_ident, LO_FREQUENCY );
            sound->set_volume( 0.3 );
            _sgr->add( sound, "adf-ident" );