From f153a656e343f043673f97203ca680797196335e Mon Sep 17 00:00:00 2001 From: tobigun Date: Mon, 14 Jan 2008 00:31:20 +0000 Subject: Bugfix: when entering the song-screen the preview on the first song was never played. Reason: Length of audio-file was checked _before_ it was opened. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@793 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSong.pas | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'Game') diff --git a/Game/Code/Screens/UScreenSong.pas b/Game/Code/Screens/UScreenSong.pas index 4b42288a..a54bda9f 100644 --- a/Game/Code/Screens/UScreenSong.pas +++ b/Game/Code/Screens/UScreenSong.pas @@ -1519,19 +1519,20 @@ begin if Length(CatSongs.Song) > 0 then begin //Load Music only when Song Preview is activated - if ( Ini.PreviewVolume <> 0 ) AND - ( AudioPlayback.Length > 1 ) then + if ( Ini.PreviewVolume <> 0 ) then begin - AudioPlayback.SetLoop(false); - AudioPlayback.Open(CatSongs.Song[Interaction].Path + CatSongs.Song[Interaction].Mp3); - AudioPlayback.Position := AudioPlayback.Length / 4; - AudioPlayback.Play; - - //Set Preview Volume - AudioPlayback.SetMusicVolume (Ini.PreviewVolume * 10); - {//if Music Fade is activated, Set Volume to 0 % - if (Ini.PreviewFading <> 0) then - Music.SetMusicVolume(0);} + if(AudioPlayback.Open(CatSongs.Song[Interaction].Path + CatSongs.Song[Interaction].Mp3)) then + begin + AudioPlayback.SetLoop(false); + AudioPlayback.Position := AudioPlayback.Length / 4; + AudioPlayback.Play; + + //Set Preview Volume + AudioPlayback.SetMusicVolume (Ini.PreviewVolume * 10); + {//if Music Fade is activated, Set Volume to 0 % + if (Ini.PreviewFading <> 0) then + Music.SetMusicVolume(0);} + end; end; SetScroll; -- cgit v1.2.3