diff options
author | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-04-21 19:17:12 +0000 |
---|---|---|
committer | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-04-21 19:17:12 +0000 |
commit | deba59815a59cc6857c72872b7ae5d6d332bcb48 (patch) | |
tree | 835297b43ba21579b7487a41c3f43be5cf8b8b54 /src/screens/UScreenSong.pas | |
parent | 8be69a4b6a53c84e0e19c7c0ec8dde9a96f03bc0 (diff) | |
download | usdx-deba59815a59cc6857c72872b7ae5d6d332bcb48.tar.gz usdx-deba59815a59cc6857c72872b7ae5d6d332bcb48.tar.xz usdx-deba59815a59cc6857c72872b7ae5d6d332bcb48.zip |
major bug-fix:
- TScreenSong.OnHide() interfered with TScreenSing.OnShow() method as the changes of AudioPlayback in TScreenSing.OnShow() were overwritten by TScreenSong.OnHide() which is called later.
-> moved AudioPlayback initialization to OnShowFinish
- The audio file was opened in TScreenSong, mainly that caused the interference. Now the audio file is opened in TScreenSing. This looks more cleaner too.
- this patch fixes:
- some race conditions
- Dead Smiling Pirates song (and others) were not played from the beginning (especially on linux)
cleanup:
- removed unused MusicPreviewTimer
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2262 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/screens/UScreenSong.pas')
-rw-r--r-- | src/screens/UScreenSong.pas | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/screens/UScreenSong.pas b/src/screens/UScreenSong.pas index a3c5f36a..34589963 100644 --- a/src/screens/UScreenSong.pas +++ b/src/screens/UScreenSong.pas @@ -81,7 +81,6 @@ type HighSpeed: boolean; CoverFull: boolean; CoverTime: real; - MusicPreviewTimer: PSDL_TimerID; CoverX: integer; CoverY: integer; @@ -1534,19 +1533,11 @@ end; procedure TScreenSong.OnHide; begin - // if preview is not loaded: load musicfile now; not on cat-main! - if (PreviewOpened <> Interaction) and not CatSongs.Song[Interaction].main then - AudioPlayback.Open(CatSongs.Song[Interaction].Path.Append(CatSongs.Song[Interaction].Mp3)); - // turn music volume to 100% AudioPlayback.SetVolume(1.0); - // if hide then stop music (for party mode popup on exit) - if (Display.NextScreen <> @ScreenSing) {and - (Display.NextScreen <> @ScreenSingModi) }then - begin - StopMusicPreview(); - end; + // stop preview + StopMusicPreview(); end; procedure TScreenSong.DrawExtensions; @@ -1766,9 +1757,6 @@ end; procedure TScreenSong.StopMusicPreview(); begin - // Cancel pending preview requests - SDL_RemoveTimer(MusicPreviewTimer); - // Stop preview of previous song AudioPlayback.Stop; end; |