aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/sound.cpp
diff options
context:
space:
mode:
authorKari Salminen2007-08-13 21:15:27 +0000
committerKari Salminen2007-08-13 21:15:27 +0000
commit7460eb55a1ef539af96fdb0c2aac785c348f55fd (patch)
treeb02fcbe613779260a7797bb8f0ee7c3b72caa8f6 /engines/agi/sound.cpp
parenteb7dd9970f9f1bf7db34fe88e0d11e617a7d7772 (diff)
downloadscummvm-rg350-7460eb55a1ef539af96fdb0c2aac785c348f55fd.tar.gz
scummvm-rg350-7460eb55a1ef539af96fdb0c2aac785c348f55fd.tar.bz2
scummvm-rg350-7460eb55a1ef539af96fdb0c2aac785c348f55fd.zip
Added a couple of simple AgiSound stop, play, isPlaying-functions.
svn-id: r28598
Diffstat (limited to 'engines/agi/sound.cpp')
-rw-r--r--engines/agi/sound.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp
index 87e3440ad1..3e1bfb9c30 100644
--- a/engines/agi/sound.cpp
+++ b/engines/agi/sound.cpp
@@ -389,8 +389,8 @@ static int noteToPeriod(int note) {
void SoundMgr::unloadSound(int resnum) {
if (_vm->_game.dirSound[resnum].flags & RES_LOADED) {
- if (_vm->_game.sounds[resnum].flags & SOUND_PLAYING) {
- /* FIXME: Stop playing */
+ if (_vm->_game.sounds[resnum].isPlaying()) {
+ _vm->_game.sounds[resnum].stop();
}
/* Release RAW data for sound */
@@ -431,7 +431,7 @@ void SoundMgr::startSound(int resnum, int flag) {
struct SoundIIgsSample *smp;
#endif
- if (_vm->_game.sounds[resnum].flags & SOUND_PLAYING)
+ if (_vm->_game.sounds[resnum].isPlaying())
return;
stopSound();
@@ -444,7 +444,7 @@ void SoundMgr::startSound(int resnum, int flag) {
if (type != AGI_SOUND_SAMPLE && type != AGI_SOUND_MIDI && type != AGI_SOUND_4CHN)
return;
- _vm->_game.sounds[resnum].flags |= SOUND_PLAYING;
+ _vm->_game.sounds[resnum].play();
_vm->_game.sounds[resnum].type = type;
playingSound = resnum;
song = (uint8 *)_vm->_game.sounds[resnum].rdata;
@@ -516,7 +516,7 @@ void SoundMgr::stopSound() {
stopNote(i);
if (playingSound != -1) {
- _vm->_game.sounds[playingSound].flags &= ~SOUND_PLAYING;
+ _vm->_game.sounds[playingSound].stop();
playingSound = -1;
}
}
@@ -734,7 +734,7 @@ void SoundMgr::playSound() {
_vm->setflag(endflag, true);
if (playingSound != -1)
- _vm->_game.sounds[playingSound].flags &= ~SOUND_PLAYING;
+ _vm->_game.sounds[playingSound].stop();
playingSound = -1;
endflag = -1;
}