]> git.mxchange.org Git - flightgear.git/commitdiff
Tolerate refactored SGSound headers.
authorJames Turner <zakalawe@mac.com>
Sun, 30 Sep 2012 18:40:08 +0000 (19:40 +0100)
committerJames Turner <zakalawe@mac.com>
Sun, 30 Sep 2012 18:40:08 +0000 (19:40 +0100)
An upcoming commit will make the sound headers standalone, and no longer include various other headers / using std:: declarations. Prepare for this by making includes and usage of namespaces explicit.

20 files changed:
src/ATCDCL/ATC.cxx
src/ATCDCL/ATCVoice.cxx
src/Instrumentation/adf.cxx
src/Instrumentation/dme.cxx
src/Instrumentation/kr_87.cxx
src/Instrumentation/marker_beacon.cxx
src/Instrumentation/mk_viii.cxx
src/Instrumentation/navradio.cxx
src/Instrumentation/newnavradio.cxx
src/Instrumentation/tcas.cxx
src/Sound/audioident.cxx
src/Sound/beacon.cxx
src/Sound/fg_fx.cxx
src/Sound/fg_fx.hxx
src/Sound/morse.cxx
src/Sound/morse.hxx
src/Sound/sample_queue.cxx
src/Sound/sample_queue.hxx
src/Sound/voiceplayer.cxx
src/Sound/voiceplayer.hxx

index 982b151bc7e4f894fceff1df1c2ba9675c9d3c61..cf1e7c823692f0569bdce70f20bf712c95204a58 100644 (file)
@@ -27,6 +27,7 @@
 #include <iostream>
 
 #include <simgear/sound/soundmgr_openal.hxx>
+#include <simgear/sound/sample_group.hxx>
 #include <simgear/structure/exception.hxx>
 
 #include <Main/globals.hxx>
@@ -137,8 +138,8 @@ void FGATC::SetStation(flightgear::CommStation* sta) {
 // Outputs the transmission either on screen or as audio depending on user preference
 // The refname is a string to identify this sample to the sound manager
 // The repeating flag indicates whether the message should be repeated continuously or played once.
-void FGATC::Render(string& msg, const float volume, 
-                   const string& refname, const bool repeating) {
+void FGATC::Render(std::string& msg, const float volume,
+                   const std::string& refname, const bool repeating) {
     if ((!_display) ||(volume < 0.05))
     {
         NoRender(refname);
@@ -206,7 +207,7 @@ void FGATC::Render(string& msg, const float volume,
 
 
 // Cease rendering a transmission.
-void FGATC::NoRender(const string& refname) {
+void FGATC::NoRender(const std::string& refname) {
     if(_playing) {
         if(_voice) {
 #ifdef ENABLE_AUDIO_SUPPORT
index 07825f78c3f5c64239c7e94e9f4c0e922e6a95c8..14c4920e11c6b198f4d81840785c46ed509024a6 100644 (file)
@@ -32,6 +32,8 @@
 #include <algorithm>
 
 #include <simgear/sound/soundmgr_openal.hxx>
+#include <simgear/sound/sample_openal.hxx>
+
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/debug/logstream.hxx>
 #include <simgear/misc/sgstream.hxx>
index f3a3a486af915e20cfdebd784e26903c0d5a56d0..8053545e522d3ce6a96dac38f29cb2b535e0e372 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "adf.hxx"
 #include <Sound/morse.hxx>
-
+#include <simgear/sound/sample_group.hxx>
 
 #include <iostream>
 #include <string>
index 77d711b8c8c585802bbf143991d3ff5c70724eb2..33ea69279d18b949484a93576a9325951f7ba267 100644 (file)
@@ -11,6 +11,7 @@
 #include <simgear/sg_inlines.h>
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/math/sg_random.h>
+#include <simgear/sound/sample_group.hxx>
 
 #include <Main/fg_props.hxx>
 #include <Navaids/navlist.hxx>
@@ -90,7 +91,7 @@ DME::~DME ()
 void
 DME::init ()
 {
-    string branch;
+    std::string branch;
     branch = "/instrumentation/" + _name;
 
     SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true );
@@ -137,7 +138,7 @@ DME::update (double delta_time_sec)
                                 // Figure out the source
     const char * source = _source_node->getStringValue();
     if (source[0] == '\0') {
-        string branch;
+        std::string branch;
         branch = "/instrumentation/" + _name + "/frequencies/selected-mhz";
         _source_node->setStringValue(branch.c_str());
         source = _source_node->getStringValue();
index 0bad9615fbbb14cc3d12a743be0d060e3e8edcc4..79f45809e4907532c239ea8e82b474ea4e8da5ef 100644 (file)
@@ -30,6 +30,7 @@
 #include <simgear/math/sg_random.h>
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/timing/sg_time.hxx>
+#include <simgear/sound/sample_group.hxx>
 
 #include <Navaids/navlist.hxx>
 
index 50c85edafd9b442ab81fd1482400e9965aebb83c..52b3c67789b4f3b17bfb717717db8abf8a431cb4 100644 (file)
@@ -30,6 +30,7 @@
 #include <simgear/compiler.h>
 #include <simgear/math/sg_random.h>
 #include <simgear/misc/sg_path.hxx>
+#include <simgear/sound/sample_group.hxx>
 
 #include <Navaids/navlist.hxx>
 
index 97eddc609bc5aa5b5d2544e8590c7bb0a21aadca..9b0ee2b480428d5d32f0c16010907d18e914071d 100644 (file)
@@ -70,6 +70,7 @@
 #include <simgear/math/sg_random.h>
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/sound/soundmgr_openal.hxx>
+#include <simgear/sound/sample_group.hxx>
 #include <simgear/structure/exception.hxx>
 
 using std::string;
index fa528521e8a300da810f47e3930eabd1a4cfe230..810bfeb95454f7bb5bd2fa884dcf39e66d058633 100644 (file)
@@ -34,6 +34,7 @@
 #include <simgear/structure/exception.hxx>
 #include <simgear/math/interpolater.hxx>
 #include <simgear/misc/strutils.hxx>
+#include <simgear/sound/sample_group.hxx>
 
 #include <Navaids/navrecord.hxx>
 #include <Sound/audioident.hxx>
index 63c222ff9b2d905122e3cb60d332a5cfd2f751ca..bc54961d94e5565498991d9e50b950fabb40492e 100644 (file)
@@ -33,6 +33,7 @@
 #include <simgear/sg_inlines.h>
 #include <simgear/props/propertyObject.hxx>
 #include <simgear/misc/strutils.hxx>
+#include <simgear/sound/sample_group.hxx>
 
 #include <Main/fg_props.hxx>
 #include <Navaids/navlist.hxx>
index 95a4dda5fbd2d86af2af247bc921fd1e87faad67..12047c65efbc4ffc8a15cb860626de49d9260f66 100644 (file)
 #include <simgear/debug/logstream.hxx>
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/sound/soundmgr_openal.hxx>
+#include <simgear/sound/sample_group.hxx>
 #include <simgear/structure/exception.hxx>
 
 using std::string;
index 829ce9ab67d0190fe34ad5a01f8919e6cfc96c5e..c205287f2e97720b7dbd64dfea75e6d95c936a2f 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "audioident.hxx"
 #include <simgear/sg_inlines.h>
+#include <simgear/sound/sample_group.hxx>
 
 #include <Main/globals.hxx>
 #include <Sound/morse.hxx>
index 9d7a1a18452885c93c825132c14732704564100f..689922932b4bfb15a3a7321a2b146b5b7c14bb31 100644 (file)
@@ -24,7 +24,9 @@
 
 #include "beacon.hxx"
 
+#include <simgear/sound/sample_openal.hxx>
 #include <simgear/structure/exception.hxx>
+#include <simgear/debug/logstream.hxx>
 
 // constructor
 FGBeacon::FGBeacon()
@@ -103,13 +105,13 @@ bool FGBeacon::init() {
     return true;
 }
 
-FGBeacon * FGBeacon::_instance = NULL;\r
-\r
-FGBeacon * FGBeacon::instance()\r
-{\r
-    if( _instance == NULL ) {\r
-        _instance = new FGBeacon();\r
-        _instance->init();\r
-    }\r
-    return _instance;\r
-}\r
+FGBeacon * FGBeacon::_instance = NULL;
+
+FGBeacon * FGBeacon::instance()
+{
+    if( _instance == NULL ) {
+        _instance = new FGBeacon();
+        _instance->init();
+    }
+    return _instance;
+}
index b9cd492e4a6bf0d0c757bc60daa0dbb0de85c2cf..be9378c73d19441d60eb5acd876b3d0ce3c3391e 100644 (file)
@@ -39,7 +39,7 @@
 #include <simgear/sound/soundmgr_openal.hxx>
 #include <simgear/sound/xmlsound.hxx>
 
-FGFX::FGFX ( SGSoundMgr *smgr, const string &refname, SGPropertyNode *props ) :
+FGFX::FGFX ( SGSoundMgr *smgr, const std::string &refname, SGPropertyNode *props ) :
     _props( props )
 {
     if (!props) {
@@ -86,7 +86,7 @@ FGFX::init()
 {
     SGPropertyNode *node = _props->getNode("sim/sound", true);
 
-    string path_str = node->getStringValue("path");
+    std::string path_str = node->getStringValue("path");
     if (path_str.empty()) {
         SG_LOG(SG_SOUND, SG_ALERT, "No path in sim/sound/path");
         return;
index 3803f5bc6ad1538d568a6356b63e3277aa77bc24..81fac4f72b6f9fdb8ff443c79125f72d68fed867 100644 (file)
@@ -49,7 +49,7 @@ class FGFX : public SGSampleGroup
 
 public:
 
-    FGFX ( SGSoundMgr *smgr, const string &refname, SGPropertyNode *props = 0 );
+    FGFX ( SGSoundMgr *smgr, const std::string &refname, SGPropertyNode *props = 0 );
     virtual ~FGFX ();
 
     virtual void init ();
index 379c1574881f526370d04408033c54182d5e9a38..f4636db8b40390c7a9dee9477f544eba0db0322a 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "morse.hxx"
 
+#include <simgear/sound/sample_openal.hxx>
 #include <cstring>
 
 static const char DI = '1';
@@ -134,7 +135,7 @@ bool FGMorse::cust_init(const int freq ) {
 
 
 // make a SGSoundSample morse code transmission for the specified string
-SGSoundSample *FGMorse::make_ident( const string& id, const int freq ) {
+SGSoundSample *FGMorse::make_ident( const std::string& id, const int freq ) {
 
     char *idptr = (char *)id.c_str();
 
index c79b4782ef2a800075e638e9478c545923dbadb4..c5fe7cc8fa217039e53210e2691a914a6d4453ca 100644 (file)
@@ -114,7 +114,7 @@ public:
     static FGMorse * instance();
 
     // make a SimpleSound morse code transmission for the specified string
-    SGSoundSample *make_ident( const string& id,
+    SGSoundSample *make_ident( const std::string& id,
                                const int freq = LO_FREQUENCY );
 };
 
index fd2931ef6c5ef01be6a04085c0e488d5143588d5..ab4c213b9a77c8eed0343f66292eb989917903a6 100644 (file)
@@ -36,7 +36,7 @@
 #include <simgear/sound/soundmgr_openal.hxx>
 #include <simgear/sound/sample_openal.hxx>
 
-FGSampleQueue::FGSampleQueue ( SGSoundMgr *smgr, const string &refname ) :
+FGSampleQueue::FGSampleQueue ( SGSoundMgr *smgr, const std::string &refname ) :
     last_enabled( true ),
     last_volume( 0.0 ),
     _enabled( fgGetNode("/sim/sound/chatter/enabled", true) ),
@@ -79,7 +79,7 @@ FGSampleQueue::update (double dt)
         }
 
         // process message queue
-        const string msgid = "Sequential Audio Message";
+        const std::string msgid = "Sequential Audio Message";
         bool now_playing = false;
         if ( exists( msgid ) ) {
             now_playing = is_playing( msgid );
index 3f51104eec2c40ddb41effcb1dba1d09879f0f87..ab18d7c84974155c45a3854884ab0a109d7d7e76 100644 (file)
@@ -47,7 +47,7 @@ class FGSampleQueue : public SGSampleGroup
 
 public:
 
-    FGSampleQueue ( SGSoundMgr *smgr, const string &refname );
+    FGSampleQueue ( SGSoundMgr *smgr, const std::string &refname );
     virtual ~FGSampleQueue ();
 
     virtual void update (double dt);
index d6037106c2797e528d4b0eefe7810086fcb1727e..365be7a9519e166f7ab9b46146bdf079279fa0b7 100644 (file)
@@ -28,6 +28,8 @@
 #  include <config.h>
 #endif
 
+#include "voiceplayer.hxx"
+
 #include <stdio.h>
 #include <string.h>
 #include <assert.h>
 
 #include <simgear/debug/logstream.hxx>
 #include <simgear/sound/soundmgr_openal.hxx>
+#include <simgear/sound/sample_group.hxx>
 #include <simgear/structure/exception.hxx>
 
 using std::string;
-
-#include "voiceplayer.hxx"
+using std::map;
+using std::vector;
 
 ///////////////////////////////////////////////////////////////////////////////
 // constants //////////////////////////////////////////////////////////////////
@@ -148,6 +151,12 @@ FGVoicePlayer::Voice::update ()
     }
 }
 
+FGVoicePlayer::FGVoicePlayer (PropertiesHandler* properties_handler, string _dev_name)
+: volume(1.0), voice(NULL), next_voice(NULL), paused(false),
+dev_name(_dev_name), dir_prefix(""),
+speaker(this,properties_handler)
+{}
+
 FGVoicePlayer::~FGVoicePlayer ()
 {
     vector<Voice *>::iterator iter1;
index 35772b06ba83a9b98d43955ee3aa86967467f1d5..92ed2502f177d1c7a3af349f2187babd06b9471c 100644 (file)
@@ -31,9 +31,6 @@
 #include <simgear/props/props.hxx>
 #include <simgear/props/tiedpropertylist.hxx>
 #include <simgear/sound/sample_openal.hxx>
-using std::vector;
-using std::deque;
-using std::map;
 
 class SGSampleGroup;
 
@@ -202,8 +199,8 @@ public:
 
       float volume;
 
-      vector<Element *>         elements;
-      vector<Element *>::iterator   iter;
+      std::vector<Element *>         elements;
+      std::vector<Element *>::iterator   iter;
 
       inline float get_volume () const { return player->volume * player->speaker.volume * volume; }
   };
@@ -222,14 +219,11 @@ public:
   Voice *voice;
   Voice *next_voice;
   bool paused;
-  string dev_name;
-  string dir_prefix;
-
-  inline FGVoicePlayer (PropertiesHandler* properties_handler, string _dev_name)
-    : volume(1.0), voice(NULL), next_voice(NULL), paused(false),
-      dev_name(_dev_name), dir_prefix(""),
-      speaker(this,properties_handler) {}
+  std::string dev_name;
+  std::string dir_prefix;
 
+  FGVoicePlayer (PropertiesHandler* properties_handler, std::string _dev_name);
+  
   virtual ~FGVoicePlayer ();
 
   void init ();
@@ -272,7 +266,7 @@ public:
     inline void tie (SGPropertyNode *node, const char *name, T *ptr)
     {
     properties_handler->tie
-    (node, (string("speaker/") + name).c_str(),
+      (node, (std::string("speaker/") + name).c_str(),
      RawValueMethodsData<FGVoicePlayer::Speaker,T,T*>
      (*this, ptr,
       &FGVoicePlayer::Speaker::get_property,
@@ -308,8 +302,8 @@ protected:
   SGSharedPtr<SGSampleGroup> _sgr;
   Speaker speaker;
 
-  map< string, SGSharedPtr<SGSoundSample> >   samples;
-  vector<Voice *>         _voices;
+  std::map< std::string, SGSharedPtr<SGSoundSample> >   samples;
+  std::vector<Voice *>         _voices;
 
   bool looped;
   bool next_looped;