discard the display part. The curly braces wouldn't be spoken anyway,
and the | would be spoken as "vertical bar", which is completely
useless (which is why it had been disabled in the past already).
bool FGVoiceMgr::FGVoice::speak(void)
{
- if (_msg.empty()) {
-// cerr << "<nothing to say>" << endl;
+ if (_msg.empty())
return false;
- }
const string s = _msg.front();
_msg.pop();
-// cerr << "POP " << s;
_sock->writestring(s.c_str());
return !_msg.empty();
}
return;
const string s = node->getStringValue();
- //cerr << "\033[31;1mPUSH [" << s << "]\033[m" << endl;
+ //cerr << "\033[31;1mBEFORE [" << s << "]\033[m" << endl;
string m;
for (unsigned int i = 0; i < s.size(); i++) {
m += ' '; // don't say "vertical bar" or "underscore"
else if (c == '&')
m += " and ";
+ else if (c == '{') {
+ while (i < s.size())
+ if (s[++i] == '|')
+ break;
+ } else if (c == '}')
+ ;
else
m += c;
}
+ //cerr << "\033[31;1mAFTER [" << m << "]\033[m" << endl;
if (_voice->_festival)
m = string("(SayText \"") + m + "\")";