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.
#include <iostream>
#include <simgear/sound/soundmgr_openal.hxx>
+#include <simgear/sound/sample_group.hxx>
#include <simgear/structure/exception.hxx>
#include <Main/globals.hxx>
// 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);
// 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
#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>
#include "adf.hxx"
#include <Sound/morse.hxx>
-
+#include <simgear/sound/sample_group.hxx>
#include <iostream>
#include <string>
#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>
void
DME::init ()
{
- string branch;
+ std::string branch;
branch = "/instrumentation/" + _name;
SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true );
// 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();
#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>
#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>
#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;
#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>
#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>
#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;
#include "audioident.hxx"
#include <simgear/sg_inlines.h>
+#include <simgear/sound/sample_group.hxx>
#include <Main/globals.hxx>
#include <Sound/morse.hxx>
#include "beacon.hxx"
+#include <simgear/sound/sample_openal.hxx>
#include <simgear/structure/exception.hxx>
+#include <simgear/debug/logstream.hxx>
// constructor
FGBeacon::FGBeacon()
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;
+}
#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) {
{
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;
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 ();
#include "morse.hxx"
+#include <simgear/sound/sample_openal.hxx>
#include <cstring>
static const char DI = '1';
// 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();
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 );
};
#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) ),
}
// 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 );
public:
- FGSampleQueue ( SGSoundMgr *smgr, const string &refname );
+ FGSampleQueue ( SGSoundMgr *smgr, const std::string &refname );
virtual ~FGSampleQueue ();
virtual void update (double dt);
# 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 //////////////////////////////////////////////////////////////////
}
}
+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;
#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;
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; }
};
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 ();
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,
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;