From 69a87842e9b9dcf964ec7704137cc5355a894a40 Mon Sep 17 00:00:00 2001 From: Stefan Date: Sun, 12 Jan 2020 21:40:24 +0100 Subject: [PATCH] Automatic switch of aspect ratio for background If the orig aspect ratio (width / height) is below or equal to 1.5, switch to EAspect.LetterBox. If not, leave it at EAspect.Crop (like in Vocaluxe before). Unfortunately the acinerella library, used by Vocaluxe, don't support reading of the DAR value of the video file. So the SAR value has to be correct in the video file, to see this automatic in action. --- Vocaluxe/Screens/CScreenSing.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 43223d3c..df0648d2 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -804,11 +804,11 @@ namespace Vocaluxe.Screens if (background != null) { SRectF bounds = CSettings.RenderRect; - - if (_VideoAspect == EAspect.Automatic) + + if (_VideoAspect == EAspect.Automatic) _VideoAspect = (background.OrigAspect <= 1.5 ? EAspect.LetterBox : EAspect.Crop); aspect = _VideoAspect; - + SRectF rect = CHelper.FitInBounds(bounds, background.OrigAspect, aspect); CDraw.DrawTexture(background, rect, background.Color, bounds); }