]> git.mxchange.org Git - flightgear.git/blobdiff - src/Sound/beacon.hxx
Fix rpmlint/Linux packager complaints
[flightgear.git] / src / Sound / beacon.hxx
index 3b9a6e3c026697b77a9d66faef0ac533148aaa14..c60f4822554b9aa780cc7f7673d6cac245c57246 100644 (file)
@@ -4,7 +4,7 @@
 
 // Written by Curtis Olson, started March 2001.
 //
-// Copyright (C) 2001  Curtis L. Olson - curt@flightgear.org
+// Copyright (C) 2001  Curtis L. Olson - http://www.flightgear.org/~curt
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
 //
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 //
-// $Id$
-
 
 #ifndef _BEACON_HXX
 #define _BEACON_HXX
 
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
+#include "soundgenerator.hxx"
 
 #include <simgear/compiler.h>
-#include <simgear/sound/soundmgr.hxx>
-
-#include <plib/sl.h>
-#include <plib/sm.h>
-
-#include "morse.hxx"
-
+#include <simgear/sound/soundmgr_openal.hxx>
+#include <simgear/structure/SGReferenced.hxx>
+#include <simgear/structure/SGSharedPtr.hxx>
 
 // Quoting from http://www.smartregs.com/data/sa326.htm
 // Smart REGS Glossary - marker beacon
 // (See instrument landing system) (Refer to AIM.)
 
 
-static const int INNER_FREQ = 3000;
-static const int MIDDLE_FREQ = 1300;
-static const int OUTER_FREQ = 400;
-
-static const int INNER_SIZE = BYTES_PER_SECOND;
-static const int MIDDLE_SIZE = (int)(BYTES_PER_SECOND * 60 / 95 );
-static const int OUTER_SIZE = BYTES_PER_SECOND;
-
-static const int INNER_DIT_LEN = (int)(BYTES_PER_SECOND / 6.0);
-static const int MIDDLE_DIT_LEN = (int)(MIDDLE_SIZE / 3.0);
-static const int MIDDLE_DAH_LEN = (int)(MIDDLE_SIZE * 2 / 3.0);
-static const int OUTER_DAH_LEN = (int)(BYTES_PER_SECOND / 2.0);
-
 // manages everything we need to know for an individual sound sample
-class FGBeacon {
+class FGBeacon : public FGSoundGenerator {
 
 private:
+    static const int INNER_FREQ = 3000;
+    static const int MIDDLE_FREQ = 1300;
+    static const int OUTER_FREQ = 400;
 
-    unsigned char inner_buf[ INNER_SIZE ] ;
-    unsigned char middle_buf[ MIDDLE_SIZE ] ;
-    unsigned char outer_buf[ OUTER_SIZE ] ;
+    static const int INNER_SIZE = BYTES_PER_SECOND;
+    static const int MIDDLE_SIZE = (int)(BYTES_PER_SECOND * 60 / 95 );
+    static const int OUTER_SIZE = BYTES_PER_SECOND;
 
-    SGSimpleSound *inner;
-    SGSimpleSound *middle;
-    SGSimpleSound *outer;
+    static const int INNER_DIT_LEN = (int)(BYTES_PER_SECOND / 6.0);
+    static const int MIDDLE_DIT_LEN = (int)(MIDDLE_SIZE / 3.0);
+    static const int MIDDLE_DAH_LEN = (int)(MIDDLE_SIZE * 2 / 3.0);
+    static const int OUTER_DAH_LEN = (int)(BYTES_PER_SECOND / 2.0);
 
+    SGSharedPtr<SGSoundSample> inner;
+    SGSharedPtr<SGSoundSample> middle;
+    SGSharedPtr<SGSoundSample> outer;
+
+    // allocate and initialize sound samples
+    bool init();
+    static FGBeacon * _instance;
 public:
 
     FGBeacon();
     ~FGBeacon();
+    static FGBeacon * instance();
 
-    // allocate and initialize sound samples
-    bool init();
-
-    SGSimpleSound *get_inner() { return inner; }
-    SGSimpleSound *get_middle() { return middle; }
-    SGSimpleSound *get_outer() { return outer; }
+    SGSoundSample *get_inner() { return inner; }
+    SGSoundSample *get_middle() { return middle; }
+    SGSoundSample *get_outer() { return outer; }
    
 };