From 8030f1b1483da8a96b7b8ff6bab246ffd3faad38 Mon Sep 17 00:00:00 2001 From: Robert Göffringmann Date: Wed, 7 Jan 2004 17:47:46 +0000 Subject: implemented volume control panel svn-id: r12220 --- sword1/music.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'sword1/music.cpp') diff --git a/sword1/music.cpp b/sword1/music.cpp index fa23acbe46..3895cc95a5 100644 --- a/sword1/music.cpp +++ b/sword1/music.cpp @@ -116,7 +116,7 @@ SwordMusic::SwordMusic(OSystem *system, SoundMixer *pMixer) { _mutex = _system->create_mutex(); _converter[0] = NULL; _converter[1] = NULL; - _volume = 192; + _volumeL = _volumeR = 192; } SwordMusic::~SwordMusic() { @@ -135,11 +135,17 @@ void SwordMusic::mixer(int16 *buf, uint32 len) { Common::StackLock lock(_mutex); for (int i = 0; i < ARRAYSIZE(_handles); i++) if (_handles[i].streaming() && _converter[i]) - _converter[i]->flow(_handles[i], buf, len, _volume, _volume); + _converter[i]->flow(_handles[i], buf, len, _volumeL, _volumeR); } -void SwordMusic::setVolume(uint8 vol) { - _volume = (st_volume_t)vol; +void SwordMusic::setVolume(uint8 volL, uint8 volR) { + _volumeL = (st_volume_t)volL; + _volumeR = (st_volume_t)volR; +} + +void SwordMusic::giveVolume(uint8 *volL, uint8 *volR) { + *volL = (uint8)_volumeL; + *volR = (uint8)_volumeR; } void SwordMusic::startMusic(int32 tuneId, int32 loopFlag) { -- cgit v1.2.3