AC_CHECK_HEADER(pthread.h)
AM_CONDITIONAL(WITH_THREADS, test "x$with_threads" = "xyes")
-dnl Festival related checks
-# defaults to yes
-AC_ARG_WITH(festival, [ --with-festival Use festival speech software [default=no]], [], [with_festival=no])
-if test "x$with_festival" = "xyes"; then
- AC_DEFINE([USE_FESTIVAL], 1, [Define to enable festival speech software])
-fi
-AM_CONDITIONAL(USE_FESTIVAL, test "x$with_festival" = "xyes")
-
dnl Used by JSBSim to conditionally compile in fgfs interface code
AC_DEFINE([FGFS], 1, [Define so that JSBSim compiles in 'library' mode])
#include "ATCdisplay.hxx"
#include "voice.hxx"
-#ifdef USE_FESTIVAL
-FGVoice *p_Voice = new FGVoice();
-#endif
-
FGATC::FGATC() {
freqClear = true;
receiving = false;
globals->get_soundmgr()->add(simple, refname);
if(repeating) {
globals->get_soundmgr()->play_looped(refname);
-#ifdef USE_FESTIVAL
- p_Voice->send_transcript( msg , refname, 1 );
-#endif
} else {
globals->get_soundmgr()->play_once(refname);
-#ifdef USE_FESTIVAL
- p_Voice->send_transcript( msg , refname, 0 );
-#endif
}
}
delete[] buf;
}
if(repeating) {
globals->get_ATC_display()->RegisterRepeatingMessage(msg);
-#ifdef USE_FESTIVAL
- p_Voice->send_transcript( msg , refname, 1 );
-#endif
} else {
globals->get_ATC_display()->RegisterSingleMessage(msg);
-#ifdef USE_FESTIVAL
- p_Voice->send_transcript( msg, refname, 0 );
-#endif
}
}
_playing = true;
#ifdef ENABLE_AUDIO_SUPPORT
globals->get_soundmgr()->stop(refname);
globals->get_soundmgr()->remove(refname);
-# ifdef USE_FESTIVAL
- p_Voice->send_transcript( "--", refname, 2);
-# endif
#endif
} else {
globals->get_ATC_display()->CancelRepeatingMessage();
noinst_LIBRARIES = libATC.a
-if USE_FESTIVAL
-VOICE_SRC = voice.cxx voice.hxx
-else
-VOICE_SRC =
-endif
-
libATC_a_SOURCES = \
ATC.hxx ATC.cxx \
atis.hxx atis.cxx \
AILocalTraffic.hxx AILocalTraffic.cxx \
AIGAVFRTraffic.hxx AIGAVFRTraffic.cxx \
transmission.hxx transmission.cxx \
- transmissionlist.hxx transmissionlist.cxx \
- $(VOICE_SRC)
+ transmissionlist.hxx transmissionlist.cxx
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src
+++ /dev/null
-
-#include <simgear/compiler.h>
-
-#include <stdio.h>
-#include <malloc.h>
-#include <sys/types.h>
-#include <signal.h>
-#include <netinet/in.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#include <unistd.h>
-#include <setjmp.h>
-#include <string.h>
-#include <strings.h>
-
-#include STL_IOSTREAM
-SG_USING_STD(cout);
-SG_USING_STD(endl);
-
-#define ATC_SERVER_ADDRESS "192.168.2.15" // adddress of machine running festival server
-
-#include "voice.hxx"
-
-int atc_sockfd = 0;
-int result, servlen;
-struct sockaddr_in atc_serv_addr, atc_cli_add;
-
-//FGVoice *p_voice;
-
-bool FGVoice::send_transcript( string trans, string refname, short repeat )
-{
- string msg;
-
- switch ( repeat ) {
- case 0: msg = "S " + refname + ">" + trans;
- break;
- case 1: msg = "R " + refname + ">" + trans;
- break;
- case 2: msg = "X " + refname;
- break;
- }
- // strip out some characters
- for(unsigned int i = 0; i < msg.length(); ++i) {
- if((msg.substr(i,1) == "_") || (msg.substr(i,1) == "/")) {
- msg[i] = ' ';
- }
- }
-
- int len = msg.length();
- if (sendto(atc_sockfd, (char *) msg.c_str(), len, 0, (struct sockaddr *) &atc_serv_addr, servlen ) != len) {
- cout << "network write failed for " << len << " chars" << endl;
- return false;
- }
- printf("Transmit: %s of %d chars\n", msg.c_str(), len );
- return true;
-}
-
-FGVoice::FGVoice()
-{
- string mesg = "Welcome to the FlightGear voice synthesizer";
- string welcome = "welcome ";
-// Init the network stuff here
- printf( "FGVoice created. Connecting to atc sim\n");
- servlen = sizeof( atc_serv_addr );
- bzero((char *) &atc_serv_addr, servlen);
- atc_serv_addr.sin_family = AF_INET;
- atc_serv_addr.sin_addr.s_addr = inet_addr(ATC_SERVER_ADDRESS);
- atc_serv_addr.sin_port = htons(7100);
-
- if ((atc_sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
- {
- printf("Failed to obtain a socket\n");
-// return( 0 );
- }
- else send_transcript( mesg, welcome, 0 );
-}
-
-FGVoice::~FGVoice()
-{
- close( atc_sockfd );
-}
+++ /dev/null
-// atc_voice.hxx
-#include <simgear/constants.h>
-#include <simgear/compiler.h>
-
-#include STL_STRING
-SG_USING_STD(string);
-
-class FGVoice
-{
-public:
- FGVoice();
- ~FGVoice();
-
- bool send_transcript( string trans, string refname, short repeat );
-
-};
-extern FGVoice *p_Voice;
-
THREAD_LIBS =
endif
-if USE_FESTIVAL
-VOICE_LIBS = $(top_builddir)/src/Voice/libVoice.a
-else
-VOICE_LIBS =
-endif
-
if USE_SDL
GFX_CODE = fg_os_sdl.cxx fg_os.hxx
else
$(top_builddir)/src/Airports/libAirports.a \
$(MPLAYER_LIBS) \
$(top_builddir)/src/AIModel/libAIModel.a \
- $(VOICE_LIBS) \
+ $(top_builddir)/src/Voice/libVoice.a \
$(top_builddir)/src/Systems/libSystems.a \
$(top_builddir)/src/Time/libTime.a \
$(top_builddir)/src/Traffic/libTraffic.a \