From 6c0252156ca7ea2f10be654a064c27f1d6e8dfa6 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Fri, 11 Oct 2024 11:15:03 +0200 Subject: [PATCH] Option to disable Visual Mode --- app/Display/VisualControl.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/app/Display/VisualControl.cs b/app/Display/VisualControl.cs index f1016bbc..34583a16 100644 --- a/app/Display/VisualControl.cs +++ b/app/Display/VisualControl.cs @@ -37,6 +37,7 @@ namespace GHelper.Display Cinema = 25, Vivid = 13, Eyecare = 17, + Disabled = 18, } public static class VisualControl { @@ -175,7 +176,8 @@ namespace GHelper.Display { SplendidCommand.FPS, "FPS"}, { SplendidCommand.Cinema, "Cinema"}, { SplendidCommand.Vivid, "Vivid" }, - { SplendidCommand.Eyecare, "Eyecare"} + { SplendidCommand.Eyecare, "Eyecare"}, + { SplendidCommand.Disabled, "Disabled"} }; } @@ -235,7 +237,7 @@ namespace GHelper.Display public static void SetVisual(SplendidCommand mode = SplendidCommand.Default, int whiteBalance = DefaultColorTemp, bool init = false) { if (mode == SplendidCommand.None) return; - if ((mode == SplendidCommand.Default || mode == SplendidCommand.VivoNormal) && init) return; // Skip default setting on init + if ((mode == SplendidCommand.Disabled || mode == SplendidCommand.Default || mode == SplendidCommand.VivoNormal) && init) return; // Skip default setting on init if (!forceVisual && ScreenCCD.GetHDRStatus(true)) return; if (!forceVisual && ScreenNative.GetRefreshRate(ScreenNative.FindLaptopScreen(true)) < 0) return; @@ -245,12 +247,16 @@ namespace GHelper.Display if (whiteBalance != DefaultColorTemp && !init) ProcessHelper.RunAsAdmin(); - int? balance; + int? balance = null; + int command = 0; switch (mode) { + case SplendidCommand.Disabled: + command = 2; + break; case SplendidCommand.Eyecare: - balance = 2; + balance = 4; break; case SplendidCommand.VivoNormal: case SplendidCommand.VivoVivid: @@ -264,7 +270,7 @@ namespace GHelper.Display break; } - var result = RunSplendid(mode, 0, balance); + int result = RunSplendid(mode, command, balance); if (result == 0) return; if (result == -1) {