aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJaromir Wysoglad2019-07-18 23:33:48 +0200
committerFilippos Karapetis2019-09-01 22:47:55 +0300
commit7c789129316e6afabe9c06fd2cac22d45f44cae4 (patch)
treefd019f07f20d5dee2c50142d6b5b25d6299b25d4 /common
parentd31ffb676a57966248581926366d5eff6dee2ae7 (diff)
downloadscummvm-rg350-7c789129316e6afabe9c06fd2cac22d45f44cae4.tar.gz
scummvm-rg350-7c789129316e6afabe9c06fd2cac22d45f44cae4.tar.bz2
scummvm-rg350-7c789129316e6afabe9c06fd2cac22d45f44cae4.zip
TTS: Move popState to the base class
Diffstat (limited to 'common')
-rw-r--r--common/text-to-speech.cpp17
-rw-r--r--common/text-to-speech.h2
2 files changed, 18 insertions, 1 deletions
diff --git a/common/text-to-speech.cpp b/common/text-to-speech.cpp
index ce9f4a9076..9ff8d50641 100644
--- a/common/text-to-speech.cpp
+++ b/common/text-to-speech.cpp
@@ -109,5 +109,22 @@ void TextToSpeechManager::pushState() {
updateVoices();
}
+bool TextToSpeechManager::popState() {
+ if (_ttsState->_next == nullptr)
+ return true;
+
+ Common::TTSState *oldState = _ttsState;
+ _ttsState = _ttsState->_next;
+
+ delete oldState;
+
+ setLanguage(_ttsState->_language);
+ setPitch(_ttsState->_pitch);
+ setVolume(_ttsState->_volume);
+ setRate(_ttsState->_rate);
+ setVoice(_ttsState->_activeVoice);
+ return false;
+}
+
}
#endif
diff --git a/common/text-to-speech.h b/common/text-to-speech.h
index 589b99834b..d52e1de3d2 100644
--- a/common/text-to-speech.h
+++ b/common/text-to-speech.h
@@ -259,7 +259,7 @@ public:
/**
* Pops the TTS state
*/
- virtual bool popState() { return true; }
+ bool popState();
virtual void freeVoiceData(void *data) {}