diff options
| author | Crystalwarrior <varsash@gmail.com> | 2019-10-01 04:58:57 +0300 |
|---|---|---|
| committer | Crystalwarrior <varsash@gmail.com> | 2019-10-01 04:58:57 +0300 |
| commit | 292c425c7895afcd8a545afa40dffefea803aabc (patch) | |
| tree | c61e0d2bf4c293fde09dea1f12bc15de4d924f68 | |
| parent | 0eccf1ba2285bfc2ffe812cd0a2cdee778053171 (diff) | |
Fix music volume being weird due to m_volume being shared by ambience and music at the same time
Fix version= being wrong
| -rw-r--r-- | Attorney_Online.pro | 2 | ||||
| -rw-r--r-- | include/aomusicplayer.h | 2 | ||||
| -rw-r--r-- | src/aomusicplayer.cpp | 8 |
3 files changed, 6 insertions, 6 deletions
diff --git a/Attorney_Online.pro b/Attorney_Online.pro index 5daf73f..5d3eda0 100644 --- a/Attorney_Online.pro +++ b/Attorney_Online.pro @@ -3,7 +3,7 @@ QT += core gui widgets network TARGET = Attorney_Online TEMPLATE = app -VERSION = 2.8.0.0 +VERSION = 2.8.0.2 INCLUDEPATH += $$PWD/include DESTDIR = $$PWD/bin diff --git a/include/aomusicplayer.h b/include/aomusicplayer.h index 9ce7485..15014af 100644 --- a/include/aomusicplayer.h +++ b/include/aomusicplayer.h @@ -37,7 +37,7 @@ private: AOApplication *ao_app; bool m_looping = false; - int m_volume = 0; + int m_volume[4] = {0, 0, 0, 0}; // Channel 0 = music // Channel 1 = ambience diff --git a/src/aomusicplayer.cpp b/src/aomusicplayer.cpp index c845948..b44e2e2 100644 --- a/src/aomusicplayer.cpp +++ b/src/aomusicplayer.cpp @@ -66,7 +66,7 @@ void AOMusicPlayer::play(QString p_song, int channel, bool crossfade) //Start it BASS_ChannelPlay(newstream, false); //Fade in our sample - BASS_ChannelSlideAttribute(newstream, BASS_ATTRIB_VOL, static_cast<float>(m_volume / 100.0f), 1000); + BASS_ChannelSlideAttribute(newstream, BASS_ATTRIB_VOL, static_cast<float>(m_volume[channel] / 100.0f), 1000); m_stream_list[channel] = newstream; } @@ -75,7 +75,7 @@ void AOMusicPlayer::play(QString p_song, int channel, bool crossfade) BASS_ChannelStop(m_stream_list[channel]); m_stream_list[channel] = newstream; BASS_ChannelPlay(m_stream_list[channel], false); - this->set_volume(m_volume, channel); + this->set_volume(m_volume[channel], channel); } this->set_looping(m_looping); //Have to do this here due to any crossfading-related changes, etc. @@ -88,8 +88,8 @@ void AOMusicPlayer::stop(int channel) void AOMusicPlayer::set_volume(int p_value, int channel) { - m_volume = p_value; - float volume = m_volume / 100.0f; + m_volume[channel] = p_value; + float volume = m_volume[channel] / 100.0f; if (channel < 0) { for (int n_stream = 0 ; n_stream < m_channelmax ; ++n_stream) |
