#include <iostream>
#include <simgear/sound/soundmgr_openal.hxx>
+#include <simgear/sound/sample_group.hxx>
#include <simgear/structure/exception.hxx>
#include <Main/globals.hxx>
range(0),
_voice(true),
_playing(false),
- _vPtr(NULL),
_sgr(NULL),
_type(INVALID),
_display(false)
// call this from their own Update(...).
void FGATC::update(double dt) {
+ // TODO This doesn't really do anything specific to this instance.
+ // All FGATCs share the same "_sgr" sound group. So this really should
+ // only be done once for all FGATCs.
#ifdef ENABLE_AUDIO_SUPPORT
bool active = _atc_external->getBoolValue() ||
_internal->getBoolValue();
// 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);
_currentMsg = msg;
size_t len;
void* buf = NULL;
- if (!_vPtr)
- _vPtr = GetVoicePointer();
- if (_vPtr)
- buf = _vPtr->WriteMessage((char*)msg.c_str(), &len);
+ FGATCVoice* vPtr = GetVoicePointer();
+ if (vPtr)
+ buf = vPtr->WriteMessage((char*)msg.c_str(), &len);
NoRender(refname);
if(buf) {
try {
// 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