From b6991a304487e726141fdbffad0913ed9dd91ef5 Mon Sep 17 00:00:00 2001 From: pelya Date: Sat, 19 Jul 2014 22:49:10 +0300 Subject: [PATCH] Fixed more mousic clipping --- src/music/libtimidity.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/music/libtimidity.cpp b/src/music/libtimidity.cpp index 798f02dda4..02542fc9b9 100644 --- a/src/music/libtimidity.cpp +++ b/src/music/libtimidity.cpp @@ -77,11 +77,12 @@ void Android_MidiMixMusic(Sint16 *stream, int len) /** Factory for the libtimidity driver. */ static FMusicDriver_LibTimidity iFMusicDriver_LibTimidity; +enum { TIMIDITY_MAX_VOLUME = 50 }; const char *MusicDriver_LibTimidity::Start(const char * const *param) { _midi.status = MIDI_STOPPED; _midi.song = NULL; - volume = 99; // Avoid clipping + volume = TIMIDITY_MAX_VOLUME; // Avoid clipping if (mid_init(param == NULL ? NULL : const_cast(param[0])) < 0) { /* If init fails, it can be because no configuration was found. @@ -164,6 +165,6 @@ bool MusicDriver_LibTimidity::IsSongPlaying() void MusicDriver_LibTimidity::SetVolume(byte vol) { - volume = vol * 99 / 127; // I'm not sure about that value + volume = vol * TIMIDITY_MAX_VOLUME / 127; // I'm not sure about that value if (_midi.song != NULL) mid_song_set_volume(_midi.song, vol); }