From 369659dcddc401fb91a10e4da102d2c1a61b6fb9 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Fri, 15 Feb 2008 11:59:56 +0000 Subject: fixed bug with Video playback & Visualization, on 2nd song played. http://trac2.assembla.com/usdx/ticket/31 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@857 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 2342d371..1bf06a7f 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -310,7 +310,8 @@ begin Lyrics := TLyricEngine.Create(80,Skin_LyricsT,640,12,80,Skin_LyricsT+36,640,12); - fCurrentVideoPlaybackEngine.Init(); + if assigned( fCurrentVideoPlaybackEngine ) then + fCurrentVideoPlaybackEngine.Init(); end; procedure TScreenSing.onShow; @@ -446,6 +447,7 @@ begin except success := false; end; + if (not success) then begin //Error Loading Song -> Go back to Song Screen and Show some Error Message @@ -458,15 +460,27 @@ begin CurrentSong.Path := CatSongs.Song[CatSongs.Selected].Path; Exit; end; - + + + + // reset video playback engine, to play Video Clip... + + Visualization.Init(); + + fCurrentVideoPlaybackEngine.Close; + fCurrentVideoPlaybackEngine := VideoPlayback; + // set movie + CurrentSong.VideoLoaded := false; + fShowVisualization := false; if (CurrentSong.Video <> '') and FileExists(CurrentSong.Path + CurrentSong.Video) then begin // todo: VideoGap and Start time verwursten + fCurrentVideoPlaybackEngine.Open( CurrentSong.Path + CurrentSong.Video ); fCurrentVideoPlaybackEngine.position := CurrentSong.VideoGAP + CurrentSong.Start; - + CurrentSong.VideoLoaded := true; end; @@ -887,7 +901,7 @@ begin fCurrentVideoPlaybackEngine.DrawGL(ScreenAct); // PlaySmpeg; except - + on E : Exception do begin //If an Error occurs Reading Video: prevent Video from being Drawn again and Close Video @@ -906,6 +920,7 @@ begin end; end; + // play music (II) AudioPlayback.Play; -- cgit v1.2.3