SAGA2: Simplify music playback API

This commit is contained in:
Eugene Sandulenko 2021-07-02 00:03:29 +02:00
parent e42615a844
commit 96cd5947fa
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
3 changed files with 5 additions and 20 deletions

View File

@ -96,8 +96,10 @@ void audioInterface::playMe(void) {
audio->queue.playNext();
}
void audioInterface::queueMusic(soundSegment s, decoderSet *, int16 loopFactor, sampleLocation where) {
void audioInterface::playMusic(soundSegment s, int16 loopFactor, sampleLocation where) {
warning("STUB: audioInterface::queueMusic()");
}
void audioInterface::stopMusic(void) {

View File

@ -245,7 +245,7 @@ public:
void playMe(void);
// music calls
void queueMusic(soundSegment s, decoderSet *, int16 loopFactor = 1, sampleLocation where = Here);
void playMusic(soundSegment s, int16 loopFactor = 1, sampleLocation where = Here);
void stopMusic(void);
soundSegment currentMusic(void) {
return playing; // ID of music currently playing

View File

@ -439,25 +439,8 @@ void playMusic(uint32 s) {
currentMidi = s;
Common::SeekableReadStream *stream = loadResourceToStream(musicRes, s, "music data");
Common::DumpFile out;
Common::String path = Common::String::format("./dumps/mus%s.mus", tag2strP(s));
if (out.open(path, true)) {
int size = musicRes->getSize(s, "music data");
byte *buf = (byte *)malloc(size);
stream->read(buf, size);
out.write(buf, size);
out.flush();
out.close();
}
delete stream;
if (hResCheckResID(musicRes, s)) {
audio->queueMusic(s, musicDec, 0);
audio->playMusic(s, 0);
} else
audio->stopMusic();
}