1
0
Fork 0

Remove old festival code.

This commit is contained in:
ehofman 2006-02-12 17:04:22 +00:00
parent b4572711fa
commit 975887eac8
6 changed files with 2 additions and 143 deletions

View file

@ -118,14 +118,6 @@ fi
AC_CHECK_HEADER(pthread.h) AC_CHECK_HEADER(pthread.h)
AM_CONDITIONAL(WITH_THREADS, test "x$with_threads" = "xyes") 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 dnl Used by JSBSim to conditionally compile in fgfs interface code
AC_DEFINE([FGFS], 1, [Define so that JSBSim compiles in 'library' mode]) AC_DEFINE([FGFS], 1, [Define so that JSBSim compiles in 'library' mode])

View file

@ -31,10 +31,6 @@
#include "ATCdisplay.hxx" #include "ATCdisplay.hxx"
#include "voice.hxx" #include "voice.hxx"
#ifdef USE_FESTIVAL
FGVoice *p_Voice = new FGVoice();
#endif
FGATC::FGATC() { FGATC::FGATC() {
freqClear = true; freqClear = true;
receiving = false; receiving = false;
@ -244,14 +240,8 @@ void FGATC::Render(string& msg, const string& refname, bool repeating) {
globals->get_soundmgr()->add(simple, refname); globals->get_soundmgr()->add(simple, refname);
if(repeating) { if(repeating) {
globals->get_soundmgr()->play_looped(refname); globals->get_soundmgr()->play_looped(refname);
#ifdef USE_FESTIVAL
p_Voice->send_transcript( msg , refname, 1 );
#endif
} else { } else {
globals->get_soundmgr()->play_once(refname); globals->get_soundmgr()->play_once(refname);
#ifdef USE_FESTIVAL
p_Voice->send_transcript( msg , refname, 0 );
#endif
} }
} }
delete[] buf; delete[] buf;
@ -266,14 +256,8 @@ void FGATC::Render(string& msg, const string& refname, bool repeating) {
} }
if(repeating) { if(repeating) {
globals->get_ATC_display()->RegisterRepeatingMessage(msg); globals->get_ATC_display()->RegisterRepeatingMessage(msg);
#ifdef USE_FESTIVAL
p_Voice->send_transcript( msg , refname, 1 );
#endif
} else { } else {
globals->get_ATC_display()->RegisterSingleMessage(msg); globals->get_ATC_display()->RegisterSingleMessage(msg);
#ifdef USE_FESTIVAL
p_Voice->send_transcript( msg, refname, 0 );
#endif
} }
} }
_playing = true; _playing = true;
@ -287,9 +271,6 @@ void FGATC::NoRender(const string& refname) {
#ifdef ENABLE_AUDIO_SUPPORT #ifdef ENABLE_AUDIO_SUPPORT
globals->get_soundmgr()->stop(refname); globals->get_soundmgr()->stop(refname);
globals->get_soundmgr()->remove(refname); globals->get_soundmgr()->remove(refname);
# ifdef USE_FESTIVAL
p_Voice->send_transcript( "--", refname, 2);
# endif
#endif #endif
} else { } else {
globals->get_ATC_display()->CancelRepeatingMessage(); globals->get_ATC_display()->CancelRepeatingMessage();

View file

@ -1,11 +1,5 @@
noinst_LIBRARIES = libATC.a noinst_LIBRARIES = libATC.a
if USE_FESTIVAL
VOICE_SRC = voice.cxx voice.hxx
else
VOICE_SRC =
endif
libATC_a_SOURCES = \ libATC_a_SOURCES = \
ATC.hxx ATC.cxx \ ATC.hxx ATC.cxx \
atis.hxx atis.cxx \ atis.hxx atis.cxx \
@ -25,7 +19,6 @@ libATC_a_SOURCES = \
AILocalTraffic.hxx AILocalTraffic.cxx \ AILocalTraffic.hxx AILocalTraffic.cxx \
AIGAVFRTraffic.hxx AIGAVFRTraffic.cxx \ AIGAVFRTraffic.hxx AIGAVFRTraffic.cxx \
transmission.hxx transmission.cxx \ transmission.hxx transmission.cxx \
transmissionlist.hxx transmissionlist.cxx \ transmissionlist.hxx transmissionlist.cxx
$(VOICE_SRC)
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src

View file

@ -1,83 +0,0 @@
#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 );
}

View file

@ -1,18 +0,0 @@
// 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;

View file

@ -19,12 +19,6 @@ else
THREAD_LIBS = THREAD_LIBS =
endif endif
if USE_FESTIVAL
VOICE_LIBS = $(top_builddir)/src/Voice/libVoice.a
else
VOICE_LIBS =
endif
if USE_SDL if USE_SDL
GFX_CODE = fg_os_sdl.cxx fg_os.hxx GFX_CODE = fg_os_sdl.cxx fg_os.hxx
else else
@ -98,7 +92,7 @@ fgfs_LDADD = \
$(top_builddir)/src/Airports/libAirports.a \ $(top_builddir)/src/Airports/libAirports.a \
$(MPLAYER_LIBS) \ $(MPLAYER_LIBS) \
$(top_builddir)/src/AIModel/libAIModel.a \ $(top_builddir)/src/AIModel/libAIModel.a \
$(VOICE_LIBS) \ $(top_builddir)/src/Voice/libVoice.a \
$(top_builddir)/src/Systems/libSystems.a \ $(top_builddir)/src/Systems/libSystems.a \
$(top_builddir)/src/Time/libTime.a \ $(top_builddir)/src/Time/libTime.a \
$(top_builddir)/src/Traffic/libTraffic.a \ $(top_builddir)/src/Traffic/libTraffic.a \