[Scummvm-cvs-logs] SF.net SVN: scummvm:[55084] scummvm/trunk/engines/hugo
strangerke at users.sourceforge.net
strangerke at users.sourceforge.net
Sat Jan 1 11:51:58 CET 2011
Revision: 55084
http://scummvm.svn.sourceforge.net/scummvm/?rev=55084&view=rev
Author: strangerke
Date: 2011-01-01 10:51:57 +0000 (Sat, 01 Jan 2011)
Log Message:
-----------
HUGO: Midi are no longer looping. Add handling to default playlist
Modified Paths:
--------------
scummvm/trunk/engines/hugo/hugo.cpp
scummvm/trunk/engines/hugo/sound.cpp
scummvm/trunk/engines/hugo/sound.h
Modified: scummvm/trunk/engines/hugo/hugo.cpp
===================================================================
--- scummvm/trunk/engines/hugo/hugo.cpp 2011-01-01 10:13:42 UTC (rev 55083)
+++ scummvm/trunk/engines/hugo/hugo.cpp 2011-01-01 10:51:57 UTC (rev 55084)
@@ -374,6 +374,7 @@
_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
Modified: scummvm/trunk/engines/hugo/sound.cpp
===================================================================
--- scummvm/trunk/engines/hugo/sound.cpp 2011-01-01 10:13:42 UTC (rev 55083)
+++ scummvm/trunk/engines/hugo/sound.cpp 2011-01-01 10:51:57 UTC (rev 55084)
@@ -73,7 +73,7 @@
syncVolume();
_parser->loadMusic(_midiData, size);
_parser->setTrack(0);
- _isLooping = true;
+ _isLooping = false;
_isPlaying = true;
_mutex.unlock();
}
@@ -345,4 +345,22 @@
_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
Modified: scummvm/trunk/engines/hugo/sound.h
===================================================================
--- scummvm/trunk/engines/hugo/sound.h 2011-01-01 10:13:42 UTC (rev 55083)
+++ scummvm/trunk/engines/hugo/sound.h 2011-01-01 10:51:57 UTC (rev 55084)
@@ -59,6 +59,7 @@
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 @@
void playSound(int16 sound, stereo_t channel, byte priority);
void initSound();
void syncVolume();
+ void checkMusic();
private:
HugoEngine *_vm;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list