aboutsummaryrefslogtreecommitdiff
path: root/backends/text-to-speech/windows
diff options
context:
space:
mode:
authorJaromir Wysoglad2019-08-15 13:24:01 +0200
committerFilippos Karapetis2019-09-01 22:47:55 +0300
commitc402666635b17e6a4b4603f7cfa48d6755e2bfef (patch)
treefc2515c88d10a08dfc68889e57b5f19aed603ce0 /backends/text-to-speech/windows
parent07acdb84336380b6de1cf72a27116b3b60ee3599 (diff)
downloadscummvm-rg350-c402666635b17e6a4b4603f7cfa48d6755e2bfef.tar.gz
scummvm-rg350-c402666635b17e6a4b4603f7cfa48d6755e2bfef.tar.bz2
scummvm-rg350-c402666635b17e6a4b4603f7cfa48d6755e2bfef.zip
TTS: Refactoring
Refactoring as suggested by bluegr on github.
Diffstat (limited to 'backends/text-to-speech/windows')
-rw-r--r--backends/text-to-speech/windows/windows-text-to-speech.cpp8
1 files changed, 4 insertions, 4 deletions
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 c4de02d243..3ef4b55b74 100644
--- a/backends/text-to-speech/windows/windows-text-to-speech.cpp
+++ b/backends/text-to-speech/windows/windows-text-to-speech.cpp
@@ -80,7 +80,7 @@ void WindowsTextToSpeechManager::init() {
// init voice
hr = CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (void **)&_voice);
- if (!SUCCEEDED(hr)) {
+ if (FAILED(hr)) {
warning("Could not initialize TTS voice");
return;
}
@@ -93,7 +93,7 @@ void WindowsTextToSpeechManager::init() {
_voice->SetOutput(_audio, FALSE);
- if (_ttsState->_availableVoices.size() > 0)
+ if (!_ttsState->_availableVoices.empty())
_speechState = READY;
else
_speechState = NO_VOICE;
@@ -156,7 +156,7 @@ DWORD WINAPI startSpeech(LPVOID parameters) {
bool WindowsTextToSpeechManager::say(Common::String str, Action action, Common::String charset) {
if (_speechState == BROKEN || _speechState == NO_VOICE) {
- warning("The tts cannot speak in this state");
+ warning("The text to speech cannot speak in this state");
return true;
}
@@ -455,7 +455,7 @@ void WindowsTextToSpeechManager::updateVoices() {
_voice->SetVolume(_ttsState->_volume);
cpEnum->Release();
- if (_ttsState->_availableVoices.size() == 0) {
+ if (_ttsState->_availableVoices.empty()) {
_speechState = NO_VOICE;
warning("No voice is available");
} else if (_speechState == NO_VOICE)