mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-06 18:27:26 +00:00
HUGO: Midi are no longer looping. Add handling to default playlist
svn-id: r55084
This commit is contained in:
parent
473ddccf50
commit
5d6771e3df
@ -374,6 +374,7 @@ void HugoEngine::runMachine() {
|
||||
_mouse->mouseHandler(); // Mouse activity - adds to display list
|
||||
_screen->drawStatusText();
|
||||
_screen->displayList(D_DISPLAY); // Blit the display list to screen
|
||||
_sound->checkMusic();
|
||||
break;
|
||||
case V_INVENT: // Accessing inventory
|
||||
_inventory->runInventory(); // Process Inventory state machine
|
||||
|
@ -73,7 +73,7 @@ void MidiPlayer::play(uint8 *stream, uint16 size) {
|
||||
syncVolume();
|
||||
_parser->loadMusic(_midiData, size);
|
||||
_parser->setTrack(0);
|
||||
_isLooping = true;
|
||||
_isLooping = false;
|
||||
_isPlaying = true;
|
||||
_mutex.unlock();
|
||||
}
|
||||
@ -345,4 +345,22 @@ void SoundHandler::syncVolume() {
|
||||
_midiPlayer->syncVolume();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if music is still playing.
|
||||
* If not, select the next track in the playlist and play it
|
||||
*/
|
||||
void SoundHandler::checkMusic() {
|
||||
if (_midiPlayer->isPlaying())
|
||||
return;
|
||||
|
||||
for (int i = 0; _vm->_defltTunes[i] != -1; i++) {
|
||||
if (_vm->_defltTunes[i] == _vm->getGameStatus().song) {
|
||||
if (_vm->_defltTunes[i + 1] != -1)
|
||||
playMusic(_vm->_defltTunes[i + 1]);
|
||||
else
|
||||
playMusic(_vm->_defltTunes[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // End of namespace Hugo
|
||||
|
@ -59,6 +59,7 @@ public:
|
||||
void syncVolume();
|
||||
int getVolume() const { return _masterVolume; }
|
||||
void setLooping(bool loop) { _isLooping = loop; }
|
||||
bool isPlaying() { return _isPlaying; }
|
||||
|
||||
// MidiDriver interface
|
||||
int open();
|
||||
@ -98,6 +99,7 @@ public:
|
||||
void playSound(int16 sound, stereo_t channel, byte priority);
|
||||
void initSound();
|
||||
void syncVolume();
|
||||
void checkMusic();
|
||||
|
||||
private:
|
||||
HugoEngine *_vm;
|
||||
|
Loading…
x
Reference in New Issue
Block a user