From 5f355734fd8648d03d4e691c7c3bc70cfaeaf0a6 Mon Sep 17 00:00:00 2001 From: Jaromir Wysoglad Date: Wed, 19 Jun 2019 17:59:36 +0200 Subject: SUPERNOVA: Partial merge of the engine I am merging the second engine to the first one. Both should be fully functional as before right now Current merge file status: console: should be done graphics: should be done detection: 0% merged imageid: appears to not be used anywhere, so it may be removed resman: partialy merged rooms: totaly different, 0% merged screen: should be done screenstatic: done sound: partialy done state: a lot different, just started to merge supernova: mostly done --- engines/supernova/sound.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'engines/supernova/sound.cpp') diff --git a/engines/supernova/sound.cpp b/engines/supernova/sound.cpp index e7f3ce83bd..dc1c7c3630 100644 --- a/engines/supernova/sound.cpp +++ b/engines/supernova/sound.cpp @@ -53,6 +53,14 @@ void Sound::play(MusicId index) { -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO); } +void Sound::playSiren() { + Audio::AudioStream *stream = _resMan->getSirenStream(); + + stop(); + _mixer->playStream(Audio::Mixer::kPlainSoundType, &_soundHandle, stream, + -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO); +} + bool Sound::isPlaying() { return _mixer->isSoundHandleActive(_soundHandle); } @@ -62,4 +70,12 @@ void Sound::stop() { _mixer->stopHandle(_soundHandle); } +int Sound::getVolume() { + return _mixer->getChannelVolume(_soundHandle); +} + +void Sound::setVolume(int volume) { + _mixer->setChannelVolume(_soundHandle, volume); +} + } -- cgit v1.2.3