mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-24 13:13:58 +00:00
Apply patch from Torbj�rn Andersson to make MP3_CDMUSIC mixer use
music_volume instead of sfx_volume. svn-id: r4611
This commit is contained in:
parent
7a418b540d
commit
8de1ace6c7
1
gui.cpp
1
gui.cpp
@ -609,6 +609,7 @@ void Gui::handleSoundDialogCommand(int cmd)
|
||||
imuse->set_music_volume(_s->_sound_volume_music);
|
||||
imuse->set_master_volume(_s->_sound_volume_master);
|
||||
_s->_mixer->set_volume(_s->_sound_volume_sfx);
|
||||
_s->_mixer->set_music_volume(_s->_sound_volume_music);
|
||||
scummcfg->set("master_volume", _s->_sound_volume_master);
|
||||
scummcfg->set("music_volume", _s->_sound_volume_music);
|
||||
scummcfg->set("sfx_volume", _s->_sound_volume_sfx);
|
||||
|
@ -1525,6 +1525,7 @@ Scumm *Scumm::createFromDetector(GameDetector *detector, OSystem *syst)
|
||||
}
|
||||
}
|
||||
scumm->_mixer->set_volume(128);
|
||||
scumm->_mixer->set_music_volume(128);
|
||||
|
||||
/* HACK !!! */
|
||||
g_scumm = scumm;
|
||||
|
@ -527,6 +527,7 @@ void Scumm::setupSound()
|
||||
se->set_master_volume(_sound_volume_master);
|
||||
se->set_music_volume(_sound_volume_music);
|
||||
_mixer->set_volume(_sound_volume_sfx);
|
||||
_mixer->set_music_volume(_sound_volume_music);
|
||||
}
|
||||
_sfxFile = openSfxFile();
|
||||
}
|
||||
|
@ -201,6 +201,11 @@ void SoundMixer::set_volume(int volume)
|
||||
_volume_table[i] = ((int8)i) * volume;
|
||||
}
|
||||
|
||||
void SoundMixer::set_music_volume(int volume)
|
||||
{
|
||||
_music_volume = volume;
|
||||
}
|
||||
|
||||
#ifdef COMPRESSED_SOUND_FILE
|
||||
bool SoundMixer::Channel::sound_finished()
|
||||
{
|
||||
@ -710,8 +715,7 @@ void SoundMixer::Channel_MP3_CDMUSIC::mix(int16 *data, uint len)
|
||||
{
|
||||
mad_fixed_t const *ch;
|
||||
mad_timer_t frame_duration;
|
||||
const int16 *vol_tab = _mixer->_volume_table;
|
||||
unsigned char volume = ((int)vol_tab[1]) * 32 / 255;
|
||||
unsigned char volume = _mixer->_music_volume * 32 / 255;
|
||||
|
||||
if (_to_be_destroyed) {
|
||||
real_destroy();
|
||||
|
@ -131,6 +131,7 @@ public:
|
||||
uint _output_rate;
|
||||
|
||||
int16 *_volume_table;
|
||||
int _music_volume;
|
||||
|
||||
bool _paused;
|
||||
|
||||
@ -192,6 +193,7 @@ public:
|
||||
|
||||
/* set the volume, 0-256 */
|
||||
void set_volume(int volume);
|
||||
void set_music_volume(int volume);
|
||||
|
||||
/* pause - unpause */
|
||||
void pause(bool paused);
|
||||
|
Loading…
x
Reference in New Issue
Block a user