]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/AIPlane.cxx
Daniyar ATADJANOV:
[flightgear.git] / src / ATC / AIPlane.cxx
index 8d501910d971d905a30e29922ce9ae69ff40d463..84006294d984304c968cbdaf0c4fe77d3d908754 100644 (file)
@@ -16,7 +16,7 @@
 //
 // 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.
 
 #include <Main/globals.hxx>
 #include <Main/fg_props.hxx>
@@ -29,7 +29,6 @@ SG_USING_STD(string);
 
 
 #include "AIPlane.hxx"
-#include "ATCdisplay.hxx"
 
 FGAIPlane::FGAIPlane() {
        leg = LEG_UNKNOWN;
@@ -182,13 +181,14 @@ void FGAIPlane::ProcessCallback(int code) {
 // 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 FGAIPlane::Render(const string& refname, bool repeating) {
+       fgSetString("/sim/messages/ai-plane", pending_transmission.c_str());
 #ifdef ENABLE_AUDIO_SUPPORT
        voice = (voiceOK && fgGetBool("/sim/sound/voice"));
        if(voice) {
                int len;
                unsigned char* buf = vPtr->WriteMessage((char*)pending_transmission.c_str(), len, voice);
                if(voice) {
-                       SGSoundSample* simple = new SGSoundSample(buf, len, 8000, false);
+                       SGSoundSample* simple = new SGSoundSample(buf, len, 8000);
                        // TODO - at the moment the volume is always set off comm1 
                        // and can't be changed after the transmission has started.
                        simple->set_volume(5.0 * fgGetDouble("/instrumentation/comm[0]/volume"));
@@ -209,7 +209,6 @@ void FGAIPlane::Render(const string& refname, bool repeating) {
                                pending_transmission[i] = ' ';
                        }
                }
-               globals->get_ATC_display()->RegisterSingleMessage(pending_transmission, 0.0);
        }
        playing = true; 
 }
@@ -223,8 +222,6 @@ void FGAIPlane::NoRender(const string& refname) {
                        globals->get_soundmgr()->stop(refname);
                        globals->get_soundmgr()->remove(refname);
 #endif
-               } else {
-                       globals->get_ATC_display()->CancelRepeatingMessage();
                }
                playing = false;
        }