]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/adf.cxx
Refactor morse and beacon as singleton
[flightgear.git] / src / Instrumentation / adf.cxx
index 41ee7700ed9860ce64b730839aad080f3cbdc13a..e3fbac05332aeb61f9dc1d3a6a01f9aa9941aa8d 100644 (file)
@@ -17,6 +17,8 @@
 #include <Navaids/navlist.hxx>
 
 #include "adf.hxx"
+#include <Sound/morse.hxx>
+
 
 #include <iostream>
 #include <string>
@@ -110,8 +112,6 @@ ADF::init ()
     _sgr = smgr->find("avionics", true);
     _sgr->tie_to_listener();
 
-    morse.init();
-
     std::ostringstream temp;
     temp << _name << _num;
     _adf_ident = temp.str();
@@ -252,7 +252,7 @@ ADF::search (double frequency_khz, double longitude_rad,
         }
 
         SGSoundSample *sound;
-        sound = morse.make_ident( ident, LO_FREQUENCY );
+        sound = FGMorse::instance()->make_ident( ident, LO_FREQUENCY );
         sound->set_volume(_last_volume = 0);
         _sgr->add( sound, _adf_ident );