X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FATCDCL%2FAIPlane.cxx;h=8fd67d13aeb190b837706c8996e27c339f068b90;hb=8b57675aef4930245a964816469be922e3004287;hp=eecc070d908a6ed8a2f4c1a51f1617afa11996f0;hpb=c56113d0dd0bba31bf1788a79694c966e5a1c477;p=flightgear.git diff --git a/src/ATCDCL/AIPlane.cxx b/src/ATCDCL/AIPlane.cxx index eecc070d9..8fd67d13a 100644 --- a/src/ATCDCL/AIPlane.cxx +++ b/src/ATCDCL/AIPlane.cxx @@ -29,8 +29,6 @@ using std::string; #include "AIPlane.hxx" -SGSampleGroup *FGAIPlane::_sgr = 0; - FGAIPlane::FGAIPlane() { leg = LEG_UNKNOWN; tuned_station = NULL; @@ -51,8 +49,7 @@ FGAIPlane::FGAIPlane() { _rollSuspended = false; if ( !_sgr ) { - SGSoundMgr *smgr; - smgr = (SGSoundMgr *)globals->get_subsystem("soundmgr"); + SGSoundMgr *smgr = globals->get_soundmgr(); _sgr = smgr->find("atc", true); _sgr->tie_to_listener(); } @@ -198,12 +195,10 @@ void FGAIPlane::Render(const string& refname, const float volume, bool repeating #ifdef ENABLE_AUDIO_SUPPORT voice = (voiceOK && fgGetBool("/sim/sound/voice")); if(voice) { - string buf = vPtr->WriteMessage((char*)pending_transmission.c_str(), voice); + size_t len; + void* buf = vPtr->WriteMessage(pending_transmission, &len); if(voice && (volume > 0.05)) { - SGSoundSample* simple = - new SGSoundSample((unsigned char*)buf.c_str(), buf.length(), 8000 ); - // TODO - at the moment the volume can't be changed - // after the transmission has started. + SGSoundSample* simple = new SGSoundSample(&buf, len, 8000 ); simple->set_volume(volume); _sgr->add(simple, refname); _sgr->play(refname, repeating);