//
// 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>
// TODO - turn it off if user switches to another freq - keep track of where in message we are etc.
if(_transmit) {
//cout << "transmit\n";
- double user_freq0 = fgGetDouble("/radios/comm[0]/frequencies/selected-mhz");
- double user_freq1 = fgGetDouble("/radios/comm[1]/frequencies/selected-mhz");
+ double user_freq0 = fgGetDouble("/instrumentation/comm[0]/frequencies/selected-mhz");
+ double user_freq1 = fgGetDouble("/instrumentation/comm[1]/frequencies/selected-mhz");
_counter = 0.0;
_max_count = 5.0; // FIXME - hardwired length of message - need to calculate it!
// 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 FGAIPlane::Render(string refname, bool repeating) {
+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/audible")
- && fgGetBool("/sim/sound/voice"));
+ voice = (voiceOK && fgGetBool("/sim/sound/voice"));
if(voice) {
int len;
unsigned char* buf = vPtr->WriteMessage((char*)pending_transmission.c_str(), len, voice);
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("/radios/comm[0]/volume"));
+ simple->set_volume(5.0 * fgGetDouble("/instrumentation/comm[0]/volume"));
globals->get_soundmgr()->add(simple, refname);
if(repeating) {
globals->get_soundmgr()->play_looped(refname);
// Cease rendering a transmission.
-void FGAIPlane::NoRender(string refname) {
+void FGAIPlane::NoRender(const string& refname) {
if(playing) {
if(voice) {
#ifdef ENABLE_AUDIO_SUPPORT