From 5228709d0f2afd28e97ad2ecad784e2fd2f9fa55 Mon Sep 17 00:00:00 2001 From: areff Date: Sat, 16 Feb 2008 15:28:39 +0000 Subject: [PATCH] Fixed fadeout code so it sounds a bit better (timer fires faster, steady drop in volume rather than incremental) --- Application/PlaybackController.m | 4 +--- Audio/AudioPlayer.m | 1 - Playlist/PlaylistView.m | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Application/PlaybackController.m b/Application/PlaybackController.m index 7f7149f08..c60cf15b3 100644 --- a/Application/PlaybackController.m +++ b/Application/PlaybackController.m @@ -292,7 +292,6 @@ double linearToLogarithmic(double linear) containing the current volume before we start fading. */ - (void)audioFader:(NSTimer *)audioTimer { - static int incrementalFader = 10; double volume = [audioPlayer volume]; double originalVolume = [[audioTimer userInfo] doubleValue]; @@ -300,14 +299,13 @@ double linearToLogarithmic(double linear) if (volume > 0.0001) //YAY! Roundoff error! { - [self volumeDown:incrementalFader++]; + [self volumeDown:5]; } else // volume is at 0 or below, we are ready to release the timer and move on { [audioPlayer pause]; [audioPlayer setVolume:originalVolume]; [volumeSlider setDoubleValue: logarithmicToLinear(originalVolume)]; - incrementalFader = 10; [audioTimer invalidate]; } diff --git a/Audio/AudioPlayer.m b/Audio/AudioPlayer.m index cfa4b25ad..d8f9d2a0e 100644 --- a/Audio/AudioPlayer.m +++ b/Audio/AudioPlayer.m @@ -44,7 +44,6 @@ [self play:url withUserInfo:nil]; } - - (void)play:(NSURL *)url withUserInfo:(id)userInfo { if (output) diff --git a/Playlist/PlaylistView.m b/Playlist/PlaylistView.m index 404952b58..d46f15c13 100644 --- a/Playlist/PlaylistView.m +++ b/Playlist/PlaylistView.m @@ -211,7 +211,7 @@ // shift+command+p - fade to pause else if (modifiers == (NSCommandKeyMask | NSShiftKeyMask) && c == 0x70) { - [playbackController fadeOut:self withTime:0.3]; + [playbackController fadeOut:self withTime:0.1]; } else {