Skip to content

Commit

Permalink
Visual Mode handling
Browse files Browse the repository at this point in the history
  • Loading branch information
seerge committed Oct 11, 2024
1 parent 6c02521 commit 3fafe63
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions app/Display/VisualControl.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using GHelper.Helpers;
using Microsoft.Win32;
using System.Management;

namespace GHelper.Display
Expand Down Expand Up @@ -100,15 +101,15 @@ public static Dictionary<SplendidGamut, string> GetGamutModes()
foreach (FileInfo icm in icms)
{
//Logger.WriteLine(icm.FullName);

if (icm.Name.Contains("sRGB"))
{
try
{
_modes.Add(isVivo ? SplendidGamut.VivoSRGB : SplendidGamut.sRGB, "Gamut: sRGB");
Logger.WriteLine(icm.FullName + " sRGB");
}
catch
catch
{
}
}
Expand Down Expand Up @@ -207,6 +208,20 @@ public static Dictionary<int, string> GetEyeCares()
};
}

const string GameVisualKey = @"HKEY_CURRENT_USER\Software\ASUS\ARMOURY CRATE Service\GameVisual";
const string GameVisualValue = "ActiveGVStatus";

public static bool IsEnabled()
{
var status = (int?)Registry.GetValue(GameVisualKey, GameVisualValue, 1);
return status > 0;
}

public static void SetRegStatus(int status = 1)
{
Registry.SetValue(GameVisualKey, GameVisualValue, status, RegistryValueKind.DWord);
}

public static void SetGamut(int mode = -1)
{
if (skipGamut) return;
Expand Down Expand Up @@ -327,6 +342,11 @@ private static int RunSplendid(SplendidCommand command, int? param1 = null, int?
var result = ProcessHelper.RunCMD(splendid, (int)command + " " + param1 + " " + param2);
if (result.Contains("file not exist") || (result.Length == 0 && !isVivo)) return 1;
if (result.Contains("return code: -1")) return -1;
if (result.Contains("Visual is disabled"))
{
SetRegStatus(1);
return 1;
}
}

return 0;
Expand Down

0 comments on commit 3fafe63

Please sign in to comment.