From 91bd653b55ba141942b7ffbe0a3771233a0848ee Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Wed, 17 Nov 2021 21:12:25 -0800 Subject: [PATCH] Fading: Hopefully fix fading being broken after fading in once, possibly a rounding error that depends on the volume level set before fading in --- Application/PlaybackController.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Application/PlaybackController.m b/Application/PlaybackController.m index 53c1aaf7c..2dc3d2076 100644 --- a/Application/PlaybackController.m +++ b/Application/PlaybackController.m @@ -359,15 +359,16 @@ NSDictionary * makeRGInfo(PlaylistEntry *pe) DLog(@"VOLUME IS %lf", volume); - if (volume < originalVolume) + if (originalVolume - volume > 0.0001) { if ((volume + up) > originalVolume) [audioPlayer volumeUp:(originalVolume - volume)]; else [audioPlayer volumeUp:up]; } - else // volume is at 0 or below, we are ready to release the timer and move on + else // volume is at or near original level, we are ready to release the timer and move on { + [audioPlayer setVolume:originalVolume]; [volumeSlider setDoubleValue: logarithmicToLinear(originalVolume)]; [audioTimer invalidate];