diff options
author | Jaromir Wysoglad | 2019-07-14 23:46:00 +0200 |
---|---|---|
committer | Filippos Karapetis | 2019-09-01 22:47:55 +0300 |
commit | 53e0f21adc92908beb1f2308268d4b3e04876887 (patch) | |
tree | 117e9d8bf4ab928a6cb170bf0e03dc15efc423cc /gui | |
parent | 5e44796d6b4c117daf95635588f7d4c83602791e (diff) | |
download | scummvm-rg350-53e0f21adc92908beb1f2308268d4b3e04876887.tar.gz scummvm-rg350-53e0f21adc92908beb1f2308268d4b3e04876887.tar.bz2 scummvm-rg350-53e0f21adc92908beb1f2308268d4b3e04876887.zip |
TTS: Reformat tts volume setting for GUI
Diffstat (limited to 'gui')
-rw-r--r-- | gui/gui-manager.cpp | 5 | ||||
-rw-r--r-- | gui/options.cpp | 4 | ||||
-rw-r--r-- | gui/widget.cpp | 4 |
3 files changed, 9 insertions, 4 deletions
diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp index 8cb201da3a..666e079aa6 100644 --- a/gui/gui-manager.cpp +++ b/gui/gui-manager.cpp @@ -634,6 +634,11 @@ void GuiManager::initTextToSpeech() { ttsMan->setLanguage(currentLanguage); } #endif + int volume = (ConfMan.getInt("speech_volume", "scummvm") * 100) / 256; + if (ConfMan.hasKey("mute", "scummvm") && ConfMan.getBool("mute", "scummvm")) + volume = 0; + ttsMan->setVolume(volume); + int voice; if(ConfMan.hasKey("tts_voice")) voice = ConfMan.getInt("tts_voice", "scummvm"); diff --git a/gui/options.cpp b/gui/options.cpp index 39bf6160ea..3195694935 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -2159,6 +2159,10 @@ void GlobalOptionsDialog::apply() { ttsMan->setLanguage(guiLang); } } + int volume = (ConfMan.getInt("speech_volume", "scummvm") * 100) / 256; + if (ConfMan.hasKey("mute", "scummvm") && ConfMan.getBool("mute", "scummvm")) + volume = 0; + ttsMan->setVolume(volume); ConfMan.setBool("tts_enabled", _ttsCheckbox->getState(), _domain); int selectedVoice = _ttsVoiceSelectionPopUp->getSelectedTag(); ConfMan.setInt("tts_voice", selectedVoice, _domain); diff --git a/gui/widget.cpp b/gui/widget.cpp index d02d64fbeb..3269a5fd6c 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -260,10 +260,6 @@ void Widget::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); } #endif |