From a56d5512fdfa81f71acbe6c41af379c5b2827a3c Mon Sep 17 00:00:00 2001
From: basisbit <basisbit@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Mon, 19 Oct 2015 03:22:18 +0000
Subject: * finished implementing "v"-key to switch between video,
 visualization and background

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@3147 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 src/screens/UScreenSing.pas | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

(limited to 'src')

diff --git a/src/screens/UScreenSing.pas b/src/screens/UScreenSing.pas
index f5d5d585..201a2fb5 100644
--- a/src/screens/UScreenSing.pas
+++ b/src/screens/UScreenSing.pas
@@ -81,7 +81,6 @@ type
     fShowBackground:    boolean;
     fCurrentVideo:      IVideo;
     fVideoClip:         IVideo;
-    fVideoClipStill:    IVideo;
     fLyricsSync:        TLyricsSyncSource;
     fMusicSync:         TMusicSyncSource;
     fTimebarMode:       TTimebarMode;
@@ -211,17 +210,17 @@ begin
       // show visualization
       Ord('V'):
       begin
-        if (fShowVisualization = false) and (fShowBackground = true) then //only Background should be visible currently, switch to video
+        if (fShowVisualization = false) and (fShowBackground = true) and (Ini.VideoEnabled = 1) and CurrentSong.Video.IsSet() then //only Background should be visible currently, switch to video
         begin
           fShowBackground := false;
           fCurrentVideo := fVideoClip;
         end
         else
         begin
-          if fShowVisualization then
+          if fShowVisualization and CurrentSong.Background.IsSet() then
           begin //switch to Background only
             fShowBackground := true;
-            fCurrentVideo := fVideoClipStill; //note: ffmpeg is used to show certain images, too
+            fCurrentVideo := nil;
             fShowVisualization := false;
           end
           else
@@ -834,7 +833,6 @@ begin
   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
@@ -850,8 +848,7 @@ begin
   {*
    * set background to: picture
    *}
-  if (CurrentSong.Background.IsSet) and (fVideoClip = nil)
-    and (TVisualizerOption(Ini.VisualizerOption) = voOff)  then
+  if (CurrentSong.Background.IsSet) then
   begin
     BgFile := CurrentSong.Path.Append(CurrentSong.Background);
     try
-- 
cgit v1.2.3