aboutsummaryrefslogtreecommitdiff
path: root/backends/text-to-speech
diff options
context:
space:
mode:
authorJaromir Wysoglad2019-07-18 23:33:48 +0200
committerFilippos Karapetis2019-09-01 22:47:55 +0300
commit7c789129316e6afabe9c06fd2cac22d45f44cae4 (patch)
treefd019f07f20d5dee2c50142d6b5b25d6299b25d4 /backends/text-to-speech
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 'backends/text-to-speech')
-rw-r--r--backends/text-to-speech/linux/linux-text-to-speech.cpp16
-rw-r--r--backends/text-to-speech/linux/linux-text-to-speech.h2
-rw-r--r--backends/text-to-speech/windows/windows-text-to-speech.cpp21
-rw-r--r--backends/text-to-speech/windows/windows-text-to-speech.h2
4 files changed, 2 insertions, 39 deletions
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 4241b76c7b..85faec1c1d 100644
--- a/backends/text-to-speech/linux/linux-text-to-speech.cpp
+++ b/backends/text-to-speech/linux/linux-text-to-speech.cpp
@@ -258,22 +258,6 @@ void LinuxTextToSpeechManager::updateVoices() {
}
-bool LinuxTextToSpeechManager::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);
- return false;
-}
-
void LinuxTextToSpeechManager::freeVoiceData(void *data) {
free(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 1bb3ad5ce2..feb595095e 100644
--- a/backends/text-to-speech/linux/linux-text-to-speech.h
+++ b/backends/text-to-speech/linux/linux-text-to-speech.h
@@ -63,7 +63,7 @@ public:
virtual void setLanguage(Common::String language);
- virtual bool popState();
+ bool popState();
void updateState(SpeechState state);
diff --git a/backends/text-to-speech/windows/windows-text-to-speech.cpp b/backends/text-to-speech/windows/windows-text-to-speech.cpp
index c646b9b3b3..506220a9c7 100644
--- a/backends/text-to-speech/windows/windows-text-to-speech.cpp
+++ b/backends/text-to-speech/windows/windows-text-to-speech.cpp
@@ -347,27 +347,6 @@ void WindowsTextToSpeechManager::updateVoices() {
_speechState = READY;
}
-bool WindowsTextToSpeechManager::popState() {
- if (_ttsState->_next == nullptr)
- return true;
-
- for (Common::TTSVoice *i = _ttsState->_availaibleVoices.begin(); i < _ttsState->_availaibleVoices.end(); i++) {
- ISpObjectToken *voiceToken = (ISpObjectToken *) i->getData();
- voiceToken->Release();
- }
-
- 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;
-}
void WindowsTextToSpeechManager::freeVoiceData(void *data) {
ISpObjectToken *voiceToken = (ISpObjectToken *) data;
voiceToken->Release();
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 848ae854eb..6498c9cc2c 100644
--- a/backends/text-to-speech/windows/windows-text-to-speech.h
+++ b/backends/text-to-speech/windows/windows-text-to-speech.h
@@ -64,7 +64,7 @@ public:
virtual void setLanguage(Common::String language);
- virtual bool popState();
+ bool popState();
virtual void freeVoiceData(void *data);