diff options
author | Jaromir Wysoglad | 2019-07-19 09:56:26 +0200 |
---|---|---|
committer | Filippos Karapetis | 2019-09-01 22:47:55 +0300 |
commit | 3027acc12e97fe92f617dd4a95a5861625773c38 (patch) | |
tree | d91e28dc4361f8c47688f363265a5c248daf322a | |
parent | b5d5576f90c177c54170a4e68b251c2fd5219260 (diff) | |
download | scummvm-rg350-3027acc12e97fe92f617dd4a95a5861625773c38.tar.gz scummvm-rg350-3027acc12e97fe92f617dd4a95a5861625773c38.tar.bz2 scummvm-rg350-3027acc12e97fe92f617dd4a95a5861625773c38.zip |
TTS: Minor refactorisations
- Add comment to tts initialization on Windows
- Correctly free the voicesInfo in linux ttsMan
- Remove popState method from linux-text-to-speech.h and
windows-text-to-speech.h
- Add tts to help in configure
- Refactor language setting in gui-manager.cpp
It counted with english being the default language in
ttsMan constructors, which isn't true anymore.
-rw-r--r-- | backends/platform/sdl/win32/win32.cpp | 2 | ||||
-rw-r--r-- | backends/text-to-speech/linux/linux-text-to-speech.cpp | 5 | ||||
-rw-r--r-- | backends/text-to-speech/linux/linux-text-to-speech.h | 2 | ||||
-rw-r--r-- | backends/text-to-speech/windows/windows-text-to-speech.h | 2 | ||||
-rwxr-xr-x | configure | 2 | ||||
-rw-r--r-- | gui/gui-manager.cpp | 7 |
6 files changed, 13 insertions, 7 deletions
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp index 4b0961bc3c..4328773c36 100644 --- a/backends/platform/sdl/win32/win32.cpp +++ b/backends/platform/sdl/win32/win32.cpp @@ -119,6 +119,8 @@ void OSystem_Win32::initBackend() { // Initialize updates manager _updateManager = new Win32UpdateManager(); #endif + + // Initialize text to speech #ifdef USE_WINDOWS_TTS _textToSpeechManager = new WindowsTextToSpeechManager(); #endif diff --git a/backends/text-to-speech/linux/linux-text-to-speech.cpp b/backends/text-to-speech/linux/linux-text-to-speech.cpp index 9abe805767..d6195229c5 100644 --- a/backends/text-to-speech/linux/linux-text-to-speech.cpp +++ b/backends/text-to-speech/linux/linux-text-to-speech.cpp @@ -256,6 +256,11 @@ void LinuxTextToSpeechManager::updateVoices() { createVoice(SPD_CHILD_MALE, Common::TTSVoice::MALE, Common::TTSVoice::CHILD, voiceInfo[6]); createVoice(SPD_CHILD_FEMALE, Common::TTSVoice::FEMALE, Common::TTSVoice::CHILD, voiceInfo[7]); + for (int i = 0; i < 8; i++) + free(voiceInfo[i]); + + free(voiceInfo); + } void LinuxTextToSpeechManager::freeVoiceData(void *data) { diff --git a/backends/text-to-speech/linux/linux-text-to-speech.h b/backends/text-to-speech/linux/linux-text-to-speech.h index feb595095e..a6994f7f40 100644 --- a/backends/text-to-speech/linux/linux-text-to-speech.h +++ b/backends/text-to-speech/linux/linux-text-to-speech.h @@ -63,8 +63,6 @@ public: virtual void setLanguage(Common::String language); - bool popState(); - void updateState(SpeechState state); virtual void freeVoiceData(void *data); diff --git a/backends/text-to-speech/windows/windows-text-to-speech.h b/backends/text-to-speech/windows/windows-text-to-speech.h index 6498c9cc2c..87e4ceb218 100644 --- a/backends/text-to-speech/windows/windows-text-to-speech.h +++ b/backends/text-to-speech/windows/windows-text-to-speech.h @@ -64,8 +64,6 @@ public: virtual void setLanguage(Common::String language); - bool popState(); - virtual void freeVoiceData(void *data); private: @@ -1050,6 +1050,8 @@ Optional Features: --enable-text-console use text console instead of graphical console --enable-verbose-build enable regular echoing of commands during build process + --enable-tts build support for text to speech + --disable-tts don't build support for text to speech --disable-bink don't build with Bink video support --opengl-mode=MODE OpenGL (ES) mode to use for OpenGL output [auto] available modes: auto for autodetection diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp index 82f7591ae8..9f4af81e42 100644 --- a/gui/gui-manager.cpp +++ b/gui/gui-manager.cpp @@ -630,10 +630,11 @@ void GuiManager::initTextToSpeech() { return; #ifdef USE_TRANSLATION Common::String currentLanguage = TransMan.getCurrentLanguage(); - if (currentLanguage != "C") { + if (currentLanguage == "C") + currentLanguage = "en"; + else currentLanguage.setChar('\0', 2); - ttsMan->setLanguage(currentLanguage); - } + ttsMan->setLanguage(currentLanguage); #endif int volume = (ConfMan.getInt("speech_volume", "scummvm") * 100) / 256; if (ConfMan.hasKey("mute", "scummvm") && ConfMan.getBool("mute", "scummvm")) |