From 553ee1ad981964a3689e6510d5813dbff0f2119c Mon Sep 17 00:00:00 2001 From: jaybinks Date: Thu, 6 Dec 2007 10:46:53 +0000 Subject: added "V" key to sing screen to start Visualization... git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@681 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UVideo.pas | 23 +++++++++++------------ Game/Code/Classes/UVisualizer.pas | 26 ++++++++++++-------------- Game/Code/Screens/UScreenSing.pas | 17 +++++++++-------- 3 files changed, 32 insertions(+), 34 deletions(-) (limited to 'Game/Code') diff --git a/Game/Code/Classes/UVideo.pas b/Game/Code/Classes/UVideo.pas index c2e42224..62351e2d 100644 --- a/Game/Code/Classes/UVideo.pas +++ b/Game/Code/Classes/UVideo.pas @@ -96,22 +96,21 @@ type function find_stream_ids( const aFormatCtx : PAVFormatContext; Out aFirstVideoStream, aFirstAudioStream : integer ): boolean; public constructor create(); - function GetName: String; + function GetName: String; + procedure init(); - procedure init(); + function Open( aFileName : string): boolean; // true if succeed + procedure Close; - function Open( aFileName : string): boolean; // true if succeed - procedure Close; + procedure Play; + procedure Pause; + procedure Stop; - procedure Play; - procedure Pause; - procedure Stop; + procedure MoveTo(Time: real); + function getPosition: real; - procedure MoveTo(Time: real); - function getPosition: real; - - procedure GetFrame(Time: Extended); // WANT TO RENAME THESE TO BE MORE GENERIC - procedure DrawGL(Screen: integer); // WANT TO RENAME THESE TO BE MORE GENERIC + procedure GetFrame(Time: Extended); + procedure DrawGL(Screen: integer); end; diff --git a/Game/Code/Classes/UVisualizer.pas b/Game/Code/Classes/UVisualizer.pas index 0f2334ba..6fb5b7a7 100644 --- a/Game/Code/Classes/UVisualizer.pas +++ b/Game/Code/Classes/UVisualizer.pas @@ -63,22 +63,21 @@ type procedure VisualizerTogglePause; public constructor create(); - function GetName: String; + procedure init(); + function GetName: String; - procedure init(); + function Open( aFileName : string): boolean; // true if succeed + procedure Close; - function Open( aFileName : string): boolean; // true if succeed - procedure Close; + procedure Play; + procedure Pause; + procedure Stop; - procedure Play; - procedure Pause; - procedure Stop; + procedure MoveTo(Time: real); + function getPosition: real; - procedure MoveTo(Time: real); - function getPosition: real; - - procedure GetFrame(Time: Extended); // WANT TO RENAME THESE TO BE MORE GENERIC - procedure DrawGL(Screen: integer); // WANT TO RENAME THESE TO BE MORE GENERIC + procedure GetFrame(Time: Extended); + procedure DrawGL(Screen: integer); end; @@ -188,8 +187,7 @@ end; procedure TVideoPlayback_ProjectM.VisualizerTogglePause; begin - if VisualizerPaused then VisualizerPaused:=False - else VisualizerPaused:=True; + VisualizerPaused := not VisualizerPaused; end; procedure TVideoPlayback_ProjectM.GetFrame(Time: Extended); diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index c3bb78d2..b3b92446 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -150,6 +150,13 @@ begin begin Pause; end; + + SDLK_V: //Show Visualization + begin + AktSong.VideoLoaded := not AktSong.VideoLoaded; + VideoPlayback.play; + + end; SDLK_RETURN: begin @@ -183,7 +190,7 @@ begin // pause Video if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then VideoPlayback.Pause; -// FFmpegTogglePause; + end else //Pause ausschalten begin @@ -197,8 +204,6 @@ begin // Video if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then VideoPlayback.Pause; -// FFmpegTogglePause; - //SkipSmpeg(PauseTime); Paused := false; end; @@ -427,14 +432,9 @@ begin // set movie if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then begin -(* OpenSmpeg(AktSong.Path + AktSong.Video); - SkipSmpeg(AktSong.VideoGAP + AktSong.Start);*) - // todo: VideoGap and Start time verwursten -// 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; @@ -1119,6 +1119,7 @@ begin // update and draw movie if ShowFinish and AktSong.VideoLoaded then +// if ShowFinish then begin try // UpdateSmpeg; // this only draws -- cgit v1.2.3