aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorJaromir Wysoglad2019-07-15 21:09:36 -0700
committerFilippos Karapetis2019-09-01 22:47:55 +0300
commit8357e8e6bf909353c3db720ba8fda9cdb0a41933 (patch)
treec8a5735d16f9b82249d4877cb3985238bc4beadf /gui
parent6303f522e180f1474434c75c0e5a4d44b141fe3a (diff)
downloadscummvm-rg350-8357e8e6bf909353c3db720ba8fda9cdb0a41933.tar.gz
scummvm-rg350-8357e8e6bf909353c3db720ba8fda9cdb0a41933.tar.bz2
scummvm-rg350-8357e8e6bf909353c3db720ba8fda9cdb0a41933.zip
TTS: Prepare for windows TTS
Add windows configuration in configure Add basic skeleton to backends Check if ttsMan is initialized in GUI
Diffstat (limited to 'gui')
-rw-r--r--gui/gui-manager.cpp2
-rw-r--r--gui/options.cpp5
-rw-r--r--gui/widget.cpp5
-rw-r--r--gui/widgets/popup.cpp7
4 files changed, 12 insertions, 7 deletions
diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp
index 666e079aa6..c77af7c71f 100644
--- a/gui/gui-manager.cpp
+++ b/gui/gui-manager.cpp
@@ -626,6 +626,8 @@ void GuiManager::setLastMousePos(int16 x, int16 y) {
#ifdef USE_TTS
void GuiManager::initTextToSpeech() {
Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
+ if (ttsMan == nullptr)
+ return;
#ifdef USE_TRANSLATION
Common::String currentLanguage = TransMan.getCurrentLanguage();
if (currentLanguage != "C") {
diff --git a/gui/options.cpp b/gui/options.cpp
index 3195694935..71f8cadd15 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -1800,7 +1800,10 @@ void GlobalOptionsDialog::build() {
_ttsCheckbox->setState(false);
_ttsVoiceSelectionPopUp = new PopUpWidget(tab, "GlobalOptions_Accessibility.TTSVoiceSelection");
- Common::Array<Common::TTSVoice> voices = g_system->getTextToSpeechManager()->getVoicesArray();
+ Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
+ Common::Array<Common::TTSVoice> voices;
+ if (ttsMan != nullptr)
+ voices = ttsMan->getVoicesArray();
for(unsigned i = 0; i < voices.size(); i++) {
_ttsVoiceSelectionPopUp->appendEntry(voices[i].getDescription(), i);
diff --git a/gui/widget.cpp b/gui/widget.cpp
index 3269a5fd6c..f870eb52dc 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -260,7 +260,10 @@ void Widget::read(Common::String str) {
#ifdef USE_TTS
if (ConfMan.hasKey("tts_enabled", "scummvm") &&
ConfMan.getBool("tts_enabled", "scummvm")) {
- g_system->getTextToSpeechManager()->say(str);
+ Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
+ if (ttsMan == nullptr)
+ return;
+ ttsMan->say(str);
}
#endif
}
diff --git a/gui/widgets/popup.cpp b/gui/widgets/popup.cpp
index fe51b39c10..532127a422 100644
--- a/gui/widgets/popup.cpp
+++ b/gui/widgets/popup.cpp
@@ -227,11 +227,8 @@ void PopUpDialog::read(Common::String str) {
#ifdef USE_TTS
if (ConfMan.hasKey("tts_enabled", "scummvm") &&
ConfMan.getBool("tts_enabled", "scummvm")) {
- int volume = (ConfMan.getInt("speech_volume", "scummvm") * 100) / 256;
- if (ConfMan.hasKey("mute", "scummvm") && ConfMan.getBool("mute", "scummvm"))
- volume = 0;
- g_system->getTextToSpeechManager()->setVolume(volume);
- g_system->getTextToSpeechManager()->say(str);
+ Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
+ ttsMan->say(str);
}
#endif
}