diff options
author | Jaromir Wysoglad | 2019-07-10 10:49:29 +0200 |
---|---|---|
committer | Filippos Karapetis | 2019-09-01 22:47:55 +0300 |
commit | f78fc85f3a0c92245802098327425d21670d9479 (patch) | |
tree | 4ae190e34e8b90c6dd8ce5a5a0ecedcba62c691e | |
parent | b1b03b18d35d59ad0d712c723a3d4f8c02dcfc18 (diff) | |
download | scummvm-rg350-f78fc85f3a0c92245802098327425d21670d9479.tar.gz scummvm-rg350-f78fc85f3a0c92245802098327425d21670d9479.tar.bz2 scummvm-rg350-f78fc85f3a0c92245802098327425d21670d9479.zip |
TTS: Create a TTS skeleton
-rw-r--r-- | backends/module.mk | 5 | ||||
-rw-r--r-- | backends/platform/sdl/posix/posix.cpp | 9 | ||||
-rw-r--r-- | backends/text-to-speech/linux/linux-text-to-speech.cpp | 37 | ||||
-rw-r--r-- | backends/text-to-speech/linux/linux-text-to-speech.h | 40 | ||||
-rw-r--r-- | common/system.cpp | 9 | ||||
-rw-r--r-- | common/system.h | 23 | ||||
-rw-r--r-- | common/text-to-speech.h | 45 | ||||
-rwxr-xr-x | configure | 24 |
8 files changed, 192 insertions, 0 deletions
diff --git a/backends/module.mk b/backends/module.mk index ee123434d8..42c840436b 100644 --- a/backends/module.mk +++ b/backends/module.mk @@ -344,5 +344,10 @@ MODULE_OBJS += \ saves/recorder/recorder-saves.o endif +ifdef USE_LINUX_TTS +MODULE_OBJS += \ + text-to-speech/linux/linux-text-to-speech.o +endif + # Include common rules include $(srcdir)/rules.mk diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp index b204daa643..50a1ccdc58 100644 --- a/backends/platform/sdl/posix/posix.cpp +++ b/backends/platform/sdl/posix/posix.cpp @@ -54,6 +54,10 @@ #ifdef HAS_POSIX_SPAWN #include <spawn.h> #endif + +#ifdef USE_LINUX_TTS +#include "backends/text-to-speech/linux/linux-text-to-speech.h" +#endif extern char **environ; OSystem_POSIX::OSystem_POSIX(Common::String baseConfigName) @@ -79,6 +83,11 @@ void OSystem_POSIX::initBackend() { if (_savefileManager == 0) _savefileManager = new POSIXSaveFileManager(); +#ifdef USE_LINUX_TTS + // Initialize Text to Speech manager + _textToSpeechManager = new LinuxTextToSpeechManager(); +#endif + // Invoke parent implementation of this method OSystem_SDL::initBackend(); diff --git a/backends/text-to-speech/linux/linux-text-to-speech.cpp b/backends/text-to-speech/linux/linux-text-to-speech.cpp new file mode 100644 index 0000000000..7a8e899595 --- /dev/null +++ b/backends/text-to-speech/linux/linux-text-to-speech.cpp @@ -0,0 +1,37 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + +#include "backends/text-to-speech/linux/linux-text-to-speech.h" + +#if defined(USE_LINUX_TTS) +#include "common/translation.h" + +LinuxTextToSpeechManager::LinuxTextToSpeechManager() { +} + +LinuxTextToSpeechManager::~LinuxTextToSpeechManager() { +} + +#endif diff --git a/backends/text-to-speech/linux/linux-text-to-speech.h b/backends/text-to-speech/linux/linux-text-to-speech.h new file mode 100644 index 0000000000..ab9b2b6fe2 --- /dev/null +++ b/backends/text-to-speech/linux/linux-text-to-speech.h @@ -0,0 +1,40 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef BACKENDS_TEXT_TO_SPEECH_LINUX_H +#define BACKENDS_TEXT_TO_SPEECH_LINUX_H + +#include "common/scummsys.h" + +#if defined(USE_LINUX_TTS) + +#include "common/text-to-speech.h" + +class LinuxTextToSpeechManager : public Common::TextToSpeechManager { +public: + LinuxTextToSpeechManager(); + virtual ~LinuxTextToSpeechManager(); +}; + +#endif + +#endif // BACKENDS_UPDATES_LINUX_H diff --git a/common/system.cpp b/common/system.cpp index 9f6dc60d22..8d1ab84a3d 100644 --- a/common/system.cpp +++ b/common/system.cpp @@ -31,6 +31,7 @@ #include "common/updates.h" #include "common/dialogs.h" #include "common/textconsole.h" +#include "common/text-to-speech.h" #include "backends/audiocd/default/default-audiocd.h" #include "backends/fs/fs-factory.h" @@ -49,6 +50,9 @@ OSystem::OSystem() { #if defined(USE_UPDATES) _updateManager = nullptr; #endif +#if defined(USE_TTS) + _textToSpeechManager = nullptr; +#endif #if defined(USE_SYSDIALOGS) _dialogManager = nullptr; #endif @@ -76,6 +80,11 @@ OSystem::~OSystem() { _updateManager = nullptr; #endif +#if defined(USE_TTS) + delete _textToSpeechManager; + _textToSpeechManager = 0; +#endif + #if defined(USE_SYSDIALOGS) delete _dialogManager; _dialogManager = nullptr; diff --git a/common/system.h b/common/system.h index 77bdcd0815..f17625e215 100644 --- a/common/system.h +++ b/common/system.h @@ -49,6 +49,9 @@ class TaskbarManager; #if defined(USE_UPDATES) class UpdateManager; #endif +#if defined(USE_TTS) +class TextToSpeechManager; +#endif #if defined(USE_SYSDIALOGS) class DialogManager; #endif @@ -184,6 +187,15 @@ protected: Common::UpdateManager *_updateManager; #endif +#if defined(USE_TTS) + /** + * No default value is provided for _textToSpeechManager by OSystem. + * + * @note _textToSpeechManager is deleted by the OSystem destructor. + */ + Common::TextToSpeechManager *_textToSpeechManager; +#endif + #if defined(USE_SYSDIALOGS) /** * No default value is provided for _dialogManager by OSystem. @@ -1325,6 +1337,17 @@ public: } #endif +#if defined(USE_TTS) + /** + * Returns the TextToSpeechManager, used to handle text to speech features. + * + * @return the TextToSpeechManager for the current architecture + */ + virtual Common::TextToSpeechManager *getTextToSpeechManager() { + return _textToSpeechManager; + } +#endif + #if defined(USE_SYSDIALOGS) /** * Returns the DialogManager, used to handle system dialogs. diff --git a/common/text-to-speech.h b/common/text-to-speech.h new file mode 100644 index 0000000000..e95050e3f5 --- /dev/null +++ b/common/text-to-speech.h @@ -0,0 +1,45 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef BACKENDS_TEXT_TO_SPEECH_ABSTRACT_H +#define BACKENDS_TEXT_TO_SPEECH_ABSTRACT_H + +#if defined(USE_TTS) + +namespace Common { + +/** + * The TextToSpeechManager allows speech synthesis. + * + */ +class TextToSpeechManager { +public: + TextToSpeechManager() {} + virtual ~TextToSpeechManager() {} + +}; + +} // End of namespace Common + +#endif + +#endif // BACKENDS_TEXT_TO_SPEECH_ABSTRACT_H @@ -166,6 +166,8 @@ _updates=no _libunity=auto _dialogs=auto _iconv=auto +_tts=auto +_linux_tts=no # Default option behavior yes/no _debug_build=auto _release_build=auto @@ -1250,6 +1252,8 @@ for ac_option in $@; do --disable-updates) _updates=no ;; --enable-libunity) _libunity=yes ;; --disable-libunity) _libunity=no ;; + --enable-tts) _tts=yes ;; + --disable-tts) _tts=no ;; --enable-bink) _bink=yes ;; --disable-bink) _bink=no ;; --opengl-mode=*) @@ -5357,6 +5361,26 @@ fi define_in_config_if_yes $_dialogs 'USE_SYSDIALOGS' # +# Check whether to build TTS integration support +# +echo_n "Building text-to-speech integration support... " +if test "$_tts" = "no"; then + echo "no" +else + case $_host_os in + linux*) + echo "linux" + _tts=yes + _linux_tts=yes + ;; + *) + ;; + esac +fi +define_in_config_if_yes $_tts 'USE_TTS' +define_in_config_if_yes $_linux_tts 'USE_LINUX_TTS' + +# # Check whether to build Bink video support # echo_n "Building Bink video support... " |