mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Visual modes and Gamut Modes (#2176)
* Visual Modes * UI Tweaks * Eye-care mode * Save visuals in UI * Init fallbacks
This commit is contained in:
@@ -1,14 +1,33 @@
|
||||
using GHelper.Helpers;
|
||||
using GHelper.Mode;
|
||||
using GHelper.USB;
|
||||
using System.Management;
|
||||
|
||||
namespace GHelper.Display
|
||||
{
|
||||
enum SplendidCommand: int
|
||||
public enum SplendidGamut : int
|
||||
{
|
||||
Native = 50,
|
||||
sRGB = 51,
|
||||
DCIP3 = 53,
|
||||
DisplayP3 = 54
|
||||
}
|
||||
|
||||
public enum SplendidCommand: int
|
||||
{
|
||||
Init = 10,
|
||||
DimmingAsus = 9,
|
||||
DimmingVisual = 19
|
||||
DimmingVisual = 19,
|
||||
GamutMode = 200,
|
||||
|
||||
Default = 11,
|
||||
Racing = 21,
|
||||
Scenery = 22,
|
||||
RTS = 23,
|
||||
FPS = 24,
|
||||
Cinema = 25,
|
||||
Vivid = 13,
|
||||
Eyecare = 17,
|
||||
}
|
||||
|
||||
public static class ScreenControl
|
||||
@@ -24,10 +43,71 @@ namespace GHelper.Display
|
||||
|
||||
private static System.Timers.Timer brightnessTimer = new System.Timers.Timer(100);
|
||||
|
||||
|
||||
static ScreenControl () {
|
||||
brightnessTimer.Elapsed += BrightnessTimerTimer_Elapsed;
|
||||
}
|
||||
|
||||
|
||||
public static Dictionary<SplendidGamut, string> GetGamutModes ()
|
||||
{
|
||||
Dictionary<SplendidGamut, string> _modes = new Dictionary<SplendidGamut, string>();
|
||||
|
||||
DirectoryInfo d = new DirectoryInfo("C:\\ProgramData\\ASUS\\GameVisual");
|
||||
FileInfo[] icms = d.GetFiles("*.icm");
|
||||
|
||||
if (icms.Length == 0) return _modes;
|
||||
|
||||
_modes.Add(SplendidGamut.Native, "Gamut - Native");
|
||||
foreach (FileInfo icm in icms)
|
||||
{
|
||||
if (icm.Name.Contains("sRGB")) _modes.Add(SplendidGamut.sRGB, "Gamut - sRGB");
|
||||
if (icm.Name.Contains("DCIP3")) _modes.Add(SplendidGamut.DCIP3, "Gamut - DCIP3");
|
||||
if (icm.Name.Contains("DisplayP3")) _modes.Add(SplendidGamut.DisplayP3, "Gamut - DisplayP3");
|
||||
}
|
||||
return _modes;
|
||||
}
|
||||
|
||||
public static Dictionary<SplendidCommand, string> GetVisualModes()
|
||||
{
|
||||
return new Dictionary<SplendidCommand, string>
|
||||
{
|
||||
{ SplendidCommand.Default, "Default"},
|
||||
{ SplendidCommand.Racing, "Racing"},
|
||||
{ SplendidCommand.Scenery, "Scenery"},
|
||||
{ SplendidCommand.RTS, "RTS/RPG"},
|
||||
{ SplendidCommand.FPS, "FPS"},
|
||||
{ SplendidCommand.Cinema, "Cinema"},
|
||||
{ SplendidCommand.Vivid, "Vivid" },
|
||||
{ SplendidCommand.Eyecare, "Eyecare"}
|
||||
};
|
||||
}
|
||||
|
||||
public static void SetGamut(int mode = 50)
|
||||
{
|
||||
if (RunSplendid(SplendidCommand.GamutMode, 0, mode)) return;
|
||||
|
||||
if (_init)
|
||||
{
|
||||
_init = false;
|
||||
RunSplendid(SplendidCommand.Init);
|
||||
RunSplendid(SplendidCommand.GamutMode, 0, mode);
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetVisual(SplendidCommand mode = SplendidCommand.Default, int whiteBalance = 50)
|
||||
{
|
||||
int balance = mode == SplendidCommand.Eyecare ? 2 : whiteBalance;
|
||||
RunSplendid(mode, 0, balance);
|
||||
|
||||
if (_init)
|
||||
{
|
||||
_init = false;
|
||||
RunSplendid(SplendidCommand.Init);
|
||||
RunSplendid(mode, 0, balance);
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetSplendidPath()
|
||||
{
|
||||
if (_splendidPath == null)
|
||||
|
||||
Reference in New Issue
Block a user