Option to disable Visual Mode

This commit is contained in:
Serge
2024-10-11 11:15:03 +02:00
parent 3a750c08b5
commit 6c0252156c

View File

@@ -37,6 +37,7 @@ namespace GHelper.Display
Cinema = 25, Cinema = 25,
Vivid = 13, Vivid = 13,
Eyecare = 17, Eyecare = 17,
Disabled = 18,
} }
public static class VisualControl public static class VisualControl
{ {
@@ -175,7 +176,8 @@ namespace GHelper.Display
{ SplendidCommand.FPS, "FPS"}, { SplendidCommand.FPS, "FPS"},
{ SplendidCommand.Cinema, "Cinema"}, { SplendidCommand.Cinema, "Cinema"},
{ SplendidCommand.Vivid, "Vivid" }, { 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) public static void SetVisual(SplendidCommand mode = SplendidCommand.Default, int whiteBalance = DefaultColorTemp, bool init = false)
{ {
if (mode == SplendidCommand.None) return; 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 && ScreenCCD.GetHDRStatus(true)) return;
if (!forceVisual && ScreenNative.GetRefreshRate(ScreenNative.FindLaptopScreen(true)) < 0) return; if (!forceVisual && ScreenNative.GetRefreshRate(ScreenNative.FindLaptopScreen(true)) < 0) return;
@@ -245,12 +247,16 @@ namespace GHelper.Display
if (whiteBalance != DefaultColorTemp && !init) ProcessHelper.RunAsAdmin(); if (whiteBalance != DefaultColorTemp && !init) ProcessHelper.RunAsAdmin();
int? balance; int? balance = null;
int command = 0;
switch (mode) switch (mode)
{ {
case SplendidCommand.Disabled:
command = 2;
break;
case SplendidCommand.Eyecare: case SplendidCommand.Eyecare:
balance = 2; balance = 4;
break; break;
case SplendidCommand.VivoNormal: case SplendidCommand.VivoNormal:
case SplendidCommand.VivoVivid: case SplendidCommand.VivoVivid:
@@ -264,7 +270,7 @@ namespace GHelper.Display
break; break;
} }
var result = RunSplendid(mode, 0, balance); int result = RunSplendid(mode, command, balance);
if (result == 0) return; if (result == 0) return;
if (result == -1) if (result == -1)
{ {