mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 06:08:35 +00:00
GLK: Add speech volume synchronization
This commit is contained in:
parent
5f34aaa52b
commit
98bc3f45bd
@ -38,6 +38,7 @@
|
||||
#include "glk/screen.h"
|
||||
#include "glk/selection.h"
|
||||
#include "glk/sound.h"
|
||||
#include "glk/speech.h"
|
||||
#include "glk/streams.h"
|
||||
#include "glk/windows.h"
|
||||
|
||||
@ -271,6 +272,8 @@ void GlkEngine::syncSoundSettings() {
|
||||
|
||||
int volume = ConfMan.getBool("sfx_mute") ? 0 : CLIP(ConfMan.getInt("sfx_volume"), 0, 255);
|
||||
_mixer->setVolumeForSoundType(Audio::Mixer::kPlainSoundType, volume);
|
||||
|
||||
SpeechManager::syncSoundSettings();
|
||||
}
|
||||
|
||||
void GlkEngine::beep() {
|
||||
|
@ -51,6 +51,19 @@ void SpeechManager::releaseSpeechManagerInstance() {
|
||||
}
|
||||
}
|
||||
|
||||
void SpeechManager::syncSoundSettings() {
|
||||
#if defined(USE_TTS)
|
||||
debugC(kDebugSpeech, "SpeechManager::syncSoundSettings");
|
||||
if (_instance && _instance->_ttsMan) {
|
||||
int volume = (ConfMan.getInt("speech_volume") * 100) / 256;
|
||||
if (ConfMan.hasKey("mute") && ConfMan.getBool("mute"))
|
||||
volume = 0;
|
||||
debugC(kDebugSpeech, "Set speech volume to %d", volume);
|
||||
_instance->_ttsMan->setVolume(volume);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
SpeechManager::SpeechManager() :
|
||||
_refCount(0)
|
||||
#if defined(USE_TTS)
|
||||
@ -68,7 +81,7 @@ SpeechManager::SpeechManager() :
|
||||
_ttsMan->setLanguage(ConfMan.get("language"));
|
||||
// Volume
|
||||
int volume = (ConfMan.getInt("speech_volume") * 100) / 256;
|
||||
if (ConfMan.hasKey("mute", "scummvm") && ConfMan.getBool("mute", "scummvm"))
|
||||
if (ConfMan.hasKey("mute") && ConfMan.getBool("mute"))
|
||||
volume = 0;
|
||||
_ttsMan->setVolume(volume);
|
||||
// Voice
|
||||
|
@ -45,6 +45,8 @@ public:
|
||||
void purgeSpeech(Speech *);
|
||||
void addSpeech(const uint32 *buf, size_t len, Speech *);
|
||||
|
||||
static void syncSoundSettings();
|
||||
|
||||
private:
|
||||
SpeechManager();
|
||||
~SpeechManager();
|
||||
|
Loading…
Reference in New Issue
Block a user