aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
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) {}