aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroldmud0 <oldmud0@users.noreply.github.com>2021-01-27 18:11:26 -0600
committerGitHub <noreply@github.com>2021-01-27 18:11:26 -0600
commit9c6e703bfc06aec0b6bf1b2056fff5302ed4a241 (patch)
treebc1697436d6e573fffffd6cd1b1f76a7472d37dc
parent580313cbcdce71062a13b6061d1dad623e722a41 (diff)
parent0041352b1876f4b391f2beef7ae05008483b8fb7 (diff)
Merge pull request #432 from AttorneyOnline/revert-416-fix/ghost-music-fade
Fix music fading being completely broken
-rw-r--r--src/aomusicplayer.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/aomusicplayer.cpp b/src/aomusicplayer.cpp
index b36de486..8a3142eb 100644
--- a/src/aomusicplayer.cpp
+++ b/src/aomusicplayer.cpp
@@ -96,7 +96,7 @@ void AOMusicPlayer::play(QString p_song, int channel, bool loop,
BASS_ChannelLock(oldstream, false);
}
- if (effect_flags & FADE_OUT & (m_volume[channel] != 0)) {
+ if ((effect_flags & FADE_OUT) && m_volume[channel] > 0) {
// Fade out the other sample and stop it (due to -1)
BASS_ChannelSlideAttribute(oldstream, BASS_ATTRIB_VOL | BASS_SLIDE_LOG,
-1, 4000);
@@ -116,7 +116,6 @@ void AOMusicPlayer::play(QString p_song, int channel, bool loop,
BASS_ChannelSlideAttribute(newstream, BASS_ATTRIB_VOL,
static_cast<float>(m_volume[channel] / 100.0f),
1000);
-
}
else
this->set_volume(m_volume[channel], channel);
@@ -158,7 +157,6 @@ void CALLBACK loopProc(HSYNC handle, DWORD channel, DWORD data, void *user)
BASS_ChannelLock(channel, false);
}
-
void AOMusicPlayer::set_looping(bool toggle, int channel)
{
m_looping = toggle;