mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-09 19:32:11 +00:00
SAGA2: Simplify music playback API
This commit is contained in:
parent
e42615a844
commit
96cd5947fa
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user