aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2004-04-29 04:24:55 +0000
committerEugene Sandulenko2004-04-29 04:24:55 +0000
commit4ed0d02f05db28f8007637ff429d0e23ec1ee6af (patch)
tree10e4face55ba1cc56821a5508a9fed628e5f079d
parent91f5c00a12d7b613d95d4564972eac5cac339fd9 (diff)
downloadscummvm-rg350-4ed0d02f05db28f8007637ff429d0e23ec1ee6af.tar.gz
scummvm-rg350-4ed0d02f05db28f8007637ff429d0e23ec1ee6af.tar.bz2
scummvm-rg350-4ed0d02f05db28f8007637ff429d0e23ec1ee6af.zip
Now it produces sound, but it's clear that XMIDI parsing is wrong
svn-id: r13673
-rw-r--r--saga/music.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/saga/music.cpp b/saga/music.cpp
index e858b53ac0..a69e2ab117 100644
--- a/saga/music.cpp
+++ b/saga/music.cpp
@@ -30,6 +30,7 @@
#include "game_mod.h"
#include "sound/mididrv.h"
#include "sound/midiparser.h"
+#include "common/config-manager.h"
namespace Saga {
@@ -66,10 +67,12 @@ void MusicPlayer::setVolume(int volume) {
return;
_masterVolume = volume;
-
+
for (int i = 0; i < 16; ++i) {
- if (_channel[i])
+ if (_channel[i]) {
+ debug(0, "%d %d", _channelVolume[i], _masterVolume);
_channel[i]->volume(_channelVolume[i] * _masterVolume / 255);
+ }
}
}
@@ -135,7 +138,6 @@ void MusicPlayer::onTimer(void *refCon) {
}
void MusicPlayer::playMusic() {
- _parser->setMidiDriver(this);
_isPlaying = true;
}
@@ -188,8 +190,10 @@ int Music::play(ulong music_rn, uint flags) {
debug(0, "Music::play(%d, %d)", music_rn, flags);
parser->setTrack(0);
+ parser->setMidiDriver(_player);
_player->_parser = parser;
- _player->playMusic();
+ _player->setVolume(ConfMan.getInt("music_volume") * ConfMan.getInt("master_volume") / 255);
+ _player->playMusic();
return R_SUCCESS;
}