From 8c923b5b76bb17e00132a0b2b2b96de34265fc63 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Tue, 16 Oct 2007 11:27:23 +0000 Subject: modified ffmpeg usage, to use interface same as bass... still needs some tidy up, but its working. :) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@515 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 43 +++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 15 deletions(-) (limited to 'Game/Code/Screens/UScreenSing.pas') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index abb2726e..c32b29e0 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -22,13 +22,15 @@ uses UMenu, ULyrics, TextGL, OpenGL12, +(* {$IFDEF useBASS} bass, {$ENDIF} +*) UThemes, ULCD, UGraphicClasses, - UVideo, +// UVideo, USingScores; type @@ -186,7 +188,8 @@ begin // pause Video if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then - FFmpegTogglePause; + VideoPlayback.Pause; +// FFmpegTogglePause; end else //Pause ausschalten begin @@ -199,7 +202,8 @@ begin // Video if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then - FFmpegTogglePause; + VideoPlayback.Pause; +// FFmpegTogglePause; //SkipSmpeg(PauseTime); Paused := false; @@ -279,7 +283,7 @@ begin Lyrics := TLyricEngine.Create(80,Skin_LyricsT,640,12,80,Skin_LyricsT+36,640,12); - UVideo.Init; + VideoPlayback.Init(); end; procedure TScreenSing.onShow; @@ -432,8 +436,12 @@ begin SkipSmpeg(AktSong.VideoGAP + AktSong.Start);*) // todo: VideoGap and Start time verwursten - FFmpegOpenFile(pAnsiChar(AktSong.Path + AktSong.Video)); - FFmpegSkip(AktSong.VideoGAP + AktSong.Start); +// FFmpegOpenFile(pAnsiChar(AktSong.Path + AktSong.Video)); + VideoPlayback.Open( AktSong.Path + AktSong.Video ); + +// FFmpegSkip(AktSong.VideoGAP + AktSong.Start); + VideoPlayback.position := AktSong.VideoGAP + AktSong.Start; + AktSong.VideoLoaded := true; end; @@ -847,8 +855,11 @@ begin if AktSong.VideoLoaded then begin try - FFmpegGetFrame(Czas.Teraz); - FFmpegDrawGL(ScreenAct); + writeln( 'VideoPlayback.FFmpegGetFrame' ); + VideoPlayback.FFmpegGetFrame(Czas.Teraz); + + writeln( 'VideoPlayback.FFmpegDrawGL' ); + VideoPlayback.FFmpegDrawGL(ScreenAct); // PlaySmpeg; except @@ -862,7 +873,7 @@ begin Log.LogError('Corrupted File: ' + AktSong.Video); try // CloseSmpeg; - FFmpegClose; + VideoPlayback.Close; except end; @@ -1112,14 +1123,15 @@ begin SingDrawBackground; // update and draw movie - if ShowFinish and AktSong.VideoLoaded then begin + if ShowFinish and AktSong.VideoLoaded then + begin try // UpdateSmpeg; // this only draws // todo: find a way to determine, when a new frame is needed // toto: same for the need to skip frames - FFmpegGetFrame(Czas.Teraz); - FFmpegDrawGL(ScreenAct); + VideoPlayback.FFmpegGetFrame(Czas.Teraz); + VideoPlayback.FFmpegDrawGL(ScreenAct); except on E : Exception do begin @@ -1133,7 +1145,7 @@ begin Log.LogError('Corrupted File: ' + AktSong.Video); try // CloseSmpeg; - FFmpegClose; + VideoPlayback.Close; except end; @@ -1213,9 +1225,10 @@ begin Log.LogBenchmark('Creating files', 0); end; - if AktSong.VideoLoaded then begin + if AktSong.VideoLoaded then + begin // CloseSmpeg; - FFmpegClose; + VideoPlayback.Close; AktSong.VideoLoaded := false; // to prevent drawing closed video end; -- cgit v1.2.3