From 82a567fb55cbbe70d6d3c28f44a9c821b73faa08 Mon Sep 17 00:00:00 2001 From: basisbit Date: Sat, 17 Oct 2015 00:19:39 +0000 Subject: * allow to switch between background-video, background-image and projectM visualization ToDo: fix showing the image when a background was played before. ToDo: rewrite and clean up TScreenSing.LoadNextSong() git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@3145 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenSing.pas | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/screens/UScreenSing.pas b/src/screens/UScreenSing.pas index 50d2d6dd..48f8d8c6 100644 --- a/src/screens/UScreenSing.pas +++ b/src/screens/UScreenSing.pas @@ -78,8 +78,10 @@ type TScreenSing = class(TMenu) private fShowVisualization: boolean; + fShowBackground: boolean; fCurrentVideo: IVideo; fVideoClip: IVideo; + fVideoClipStill: IVideo; fLyricsSync: TLyricsSyncSource; fMusicSync: TMusicSyncSource; fTimebarMode: TTimebarMode; @@ -205,19 +207,29 @@ begin Exit; end; + //ToDo basisbit: get this to work properly // show visualization Ord('V'): begin - fShowVisualization := not fShowVisualization; - - if fShowVisualization then + if (fShowVisualization = false) and (fShowBackground = true) then //only Background should be visible currently, switch to video begin - fCurrentVideo := Visualization.Open(PATH_NONE); - fCurrentVideo.play; + fShowBackground := false; + fCurrentVideo := fVideoClip; end else begin - fCurrentVideo := fVideoClip; + if fShowVisualization then + begin //switch to Background only + fShowBackground := true; + fCurrentVideo := fVideoClipStill; //note: ffmpeg is used to show certain images, too + fShowVisualization := false; + end + else + begin //Video is currently visible, change to visualization + fShowVisualization := true; + fCurrentVideo := Visualization.Open(PATH_NONE); + fCurrentVideo.play; + end; end; Exit; end; @@ -816,12 +828,14 @@ begin {* * set background to: video + * Note: ffmpeg / this is also used for many background formats" *} fShowVisualization := false; VideoFile := CurrentSong.Path.Append(CurrentSong.Video); if (Ini.VideoEnabled = 1) and CurrentSong.Video.IsSet() and VideoFile.IsFile then begin fVideoClip := VideoPlayback.Open(VideoFile); + fVideoClipStill := VideoPlayback.Open(CurrentSong.Path.Append(CurrentSong.Background)); fCurrentVideo := fVideoClip; if (fVideoClip <> nil) then begin @@ -997,7 +1011,7 @@ begin // draw background picture (if any, and if no visualizations) // when we don't check for visualizations the visualizations would // be overdrawn by the picture when {UNDEFINED UseTexture} in UVisualizer - if (not fShowVisualization) then + if (not fShowVisualization) or (fShowBackground) then SingDrawBackground; // set player names (for 2 screens and only singstar skin) -- cgit v1.2.3