AGOS: Added support for Enhanced Soundtrack

This commit is contained in:
Eugene Sandulenko 2024-05-27 20:23:34 +02:00
parent 27da99f608
commit 9f843b2f6c
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
2 changed files with 20 additions and 1 deletions

View File

@ -60,6 +60,10 @@ struct Surface;
class FontSJIS;
}
namespace Audio {
class SeekableAudioStream;
}
namespace AGOS {
enum {
@ -586,6 +590,8 @@ protected:
int _vgaTickCounter;
Audio::SoundHandle _modHandle;
Audio::SoundHandle _digitalMusicHandle;
Audio::SeekableAudioStream *_digitalMusicStream = nullptr;
Sound *_sound;

View File

@ -251,6 +251,18 @@ void AGOSEngine_Simon2::playMusic(uint16 music, uint16 track) {
loadMusic(10, !track10Fix && track > 0, track10Fix || track > 0);
}
#ifdef USE_VORBIS
Common::String trackName = Common::String::format("OGG/track%02d", _lastMusicPlayed);
_digitalMusicStream = Audio::SeekableAudioStream::openStreamFile(trackName.c_str());
if (_digitalMusicStream) {
_mixer->playStream(Audio::Mixer::kMusicSoundType, &_digitalMusicHandle, _digitalMusicStream);
debug(1, "AGOSEngine_Simon2::playMusic(): Playing %s", trackName.c_str());
return;
}
#endif
_midi->play(track);
}
@ -313,7 +325,7 @@ void AGOSEngine_Simon1::playMusic(uint16 music, uint16 track) {
_midi->play();
} else if (getPlatform() == Common::kPlatformAcorn) {
// Acorn floppy version.
// TODO: Add support for Desktop Tracker format in Acorn disk version
}
}
@ -393,6 +405,7 @@ void AGOSEngine::stopMusic() {
_midi->stop();
}
_mixer->stopHandle(_modHandle);
_mixer->stopHandle(_digitalMusicHandle);
}
static const byte elvira1_soundTable[100] = {