aboutsummaryrefslogtreecommitdiff
path: root/backends/text-to-speech/linux/linux-text-to-speech.cpp
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/linux/linux-text-to-speech.cpp
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/linux/linux-text-to-speech.cpp')
-rw-r--r--backends/text-to-speech/linux/linux-text-to-speech.cpp6
1 files changed, 3 insertions, 3 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 bad45e8e88..eb864eb60e 100644
--- a/backends/text-to-speech/linux/linux-text-to-speech.cpp
+++ b/backends/text-to-speech/linux/linux-text-to-speech.cpp
@@ -76,7 +76,7 @@ void *LinuxTextToSpeechManager::startSpeech(void *p) {
pthread_mutex_unlock(params->mutex);
return NULL;
}
- if(spd_say(_connection, SPD_MESSAGE, params->speechQueue->front().c_str()) == -1) {
+ if (spd_say(_connection, SPD_MESSAGE, params->speechQueue->front().c_str()) == -1) {
// close the connection
if (_connection != 0) {
spd_close(_connection);
@@ -141,7 +141,7 @@ void LinuxTextToSpeechManager::updateState(LinuxTextToSpeechManager::SpeechEvent
case SPEECH_ENDED:
pthread_mutex_lock(&_speechMutex);
_speechQueue.pop_front();
- if (_speechQueue.size() == 0)
+ if (_speechQueue.empty())
_speechState = READY;
else {
// reinitialize if needed
@@ -286,7 +286,7 @@ bool LinuxTextToSpeechManager::resume() {
_threadCreated = false;
}
_speechState = PAUSED;
- if (_speechQueue.size()) {
+ if (!_speechQueue.empty()) {
_speechState = SPEAKING;
startSpeech((void *) &_params);
}