Compare commits

...

89 Commits
v0.58 ... v0.64

Author SHA1 Message Date
Serge
d1cceda2ab UI Tweaks 2023-05-19 10:40:16 +02:00
Serge
381b4dd3e8 Merge pull request #409 from TomBonnot/main
Adding French and Português Version
2023-05-19 00:16:11 +02:00
Tom Bonnot
a99dcbf445 Last changes on portuguese-brazilian version + deleting .idea files 2023-05-18 18:12:44 -04:00
Tom Bonnot
4751383a3a Saving progress on pt-br translation 2023-05-18 15:50:32 -04:00
Serge
06320afcb3 Audio visualizer 2023-05-18 18:21:09 +02:00
Serge
0eb6209eda Matrix audio visualizer 2023-05-18 17:42:19 +02:00
Tom Bonnot
a342cab9a6 Final version for French translation 2023-05-18 11:40:02 -04:00
Tom Bonnot
12c6482f61 Adding pt-br and completion of fr version (might need some corrections) 2023-05-18 10:30:05 -04:00
Tom Bonnot
20933bfd8d First commit - French version 2023-05-18 09:51:30 -04:00
Serge
c66c8e9030 Custom keybinding for mode toggle 2023-05-17 20:33:41 +02:00
Serge
14b677514b Update README.md 2023-05-17 17:17:13 +02:00
Serge
ce266ffe07 Merge pull request #402 from IceStormNG/german-translation
German translation
2023-05-17 16:51:04 +02:00
Serge
f29410fa2a Merge branch 'main' of https://github.com/seerge/g-helper 2023-05-17 14:52:09 +02:00
Serge
7117b58746 ACPI events listener 2023-05-17 14:52:06 +02:00
Carsten Braun
0456fa013c Improbed a few translations and fixed typos. 2023-05-17 13:11:11 +02:00
Carsten Braun
6a4aa4e138 Localize fan speed labels in the main window 2023-05-17 10:47:41 +02:00
IceStormNG
d75067b40c Merge branch 'seerge:main' into german-translation 2023-05-17 10:39:02 +02:00
Carsten Braun
de45038911 Translated the App to German. Added a few additional resources for localization 2023-05-16 16:20:00 +02:00
Serge
e23c727e79 Update README.md 2023-05-16 15:44:30 +02:00
Serge
2f2c534278 Merge pull request #394 from lswlc33/main
Update Strings.zh-CN.resx
2023-05-16 15:21:34 +02:00
Serge
bdbec79aba UI tweaks 2023-05-16 15:19:53 +02:00
雪中明月
e3d0a04fa4 Update Strings.zh-CN.resx 2023-05-16 21:12:58 +08:00
Serge
4dd7d41cf4 Merge pull request #392 from IceStormNG/windows-power-plan-changes-optional
Windows power plan changes optional
2023-05-16 14:53:58 +02:00
Carsten Braun
8370217cef This is not a perf config but a regular config value. 2023-05-16 13:34:40 +02:00
Carsten Braun
63c1829edd We can reference the checkbox directly 2023-05-16 13:34:26 +02:00
Carsten Braun
69e5a0448e Accomodate for non-exitent settings value 2023-05-16 13:30:08 +02:00
Carsten Braun
b74b9ae257 Fix nullability 2023-05-16 13:29:48 +02:00
Carsten Braun
71e007d8ad Fixed UI that VS Forms Designer broke 2023-05-16 13:29:31 +02:00
Carsten Braun
6896166c3c Fixed French translation value 2023-05-16 12:36:26 +02:00
Carsten Braun
fd89d9c13a Changed string to "Power Mode" instead of "power plan" 2023-05-16 12:33:15 +02:00
Carsten Braun
8bec153da8 Fixed localization key for french 2023-05-16 12:30:57 +02:00
Carsten Braun
7d968f5f08 Do not set default value. 2023-05-16 12:24:06 +02:00
Carsten Braun
ac5fc3f96e Revert "Revert "Adjustment of Windows Power Overlay is now optional""
This reverts commit 8804d19567.
2023-05-16 12:21:28 +02:00
Serge
8590d0301a Merge pull request #391 from seerge/revert-385-windows-power-plan-changes-optional
Revert "Adjustment of Windows Power Overlay is now optional"
2023-05-16 11:39:41 +02:00
Serge
8804d19567 Revert "Adjustment of Windows Power Overlay is now optional" 2023-05-16 11:38:17 +02:00
Serge
57ce0631a3 Merge pull request #385 from IceStormNG/windows-power-plan-changes-optional
Adjustment of Windows Power Overlay is now optional
2023-05-16 11:30:41 +02:00
Carsten Braun
b796f9f9d4 Moved checkbox to 2023-05-16 10:41:02 +02:00
Serge
f39563fcdf Added touchpad toggle for tablet mode on x13/x16 2023-05-15 23:59:21 +02:00
Serge
853d0c231d Auto update 2023-05-15 22:23:16 +02:00
Serge
df3324d641 Auto update 2023-05-15 22:21:41 +02:00
Serge
75c90ee155 Merge branch 'main' of https://github.com/seerge/g-helper 2023-05-15 22:11:29 +02:00
Serge
4015e0a7f7 Added auto-update checker 2023-05-15 22:11:27 +02:00
Carsten Braun
2a82e41894 Adjustment of Windows Power Overlay is now optional 2023-05-15 13:23:20 +02:00
Serge
a5541dfe10 Update README.md 2023-05-14 19:52:02 +02:00
Serge
fd3a139c47 Aura tweaks 2023-05-14 10:28:48 +02:00
Serge
608b8571d4 Fix for turkish keyboard, tweak for default fan curves 2023-05-13 22:13:00 +02:00
Serge
82a39bcfa1 Merge pull request #375 from IceStormNG/animematrix-for-GU604
Supports AniMeMatrix for Zephyrus M16 2023 (GU604)
2023-05-13 18:24:37 +02:00
Carsten Braun
f9ccd92dc6 Supports AniMeMatrix for Zephyrus M16 2023 (GU604) 2023-05-13 18:10:18 +02:00
Serge
1fadc6c31e Hotfix for possible crash 2023-05-13 09:43:26 +02:00
Serge
0b7dd42a5d UI tweak 2023-05-12 17:21:04 +02:00
Serge
51cd700e25 Improved GPU restart 2023-05-12 15:51:57 +02:00
Serge
7484253007 Merge branch 'main' of https://github.com/seerge/g-helper 2023-05-12 14:06:19 +02:00
Serge
f5cf768017 Display workaround 2023-05-12 14:06:15 +02:00
Serge
ca57669596 NV Clocks tweaks 2023-05-11 19:38:53 +02:00
Serge
35f1a3a25b Clock tweak 2023-05-11 11:18:42 +02:00
Serge
b7afe94b8d Merge branch 'main' of https://github.com/seerge/g-helper 2023-05-11 10:52:41 +02:00
Serge
97c97e8e19 Eco tweaks 2023-05-11 10:52:40 +02:00
Serge
ffc5a6f641 Update README.md 2023-05-11 00:40:30 +02:00
Serge
f87e6c5c88 Update README.md 2023-05-11 00:39:07 +02:00
Serge
22f136fe9e Crash fix 2023-05-11 00:35:03 +02:00
Serge
6d85376734 Extra logs 2023-05-10 23:24:54 +02:00
Serge
62512a7c05 Merge branch 'main' of https://github.com/seerge/g-helper 2023-05-10 18:38:51 +02:00
Serge
7a6301328c GPU Restart 2023-05-10 18:38:49 +02:00
Serge
3c6c4d122d Update README.md 2023-05-10 15:31:20 +02:00
Serge
0142c25929 Overclocking logic, added restart-gpu workaround 2023-05-10 14:06:33 +02:00
Serge
27bc7339d8 Merge pull request #351 from marcelomijas/main
Update Spanish translation
2023-05-09 22:11:44 +02:00
Marcelo Moreno
2985fe378c Small fix... 2023-05-09 22:09:36 +02:00
Marcelo Moreno
71daba25a8 Update Spanish translation
Update the Spanish translation file so it has the same fields as the original "Strings.resx", and translated the new items. :)
2023-05-09 22:01:09 +02:00
Serge
16feeb05a1 Clocks fixes 2023-05-09 18:21:07 +02:00
Serge
c69bf65c84 Clocks fixes 2023-05-09 18:02:59 +02:00
Serge
56ea434626 Aura fix 2023-05-09 17:16:10 +02:00
Serge
432508cfc5 GPU settings tweaks 2023-05-09 16:51:15 +02:00
Serge
deb515066d Merge branch 'main' of https://github.com/seerge/g-helper 2023-05-09 16:13:40 +02:00
Serge
ac19a822f7 GPU eco check 2023-05-09 16:13:35 +02:00
Serge
41caaefc97 Improved aura logging 2023-05-09 16:05:57 +02:00
Serge
a4488fa93b GPU Settings will be saved and auto-applied for each mode 2023-05-09 14:29:52 +02:00
Serge
57c893ef77 XGMobile backlight control 2023-05-08 19:33:49 +02:00
Serge
07020c3561 Extra aura control 2023-05-08 11:00:41 +02:00
Serge
ea134b640b Merge branch 'main' of https://github.com/seerge/g-helper 2023-05-08 10:39:11 +02:00
Serge
5c3f1259f6 Extra Backlight control 2023-05-08 10:39:09 +02:00
Serge
09fd4e4a13 Update README.md 2023-05-08 09:58:36 +02:00
Serge
31c48eb998 Update README.md 2023-05-07 21:12:38 +02:00
Serge
0c1f216853 Update README.md 2023-05-07 20:54:07 +02:00
Serge
83dc491b64 Update README.md 2023-05-07 19:42:52 +02:00
Serge
a75d1ad604 Eco mode overclocking fix 2023-05-07 18:12:15 +02:00
Serge
88f466103e Eco mode overclocking fix 2023-05-07 18:10:18 +02:00
Serge
efb9b73ff5 Anime matrix clock fix 2023-05-07 12:14:49 +02:00
Serge
2c4bdb87aa Typo fix 2023-05-07 11:53:22 +02:00
Serge
832f13d8e4 UI tweaks 2023-05-07 11:17:45 +02:00
139 changed files with 2701 additions and 6605 deletions

View File

@@ -1,4 +1,7 @@
using System.Management;
using System.Diagnostics;
using System.Globalization;
using System.IO.Pipes;
using System.Management;
using System.Runtime.InteropServices;
public class ASUSWmi
@@ -13,6 +16,7 @@ public class ASUSWmi
public const uint UniversalControl = 0x00100021;
public const int KB_Light_Up = 0xc4;
public const int KB_Light_Down = 0xc5;
public const int Touchpad_Toggle = 0x6B;
public const int ChargerMode = 0x0012006C;
@@ -57,6 +61,13 @@ public class ASUSWmi
public const int TUF_KB = 0x00100056;
public const int TUF_KB_STATE = 0x00100057;
public const int TabletState = 0x00060077;
public const int Tablet_Notebook = 0;
public const int Tablet_Tablet = 1;
public const int Tablet_Tent = 2;
public const int Tablet_Rotated = 3;
public const int PerformanceBalanced = 0;
public const int PerformanceTurbo = 1;
public const int PerformanceSilent = 2;
@@ -116,6 +127,42 @@ public class ASUSWmi
private IntPtr handle;
// Event handling attempt
[DllImport("kernel32.dll", SetLastError = true)]
private static extern IntPtr CreateEvent(IntPtr lpEventAttributes, bool bManualReset, bool bInitialState, string lpName);
[DllImport("kernel32.dll", SetLastError = true)]
private static extern bool WaitForSingleObject(IntPtr hHandle, int dwMilliseconds);
private IntPtr eventHandle;
// still works only with asus optimization service on , if someone knows how to get ACPI events from asus without that - let me know
public void RunListener()
{
eventHandle = CreateEvent(IntPtr.Zero, false, false, "ATK Event");
byte[] outBuffer = new byte[16];
byte[] data = new byte[8];
bool result;
data[0] = BitConverter.GetBytes(eventHandle.ToInt32())[0];
data[1] = BitConverter.GetBytes(eventHandle.ToInt32())[1];
result = Control (0x222400, data, outBuffer);
Debug.WriteLine(result + ":" + BitConverter.ToString(data) + "|" + BitConverter.ToString(outBuffer));
while (true)
{
WaitForSingleObject(eventHandle, Timeout.Infinite);
Control(0x222408, new byte[0], outBuffer);
int code = BitConverter.ToInt32(outBuffer);
Logger.WriteLine("Code: " + code);
}
}
public ASUSWmi()
{
handle = CreateFile(
@@ -127,16 +174,18 @@ public class ASUSWmi
FILE_ATTRIBUTE_NORMAL,
IntPtr.Zero
);
if (handle == new IntPtr(-1))
{
throw new Exception("Can't connect to ACPI");
}
}
public void Control(uint dwIoControlCode, byte[] lpInBuffer, byte[] lpOutBuffer)
public bool Control(uint dwIoControlCode, byte[] lpInBuffer, byte[] lpOutBuffer)
{
uint lpBytesReturned = 0;
bool result = DeviceIoControl(
return DeviceIoControl(
handle,
dwIoControlCode,
lpInBuffer,
@@ -204,7 +253,7 @@ public class ASUSWmi
byte[] args = new byte[8];
BitConverter.GetBytes((uint)DeviceID).CopyTo(args, 0);
byte[] status = CallMethod(DSTS, args);
return BitConverter.ToInt32(status, 0) - 65536;
}
@@ -214,10 +263,24 @@ public class ASUSWmi
byte[] args = new byte[8];
BitConverter.GetBytes((uint)DeviceID).CopyTo(args, 0);
BitConverter.GetBytes((uint)Status).CopyTo(args, 4);
return CallMethod(DSTS, args);
}
public int SetGPUEco(int eco)
{
int ecoFlag = DeviceGet(GPUEco);
if (ecoFlag < 0) return -1;
if (ecoFlag == 1 && eco == 0)
return DeviceSet(GPUEco, eco, "GPUEco");
if (ecoFlag == 0 && eco == 1)
return DeviceSet(GPUEco, eco, "GPUEco");
return -1;
}
public int SetFanCurve(int device, byte[] curve)
{
@@ -228,9 +291,7 @@ public class ASUSWmi
int result;
for (int i = 8; i < curve.Length; i++)
{
curve[i] = Math.Max((byte)0, Math.Min((byte)99, curve[i])); // it seems to be a bug, when some old model's bios can go nuts if fan is set to 100%
}
switch (device)
{
@@ -272,6 +333,47 @@ public class ASUSWmi
}
public static bool IsEmptyCurve(byte[] curve) {
return curve.Length != 16 || curve.All(singleByte => singleByte == 0);
}
public static byte[] FixFanCurve(byte[] curve)
{
if (curve.Length != 16) throw new Exception("Incorrect curve");
var points = new Dictionary<byte, byte>();
for (int i = 0; i < 8; i++) points[curve[i]] = curve[i+8];
var pointsFixed = new Dictionary<byte, byte>();
bool fix = false;
int count = 0;
foreach (var pair in points.OrderBy(x => x.Key))
{
if (count == 0 && pair.Key >= 40)
{
fix = true;
pointsFixed.Add(20, 0);
}
if (count != 3 || !fix)
pointsFixed.Add(pair.Key, pair.Value);
count++;
}
count = 0;
foreach (var pair in pointsFixed.OrderBy(x => x.Key))
{
curve[count] =pair.Key;
curve[count+8] = pair.Value;
count++;
}
return curve;
}
public void TUFKeyboardBrightness(int brightness)
{
int param = 0x80 | (brightness & 0x7F);
@@ -321,7 +423,8 @@ public class ASUSWmi
watcher.Scope = new ManagementScope("root\\wmi");
watcher.Query = new WqlEventQuery("SELECT * FROM AsusAtkWmiEvent");
watcher.Start();
} catch
}
catch
{
Logger.WriteLine("Can't connect to ASUS WMI events");
}

View File

@@ -0,0 +1,299 @@
using NAudio.CoreAudioApi;
using NAudio.Wave;
using Starlight.AnimeMatrix;
using System.Diagnostics;
using System.Drawing.Imaging;
using System.Timers;
namespace GHelper.AnimeMatrix
{
public class AniMatrix
{
static System.Timers.Timer matrixTimer = default!;
static AnimeMatrixDevice mat;
static double[] AudioValues;
static WasapiCapture AudioDevice;
public static bool IsValid => mat != null;
private static long lastPresent;
private static List<double> maxes = new List<double>();
public AniMatrix()
{
try
{
mat = new AnimeMatrixDevice();
matrixTimer = new System.Timers.Timer(100);
matrixTimer.Elapsed += MatrixTimer_Elapsed;
}
catch
{
mat.Dispose();
mat = null;
}
}
public void SetMatrix()
{
if (!IsValid) return;
int brightness = Program.config.getConfig("matrix_brightness");
int running = Program.config.getConfig("matrix_running");
bool auto = Program.config.getConfig("matrix_auto") == 1;
if (brightness < 0) brightness = 0;
if (running < 0) running = 0;
BuiltInAnimation animation = new BuiltInAnimation(
(BuiltInAnimation.Running)running,
BuiltInAnimation.Sleeping.Starfield,
BuiltInAnimation.Shutdown.SeeYa,
BuiltInAnimation.Startup.StaticEmergence
);
StopMatrixTimer();
StopMatrixAudio();
mat.SetProvider();
if (brightness == 0 || (auto && SystemInformation.PowerStatus.PowerLineStatus != PowerLineStatus.Online))
{
mat.SetDisplayState(false);
Logger.WriteLine("Matrix Off");
}
else
{
mat.SetDisplayState(true);
mat.SetBrightness((BrightnessMode)brightness);
switch (running)
{
case 2:
SetMatrixPicture(Program.config.getConfigString("matrix_picture"));
break;
case 3:
StartMatrixTimer(1000);
Logger.WriteLine("Matrix Clock");
break;
case 4:
SetMatrixAudio();
break;
default:
mat.SetBuiltInAnimation(true, animation);
Logger.WriteLine("Matrix builtin " + animation.AsByte);
break;
}
//mat.SetBrightness((BrightnessMode)brightness);
}
}
private static void StartMatrixTimer(int interval = 100)
{
matrixTimer.Interval = interval;
matrixTimer.Enabled = true;
}
private static void StopMatrixTimer()
{
matrixTimer.Enabled = false;
}
private static void MatrixTimer_Elapsed(object? sender, ElapsedEventArgs e)
{
if (!IsValid) return;
switch (Program.config.getConfig("matrix_running"))
{
case 2:
mat.PresentNextFrame();
break;
case 3:
mat.PresentClock();
break;
}
}
void StopMatrixAudio()
{
if (AudioDevice is not null)
{
try
{
AudioDevice.StopRecording();
AudioDevice.Dispose();
}
catch (Exception ex)
{
Logger.WriteLine(ex.ToString());
}
}
}
void SetMatrixAudio()
{
if (!IsValid) return;
mat.SetBuiltInAnimation(false);
StopMatrixTimer();
StopMatrixAudio();
try
{
using (var enumerator = new MMDeviceEnumerator())
using (MMDevice device = enumerator.GetDefaultAudioEndpoint(DataFlow.Render, Role.Console))
{
AudioDevice = new WasapiLoopbackCapture(device);
WaveFormat fmt = AudioDevice.WaveFormat;
AudioValues = new double[fmt.SampleRate / 1000];
AudioDevice.DataAvailable += WaveIn_DataAvailable;
AudioDevice.StartRecording();
Logger.WriteLine("Matrix Audio");
}
}
catch (Exception ex)
{
Logger.WriteLine(ex.ToString());
}
}
private void WaveIn_DataAvailable(object? sender, WaveInEventArgs e)
{
int bytesPerSamplePerChannel = AudioDevice.WaveFormat.BitsPerSample / 8;
int bytesPerSample = bytesPerSamplePerChannel * AudioDevice.WaveFormat.Channels;
int bufferSampleCount = e.Buffer.Length / bytesPerSample;
if (bufferSampleCount >= AudioValues.Length)
{
bufferSampleCount = AudioValues.Length;
}
if (bytesPerSamplePerChannel == 2 && AudioDevice.WaveFormat.Encoding == WaveFormatEncoding.Pcm)
{
for (int i = 0; i < bufferSampleCount; i++)
AudioValues[i] = BitConverter.ToInt16(e.Buffer, i * bytesPerSample);
}
else if (bytesPerSamplePerChannel == 4 && AudioDevice.WaveFormat.Encoding == WaveFormatEncoding.Pcm)
{
for (int i = 0; i < bufferSampleCount; i++)
AudioValues[i] = BitConverter.ToInt32(e.Buffer, i * bytesPerSample);
}
else if (bytesPerSamplePerChannel == 4 && AudioDevice.WaveFormat.Encoding == WaveFormatEncoding.IeeeFloat)
{
for (int i = 0; i < bufferSampleCount; i++)
AudioValues[i] = BitConverter.ToSingle(e.Buffer, i * bytesPerSample);
}
double[] paddedAudio = FftSharp.Pad.ZeroPad(AudioValues);
double[] fftMag = FftSharp.Transform.FFTmagnitude(paddedAudio);
PresentAudio(fftMag);
}
private void DrawBar(int pos, double h)
{
int dx = pos * 2;
int dy = 20;
byte color;
for (int y = 0; y < h - (h % 2); y++)
for (int x = 0; x < 2 - (y % 2); x++)
{
//color = (byte)(Math.Min(1,(h - y - 2)*2) * 255);
mat.SetLedPlanar(x + dx, dy + y, (byte)(h * 255 / 30));
mat.SetLedPlanar(x + dx, dy - y, 255);
}
}
void PresentAudio(double[] audio)
{
if (Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastPresent) < 70) return;
lastPresent = DateTimeOffset.Now.ToUnixTimeMilliseconds();
mat.Clear();
int size = 20;
double[] bars = new double[size];
double max = 2, maxAverage;
for (int i = 0; i < size; i++)
{
bars[i] = Math.Sqrt(audio[i] * 10000);
if (bars[i] > max) max = bars[i];
}
maxes.Add(max);
if (maxes.Count > 20) maxes.RemoveAt(0);
maxAverage = maxes.Average();
for (int i = 0; i < size; i++) DrawBar(20 - i, bars[i]*20/maxAverage);
mat.Present();
}
public void SetMatrixPicture(string fileName)
{
if (!IsValid) return;
StopMatrixTimer();
Image image;
try
{
using (var fs = new FileStream(fileName, FileMode.Open))
{
var ms = new MemoryStream();
fs.CopyTo(ms);
ms.Position = 0;
image = Image.FromStream(ms);
}
}
catch
{
Debug.WriteLine("Error loading picture");
return;
}
mat.SetBuiltInAnimation(false);
mat.ClearFrames();
FrameDimension dimension = new FrameDimension(image.FrameDimensionsList[0]);
int frameCount = image.GetFrameCount(dimension);
if (frameCount > 1)
{
for (int i = 0; i < frameCount; i++)
{
image.SelectActiveFrame(dimension, i);
mat.GenerateFrame(image);
mat.AddFrame();
}
StartMatrixTimer();
Logger.WriteLine("Matrix GIF " + fileName);
}
else
{
mat.GenerateFrame(image);
mat.Present();
Logger.WriteLine("Matrix " + fileName);
}
}
}
}

View File

@@ -2,6 +2,7 @@
using Starlight.Communication;
using System.Drawing.Drawing2D;
using System.Drawing.Text;
using System.Globalization;
using System.Management;
using System.Text;
@@ -61,7 +62,8 @@ namespace Starlight.AnimeMatrix
public enum AnimeType
{
GA401,
GA402
GA402,
GU604
}
@@ -88,12 +90,15 @@ namespace Starlight.AnimeMatrix
//public int FullEvenRows = -1;
public int dx = 0;
//Shifts the whole frame to the left or right to align with the diagonal cut
public int frameShiftX = 0;
public int MaxColumns = 34;
private int frameIndex = 0;
private static AnimeType _model = AnimeType.GA402;
public AnimeMatrixDevice()
: base(0x0B05, 0x193B, 640)
{
@@ -112,6 +117,16 @@ namespace Starlight.AnimeMatrix
UpdatePageLength = 410;
}
if (model.Contains("GU604"))
{
_model = AnimeType.GU604;
MaxColumns = 39;
MaxRows = 92;
LedCount = 1711;
frameShiftX = -5;
UpdatePageLength = 630;
}
_displayBuffer = new byte[LedCount];
@@ -173,6 +188,9 @@ namespace Starlight.AnimeMatrix
{
return (y + 1) / 2 - 3;
}
case AnimeType.GU604:
return (int)Math.Ceiling(Math.Max(0, y - 9) / 2F);
default:
return (int)Math.Ceiling(Math.Max(0, y - 11) / 2F);
}
@@ -184,6 +202,8 @@ namespace Starlight.AnimeMatrix
{
case AnimeType.GA401:
return 33;
case AnimeType.GU604:
return 39;
default:
return 34;
}
@@ -226,7 +246,7 @@ namespace Starlight.AnimeMatrix
if (!IsRowInRange(y)) return;
if (x >= FirstX(y) && x < Width(y))
SetLedLinear(RowToLinearAddress(y) - FirstX(y) + x + dx, value);
SetLedLinear(RowToLinearAddress(y) - FirstX(y) + x + dx + frameShiftX, value);
}
public void WakeUp()
@@ -325,13 +345,21 @@ namespace Starlight.AnimeMatrix
public void PresentClock()
{
int second = DateTime.Now.Second;
string time;
if (CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern.Contains("H"))
PresentTextDiagonal(DateTime.Now.ToString("H" + ((second % 2 == 0) ? ":" : " ") + "mm"));
time = DateTime.Now.ToString("H" + ((second % 2 == 0) ? ":" : " ") + "mm");
else
PresentTextDiagonal(DateTime.Now.ToString("h" + ((second % 2 == 0) ? ":" : " ") + "mmtt"));
time = DateTime.Now.ToString("h" + ((second % 2 == 0) ? ":" : " ") + "mmtt");
if (_model == AnimeType.GA401)
PresentText(time);
else
PresentTextDiagonal(time);
}
public void PresentText(string text1, string text2 = "")
{
using (Bitmap bmp = new Bitmap(MaxColumns * 3, MaxRows))
@@ -341,14 +369,14 @@ namespace Starlight.AnimeMatrix
g.CompositingQuality = CompositingQuality.HighQuality;
g.SmoothingMode = SmoothingMode.AntiAlias;
using (Font font = new Font("Arial", 24F, GraphicsUnit.Pixel))
using (Font font = new Font("Consolas", 24F, FontStyle.Regular, GraphicsUnit.Pixel))
{
SizeF textSize = g.MeasureString(text1, font);
g.DrawString(text1, font, Brushes.White, (MaxColumns * 3 - textSize.Width) + 3, -3);
g.DrawString(text1, font, Brushes.White, (MaxColumns * 3 - textSize.Width) + 3, -4);
}
if (text2.Length > 0)
using (Font font = new Font("Arial", 18F, GraphicsUnit.Pixel))
using (Font font = new Font("Consolas", 18F, GraphicsUnit.Pixel))
{
SizeF textSize = g.MeasureString(text2, font);
g.DrawString(text2, font, Brushes.White, (MaxColumns * 3 - textSize.Width) + 1, 25);
@@ -419,6 +447,24 @@ namespace Starlight.AnimeMatrix
Clear();
InstalledFontCollection installedFontCollection = new InstalledFontCollection();
string familyName;
string familyList = "";
FontFamily[] fontFamilies;
// Get the array of FontFamily objects.
fontFamilies = installedFontCollection.Families;
int count = fontFamilies.Length;
for (int j = 0; j < count; ++j)
{
familyName = fontFamilies[j].Name;
familyList = familyList + familyName;
familyList = familyList + ", ";
}
int maxX = (int)Math.Sqrt(MaxRows * MaxRows + MaxColumns * MaxColumns);
using (Bitmap bmp = new Bitmap(maxX, MaxRows))
@@ -428,10 +474,10 @@ namespace Starlight.AnimeMatrix
g.CompositingQuality = CompositingQuality.HighQuality;
g.SmoothingMode = SmoothingMode.AntiAlias;
using (Font font = new Font("Calibri", 14F, GraphicsUnit.Pixel))
using (Font font = new Font("Consolas", 13F, FontStyle.Regular, GraphicsUnit.Pixel))
{
SizeF textSize = g.MeasureString(text, font);
g.DrawString(text, font, Brushes.White, 4, 0);
g.DrawString(text, font, Brushes.White, 4, 1);
}
}

View File

@@ -1,6 +1,6 @@
using HidLibrary;
using Microsoft.Win32;
using System.Diagnostics;
using static Starlight.AnimeMatrix.BuiltInAnimation;
namespace GHelper
{
@@ -55,7 +55,7 @@ namespace GHelper
static byte[] MESSAGE_SET = { 0x5d, 0xb5, 0, 0, 0 };
static byte[] MESSAGE_APPLY = { 0x5d, 0xb4 };
static int[] deviceIds = { 0x1a30, 0x1854, 0x1869, 0x1866, 0x19b6, 0x1822, 0x1837, 0x1854, 0x184a, 0x183d, 0x8502, 0x1807, 0x17e0 };
static int[] deviceIds = { 0x1a30, 0x1854, 0x1869, 0x1866, 0x19b6, 0x1822, 0x1837, 0x1854, 0x184a, 0x183d, 0x8502, 0x1807, 0x17e0, 0x18c6 };
private static int mode = 0;
private static int speed = 1;
@@ -161,6 +161,17 @@ namespace GHelper
Color2 = Color.FromArgb(colorCode);
}
private static IEnumerable<HidDevice> GetHidDevices(int[] deviceIds, int minInput = 18)
{
HidDevice[] HidDeviceList = HidDevices.Enumerate(0x0b05, deviceIds).ToArray();
foreach (HidDevice device in HidDeviceList)
if (device.IsConnected
&& device.Capabilities.FeatureReportByteLength > 0
&& device.Capabilities.InputReportByteLength >= minInput) //
yield return device;
}
public static byte[] AuraMessage(int mode, Color color, Color color2, int speed)
{
@@ -183,87 +194,70 @@ namespace GHelper
public static void ApplyBrightness(int brightness)
{
HidDevice[] HidDeviceList = HidDevices.Enumerate(0x0b05, deviceIds).ToArray();
byte[] msg = { 0x5d, 0xba, 0xc5, 0xc4, (byte)brightness };
foreach (HidDevice device in HidDeviceList)
if (device.IsConnected && device.Description.Contains("HID"))
{
device.OpenDevice();
device.Write(msg);
device.CloseDevice();
}
var devices = GetHidDevices(deviceIds);
//Logger.WriteLine("USB-KB = " + BitConverter.ToString(msg));
Logger.WriteLine("USB-KB = " + BitConverter.ToString(msg));
foreach (HidDevice device in devices)
{
device.OpenDevice();
device.Write(msg);
Logger.WriteLine("USB-KB " + device.Attributes.ProductHexId + ":" + BitConverter.ToString(msg));
device.CloseDevice();
}
if (Program.config.ContainsModel("TUF"))
Program.wmi.TUFKeyboardBrightness(brightness);
}
public static void ApplyAuraPower(bool awake = true, bool boot = false, bool sleep = false, bool shutdown = false)
public static void ApplyAuraPower(List<AuraDev19b6> flags)
{
HidDevice[] HidDeviceList = HidDevices.Enumerate(0x0b05, 0x19b6).ToArray();
List<AuraDev19b6> flags = new List<AuraDev19b6>();
if (awake)
{
flags.Add(AuraDev19b6.AwakeKeyb);
flags.Add(AuraDev19b6.AwakeBar);
flags.Add(AuraDev19b6.AwakeLid);
flags.Add(AuraDev19b6.AwakeLogo);
}
if (boot)
{
flags.Add(AuraDev19b6.BootKeyb);
flags.Add(AuraDev19b6.BootBar);
flags.Add(AuraDev19b6.BootLid);
flags.Add(AuraDev19b6.BootLogo);
}
if (sleep)
{
flags.Add(AuraDev19b6.SleepKeyb);
flags.Add(AuraDev19b6.SleepBar);
flags.Add(AuraDev19b6.SleepLid);
flags.Add(AuraDev19b6.SleepLogo);
}
if (shutdown)
{
flags.Add(AuraDev19b6.ShutdownKeyb);
flags.Add(AuraDev19b6.ShutdownBar);
flags.Add(AuraDev19b6.ShutdownLid);
flags.Add(AuraDev19b6.ShutdownLogo);
}
byte[] msg = AuraDev19b6Extensions.ToBytes(flags.ToArray());
Debug.WriteLine(BitConverter.ToString(msg));
foreach (HidDevice device in HidDeviceList)
if (device.IsConnected && device.Description.Contains("HID"))
{
device.OpenDevice();
device.Write(msg);
device.CloseDevice();
}
var devices = GetHidDevices(deviceIds);
//Logger.WriteLine("USB-KB = " + BitConverter.ToString(msg));
Logger.WriteLine("USB-KB = " + BitConverter.ToString(msg));
foreach (HidDevice device in devices)
{
device.OpenDevice();
device.Write(msg);
Logger.WriteLine("USB-KB " + device.Attributes.ProductHexId + ":" + BitConverter.ToString(msg));
device.CloseDevice();
}
if (Program.config.ContainsModel("TUF"))
Program.wmi.TUFKeyboardPower(awake, boot, sleep, shutdown);
Program.wmi.TUFKeyboardPower(
flags.Contains(AuraDev19b6.AwakeKeyb),
flags.Contains(AuraDev19b6.BootKeyb),
flags.Contains(AuraDev19b6.SleepKeyb),
flags.Contains(AuraDev19b6.ShutdownKeyb));
}
public static void ApplyXGMLight(bool status)
{
byte value = status ? (byte)0x50 : (byte)0;
var msg = new byte[] { 0x5e, 0xc5, value };
foreach (HidDevice device in GetHidDevices(new int[] { 0x1970 }))
{
device.OpenDevice();
var message = new byte[300];
Array.Copy(msg, message, msg.Length);
Debug.WriteLine(BitConverter.ToString(message));
device.WriteFeatureData(message);
device.CloseDevice();
}
}
public static void ApplyAura()
{
HidDevice[] HidDeviceList = HidDevices.Enumerate(0x0b05, deviceIds).ToArray();
int _speed;
switch (Speed)
@@ -279,22 +273,48 @@ namespace GHelper
break;
}
byte[] msg = AuraMessage(Mode, Color1, Color2, _speed);
foreach (HidDevice device in HidDeviceList)
if (device.IsConnected && device.Description.Contains("HID"))
{
device.OpenDevice();
device.Write(msg);
device.Write(MESSAGE_SET);
device.Write(MESSAGE_APPLY);
device.CloseDevice();
}
var devices = GetHidDevices(deviceIds);
if (devices.Count() == 0)
{
Logger.WriteLine("USB-KB : not found");
GetHidDevices(deviceIds, 0);
}
foreach (HidDevice device in devices)
{
device.OpenDevice();
device.Write(msg);
device.Write(MESSAGE_SET);
device.Write(MESSAGE_APPLY);
device.CloseDevice();
Logger.WriteLine("USB-KB " + device.Capabilities.FeatureReportByteLength + "|" + device.Capabilities.InputReportByteLength + device.Description + device.DevicePath + ":" + BitConverter.ToString(msg));
}
if (Program.config.ContainsModel("TUF"))
Program.wmi.TUFKeyboardRGB(Mode, Color1, _speed);
}
public static void SetBacklightOffDelay(int value = 60)
{
try
{
RegistryKey myKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\ASUS\ASUS System Control Interface\AsusOptimization\ASUS Keyboard Hotkeys", true);
if (myKey != null)
{
myKey.SetValue("TurnOffKeybdLight", value, RegistryValueKind.DWord);
myKey.Close();
}
}
catch (Exception ex)
{
Logger.WriteLine(ex.Message);
}
}
}
}

View File

@@ -92,7 +92,7 @@ public static class ControlHelper
}
var chk = control as CheckBox;
if (chk != null && chk.Padding.Left > 5)
if (chk != null && chk.Padding.Right > 5)
{
chk.BackColor = RForm.buttonSecond;
}

509
app/Extra.Designer.cs generated
View File

@@ -43,23 +43,50 @@ namespace GHelper
comboM3 = new RComboBox();
labelM3 = new Label();
groupLight = new GroupBox();
panelBacklightExtra = new Panel();
numericBacklightTime = new NumericUpDown();
labelBacklightTimeout = new Label();
labelBrightness = new Label();
trackBrightness = new TrackBar();
labelSpeed = new Label();
comboKeyboardSpeed = new RComboBox();
checkShutdown = new CheckBox();
checkSleep = new CheckBox();
checkBoot = new CheckBox();
panelXMG = new Panel();
checkXMG = new CheckBox();
tableBacklight = new TableLayoutPanel();
labelBacklight = new Label();
checkAwake = new CheckBox();
checkBoot = new CheckBox();
checkSleep = new CheckBox();
checkShutdown = new CheckBox();
labelBacklightLogo = new Label();
checkAwakeLogo = new CheckBox();
checkBootLogo = new CheckBox();
checkSleepLogo = new CheckBox();
checkShutdownLogo = new CheckBox();
labelBacklightBar = new Label();
checkAwakeBar = new CheckBox();
checkBootBar = new CheckBox();
checkSleepBar = new CheckBox();
checkShutdownBar = new CheckBox();
labelBacklightLid = new Label();
checkAwakeLid = new CheckBox();
checkBootLid = new CheckBox();
checkSleepLid = new CheckBox();
checkShutdownLid = new CheckBox();
groupOther = new GroupBox();
checkAutoApplyWindowsPowerMode = new CheckBox();
checkKeyboardAuto = new CheckBox();
checkUSBC = new CheckBox();
checkNoOverdrive = new CheckBox();
checkKeyboardAuto = new CheckBox();
checkTopmost = new CheckBox();
groupBindings.SuspendLayout();
((System.ComponentModel.ISupportInitialize)pictureHelp).BeginInit();
groupLight.SuspendLayout();
panelBacklightExtra.SuspendLayout();
((System.ComponentModel.ISupportInitialize)numericBacklightTime).BeginInit();
((System.ComponentModel.ISupportInitialize)trackBrightness).BeginInit();
panelXMG.SuspendLayout();
tableBacklight.SuspendLayout();
groupOther.SuspendLayout();
SuspendLayout();
//
@@ -78,7 +105,7 @@ namespace GHelper
groupBindings.Dock = DockStyle.Top;
groupBindings.Location = new Point(10, 10);
groupBindings.Name = "groupBindings";
groupBindings.Size = new Size(844, 242);
groupBindings.Size = new Size(954, 242);
groupBindings.TabIndex = 0;
groupBindings.TabStop = false;
groupBindings.Text = "Key Bindings";
@@ -88,7 +115,7 @@ namespace GHelper
pictureHelp.BackgroundImage = Resources.icons8_help_64;
pictureHelp.BackgroundImageLayout = ImageLayout.Zoom;
pictureHelp.Cursor = Cursors.Hand;
pictureHelp.Location = new Point(744, 57);
pictureHelp.Location = new Point(884, 58);
pictureHelp.Name = "pictureHelp";
pictureHelp.Size = new Size(32, 32);
pictureHelp.TabIndex = 9;
@@ -99,7 +126,7 @@ namespace GHelper
textFNF4.Location = new Point(415, 176);
textFNF4.Name = "textFNF4";
textFNF4.PlaceholderText = "action";
textFNF4.Size = new Size(320, 39);
textFNF4.Size = new Size(448, 39);
textFNF4.TabIndex = 8;
//
// comboFNF4
@@ -126,7 +153,7 @@ namespace GHelper
textM4.Location = new Point(415, 113);
textM4.Name = "textM4";
textM4.PlaceholderText = "action";
textM4.Size = new Size(320, 39);
textM4.Size = new Size(448, 39);
textM4.TabIndex = 5;
//
// textM3
@@ -134,7 +161,7 @@ namespace GHelper
textM3.Location = new Point(415, 54);
textM3.Name = "textM3";
textM3.PlaceholderText = "notepad /p \"file.txt\"";
textM3.Size = new Size(320, 39);
textM3.Size = new Size(448, 39);
textM3.TabIndex = 4;
//
// comboM4
@@ -179,47 +206,72 @@ namespace GHelper
//
// groupLight
//
groupLight.Controls.Add(labelBrightness);
groupLight.Controls.Add(trackBrightness);
groupLight.Controls.Add(labelSpeed);
groupLight.Controls.Add(comboKeyboardSpeed);
groupLight.Controls.Add(checkShutdown);
groupLight.Controls.Add(checkSleep);
groupLight.Controls.Add(checkBoot);
groupLight.Controls.Add(checkAwake);
groupLight.AutoSize = true;
groupLight.Controls.Add(panelBacklightExtra);
groupLight.Controls.Add(panelXMG);
groupLight.Controls.Add(tableBacklight);
groupLight.Dock = DockStyle.Top;
groupLight.Location = new Point(10, 252);
groupLight.Name = "groupLight";
groupLight.Size = new Size(844, 395);
groupLight.Size = new Size(954, 516);
groupLight.TabIndex = 1;
groupLight.TabStop = false;
groupLight.Text = "Keyboard Backlight";
//
// panelBacklightExtra
//
panelBacklightExtra.Controls.Add(numericBacklightTime);
panelBacklightExtra.Controls.Add(labelBacklightTimeout);
panelBacklightExtra.Controls.Add(labelBrightness);
panelBacklightExtra.Controls.Add(trackBrightness);
panelBacklightExtra.Controls.Add(labelSpeed);
panelBacklightExtra.Controls.Add(comboKeyboardSpeed);
panelBacklightExtra.Dock = DockStyle.Top;
panelBacklightExtra.Location = new Point(3, 319);
panelBacklightExtra.Name = "panelBacklightExtra";
panelBacklightExtra.Size = new Size(948, 194);
panelBacklightExtra.TabIndex = 43;
//
// numericBacklightTime
//
numericBacklightTime.Location = new Point(655, 133);
numericBacklightTime.Maximum = new decimal(new int[] { 3600, 0, 0, 0 });
numericBacklightTime.Name = "numericBacklightTime";
numericBacklightTime.Size = new Size(240, 39);
numericBacklightTime.TabIndex = 47;
//
// labelBacklightTimeout
//
labelBacklightTimeout.Location = new Point(13, 135);
labelBacklightTimeout.Name = "labelBacklightTimeout";
labelBacklightTimeout.Size = new Size(636, 45);
labelBacklightTimeout.TabIndex = 46;
labelBacklightTimeout.Text = "Seconds to turn off backlight on battery";
//
// labelBrightness
//
labelBrightness.Location = new Point(25, 304);
labelBrightness.Location = new Point(13, 75);
labelBrightness.Name = "labelBrightness";
labelBrightness.Size = new Size(197, 49);
labelBrightness.TabIndex = 0;
labelBrightness.Size = new Size(336, 43);
labelBrightness.TabIndex = 41;
labelBrightness.Text = "Brightness";
//
// trackBrightness
//
trackBrightness.Location = new Point(228, 294);
trackBrightness.LargeChange = 1;
trackBrightness.Location = new Point(355, 60);
trackBrightness.Maximum = 3;
trackBrightness.Name = "trackBrightness";
trackBrightness.Size = new Size(600, 90);
trackBrightness.TabIndex = 1;
trackBrightness.Size = new Size(558, 90);
trackBrightness.TabIndex = 42;
trackBrightness.TickStyle = TickStyle.TopLeft;
//
// labelSpeed
//
labelSpeed.AutoSize = true;
labelSpeed.Location = new Point(25, 235);
labelSpeed.MaximumSize = new Size(200, 0);
labelSpeed.Location = new Point(13, 15);
labelSpeed.Name = "labelSpeed";
labelSpeed.Size = new Size(198, 32);
labelSpeed.TabIndex = 40;
labelSpeed.Size = new Size(538, 40);
labelSpeed.TabIndex = 44;
labelSpeed.Text = "Animation Speed";
//
// comboKeyboardSpeed
@@ -231,71 +283,334 @@ namespace GHelper
comboKeyboardSpeed.FormattingEnabled = true;
comboKeyboardSpeed.ItemHeight = 32;
comboKeyboardSpeed.Items.AddRange(new object[] { "Slow", "Normal", "Fast" });
comboKeyboardSpeed.Location = new Point(230, 232);
comboKeyboardSpeed.Location = new Point(607, 15);
comboKeyboardSpeed.Margin = new Padding(4, 10, 4, 8);
comboKeyboardSpeed.Name = "comboKeyboardSpeed";
comboKeyboardSpeed.Size = new Size(291, 40);
comboKeyboardSpeed.TabIndex = 39;
comboKeyboardSpeed.TabIndex = 43;
comboKeyboardSpeed.TabStop = false;
//
// checkShutdown
// panelXMG
//
checkShutdown.AutoSize = true;
checkShutdown.Location = new Point(25, 185);
checkShutdown.Name = "checkShutdown";
checkShutdown.Size = new Size(154, 36);
checkShutdown.TabIndex = 3;
checkShutdown.Text = Strings.Shutdown;
checkShutdown.UseVisualStyleBackColor = true;
panelXMG.Controls.Add(checkXMG);
panelXMG.Dock = DockStyle.Top;
panelXMG.Location = new Point(3, 261);
panelXMG.Name = "panelXMG";
panelXMG.Size = new Size(948, 58);
panelXMG.TabIndex = 42;
//
// checkSleep
// checkXMG
//
checkSleep.AutoSize = true;
checkSleep.Location = new Point(25, 143);
checkSleep.Name = "checkSleep";
checkSleep.Size = new Size(105, 36);
checkSleep.TabIndex = 2;
checkSleep.Text = Strings.Sleep;
checkSleep.UseVisualStyleBackColor = true;
checkXMG.AutoSize = true;
checkXMG.Location = new Point(3, 10);
checkXMG.Name = "checkXMG";
checkXMG.Padding = new Padding(15, 2, 5, 2);
checkXMG.Size = new Size(178, 40);
checkXMG.TabIndex = 2;
checkXMG.Text = "XG Mobile";
checkXMG.UseVisualStyleBackColor = true;
//
// checkBoot
// tableBacklight
//
checkBoot.AutoSize = true;
checkBoot.Location = new Point(25, 101);
checkBoot.Name = "checkBoot";
checkBoot.Size = new Size(96, 36);
checkBoot.TabIndex = 1;
checkBoot.Text = Strings.Boot;
checkBoot.UseVisualStyleBackColor = true;
tableBacklight.AutoSize = true;
tableBacklight.ColumnCount = 4;
tableBacklight.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
tableBacklight.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
tableBacklight.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
tableBacklight.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
tableBacklight.Controls.Add(labelBacklight, 0, 0);
tableBacklight.Controls.Add(checkAwake, 0, 1);
tableBacklight.Controls.Add(checkBoot, 0, 2);
tableBacklight.Controls.Add(checkSleep, 0, 3);
tableBacklight.Controls.Add(checkShutdown, 0, 4);
tableBacklight.Controls.Add(labelBacklightLogo, 1, 0);
tableBacklight.Controls.Add(checkAwakeLogo, 1, 1);
tableBacklight.Controls.Add(checkBootLogo, 1, 2);
tableBacklight.Controls.Add(checkSleepLogo, 1, 3);
tableBacklight.Controls.Add(checkShutdownLogo, 1, 4);
tableBacklight.Controls.Add(labelBacklightBar, 2, 0);
tableBacklight.Controls.Add(checkAwakeBar, 2, 1);
tableBacklight.Controls.Add(checkBootBar, 2, 2);
tableBacklight.Controls.Add(checkSleepBar, 2, 3);
tableBacklight.Controls.Add(checkShutdownBar, 2, 4);
tableBacklight.Controls.Add(labelBacklightLid, 3, 0);
tableBacklight.Controls.Add(checkAwakeLid, 3, 1);
tableBacklight.Controls.Add(checkBootLid, 3, 2);
tableBacklight.Controls.Add(checkSleepLid, 3, 3);
tableBacklight.Controls.Add(checkShutdownLid, 3, 4);
tableBacklight.Dock = DockStyle.Top;
tableBacklight.Location = new Point(3, 35);
tableBacklight.Margin = new Padding(0);
tableBacklight.Name = "tableBacklight";
tableBacklight.RowCount = 5;
tableBacklight.RowStyles.Add(new RowStyle());
tableBacklight.RowStyles.Add(new RowStyle());
tableBacklight.RowStyles.Add(new RowStyle());
tableBacklight.RowStyles.Add(new RowStyle());
tableBacklight.RowStyles.Add(new RowStyle());
tableBacklight.Size = new Size(948, 226);
tableBacklight.TabIndex = 41;
//
// labelBacklight
//
labelBacklight.Dock = DockStyle.Fill;
labelBacklight.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelBacklight.Location = new Point(3, 0);
labelBacklight.Name = "labelBacklight";
labelBacklight.Padding = new Padding(10, 5, 5, 5);
labelBacklight.Size = new Size(231, 42);
labelBacklight.TabIndex = 6;
labelBacklight.Text = "Keyboard";
//
// checkAwake
//
checkAwake.AutoSize = true;
checkAwake.Location = new Point(25, 59);
checkAwake.Dock = DockStyle.Fill;
checkAwake.Location = new Point(3, 45);
checkAwake.Name = "checkAwake";
checkAwake.Size = new Size(115, 36);
checkAwake.TabIndex = 0;
checkAwake.Padding = new Padding(15, 2, 5, 2);
checkAwake.Size = new Size(231, 40);
checkAwake.TabIndex = 1;
checkAwake.Text = Strings.Awake;
checkAwake.UseVisualStyleBackColor = true;
//
// checkBoot
//
checkBoot.Dock = DockStyle.Fill;
checkBoot.Location = new Point(3, 91);
checkBoot.Name = "checkBoot";
checkBoot.Padding = new Padding(15, 2, 5, 2);
checkBoot.Size = new Size(231, 40);
checkBoot.TabIndex = 2;
checkBoot.Text = Strings.Boot;
checkBoot.UseVisualStyleBackColor = true;
//
// checkSleep
//
checkSleep.Dock = DockStyle.Fill;
checkSleep.Location = new Point(3, 137);
checkSleep.Name = "checkSleep";
checkSleep.Padding = new Padding(15, 2, 5, 2);
checkSleep.Size = new Size(231, 40);
checkSleep.TabIndex = 3;
checkSleep.Text = "Sleep";
checkSleep.UseVisualStyleBackColor = true;
//
// checkShutdown
//
checkShutdown.Dock = DockStyle.Fill;
checkShutdown.Location = new Point(3, 183);
checkShutdown.Name = "checkShutdown";
checkShutdown.Padding = new Padding(15, 2, 5, 2);
checkShutdown.Size = new Size(231, 40);
checkShutdown.TabIndex = 4;
checkShutdown.Text = Strings.Shutdown;
checkShutdown.UseVisualStyleBackColor = true;
//
// labelBacklightLogo
//
labelBacklightLogo.Dock = DockStyle.Fill;
labelBacklightLogo.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelBacklightLogo.Location = new Point(240, 0);
labelBacklightLogo.Name = "labelBacklightLogo";
labelBacklightLogo.Padding = new Padding(10, 5, 5, 5);
labelBacklightLogo.Size = new Size(231, 42);
labelBacklightLogo.TabIndex = 21;
labelBacklightLogo.Text = "Logo";
//
// checkAwakeLogo
//
checkAwakeLogo.Dock = DockStyle.Fill;
checkAwakeLogo.Location = new Point(240, 45);
checkAwakeLogo.Name = "checkAwakeLogo";
checkAwakeLogo.Padding = new Padding(15, 2, 5, 2);
checkAwakeLogo.Size = new Size(231, 40);
checkAwakeLogo.TabIndex = 17;
checkAwakeLogo.Text = Strings.Awake;
checkAwakeLogo.UseVisualStyleBackColor = true;
//
// checkBootLogo
//
checkBootLogo.Dock = DockStyle.Fill;
checkBootLogo.Location = new Point(240, 91);
checkBootLogo.Name = "checkBootLogo";
checkBootLogo.Padding = new Padding(15, 2, 5, 2);
checkBootLogo.Size = new Size(231, 40);
checkBootLogo.TabIndex = 18;
checkBootLogo.Text = Strings.Boot;
checkBootLogo.UseVisualStyleBackColor = true;
//
// checkSleepLogo
//
checkSleepLogo.Dock = DockStyle.Fill;
checkSleepLogo.Location = new Point(240, 137);
checkSleepLogo.Name = "checkSleepLogo";
checkSleepLogo.Padding = new Padding(15, 2, 5, 2);
checkSleepLogo.Size = new Size(231, 40);
checkSleepLogo.TabIndex = 19;
checkSleepLogo.Text = Strings.Sleep;
checkSleepLogo.UseVisualStyleBackColor = true;
//
// checkShutdownLogo
//
checkShutdownLogo.Dock = DockStyle.Fill;
checkShutdownLogo.Location = new Point(240, 183);
checkShutdownLogo.Name = "checkShutdownLogo";
checkShutdownLogo.Padding = new Padding(15, 2, 5, 2);
checkShutdownLogo.Size = new Size(231, 40);
checkShutdownLogo.TabIndex = 20;
checkShutdownLogo.Text = Strings.Shutdown;
checkShutdownLogo.UseVisualStyleBackColor = true;
//
// labelBacklightBar
//
labelBacklightBar.Dock = DockStyle.Fill;
labelBacklightBar.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelBacklightBar.Location = new Point(477, 0);
labelBacklightBar.Name = "labelBacklightBar";
labelBacklightBar.Padding = new Padding(10, 5, 5, 5);
labelBacklightBar.Size = new Size(231, 42);
labelBacklightBar.TabIndex = 11;
labelBacklightBar.Text = "Lightbar";
//
// checkAwakeBar
//
checkAwakeBar.Dock = DockStyle.Fill;
checkAwakeBar.Location = new Point(477, 45);
checkAwakeBar.Name = "checkAwakeBar";
checkAwakeBar.Padding = new Padding(15, 2, 5, 2);
checkAwakeBar.Size = new Size(231, 40);
checkAwakeBar.TabIndex = 7;
checkAwakeBar.Text = Strings.Awake;
checkAwakeBar.UseVisualStyleBackColor = true;
//
// checkBootBar
//
checkBootBar.Dock = DockStyle.Fill;
checkBootBar.Location = new Point(477, 91);
checkBootBar.Name = "checkBootBar";
checkBootBar.Padding = new Padding(15, 2, 5, 2);
checkBootBar.Size = new Size(231, 40);
checkBootBar.TabIndex = 8;
checkBootBar.Text = Strings.Boot;
checkBootBar.UseVisualStyleBackColor = true;
//
// checkSleepBar
//
checkSleepBar.Dock = DockStyle.Fill;
checkSleepBar.Location = new Point(477, 137);
checkSleepBar.Name = "checkSleepBar";
checkSleepBar.Padding = new Padding(15, 2, 5, 2);
checkSleepBar.Size = new Size(231, 40);
checkSleepBar.TabIndex = 9;
checkSleepBar.Text = Strings.Sleep;
checkSleepBar.UseVisualStyleBackColor = true;
//
// checkShutdownBar
//
checkShutdownBar.Dock = DockStyle.Fill;
checkShutdownBar.Location = new Point(477, 183);
checkShutdownBar.Name = "checkShutdownBar";
checkShutdownBar.Padding = new Padding(15, 2, 5, 2);
checkShutdownBar.Size = new Size(231, 40);
checkShutdownBar.TabIndex = 10;
checkShutdownBar.Text = Strings.Shutdown;
checkShutdownBar.UseVisualStyleBackColor = true;
//
// labelBacklightLid
//
labelBacklightLid.Dock = DockStyle.Fill;
labelBacklightLid.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelBacklightLid.Location = new Point(714, 0);
labelBacklightLid.Name = "labelBacklightLid";
labelBacklightLid.Padding = new Padding(10, 5, 5, 5);
labelBacklightLid.Size = new Size(231, 42);
labelBacklightLid.TabIndex = 16;
labelBacklightLid.Text = "Lid";
//
// checkAwakeLid
//
checkAwakeLid.Dock = DockStyle.Fill;
checkAwakeLid.Location = new Point(714, 45);
checkAwakeLid.Name = "checkAwakeLid";
checkAwakeLid.Padding = new Padding(15, 2, 5, 2);
checkAwakeLid.Size = new Size(231, 40);
checkAwakeLid.TabIndex = 12;
checkAwakeLid.Text = Strings.Awake;
checkAwakeLid.UseVisualStyleBackColor = true;
//
// checkBootLid
//
checkBootLid.Dock = DockStyle.Fill;
checkBootLid.Location = new Point(714, 91);
checkBootLid.Name = "checkBootLid";
checkBootLid.Padding = new Padding(15, 2, 5, 2);
checkBootLid.Size = new Size(231, 40);
checkBootLid.TabIndex = 13;
checkBootLid.Text = Strings.Boot;
checkBootLid.UseVisualStyleBackColor = true;
//
// checkSleepLid
//
checkSleepLid.Dock = DockStyle.Fill;
checkSleepLid.Location = new Point(714, 137);
checkSleepLid.Name = "checkSleepLid";
checkSleepLid.Padding = new Padding(15, 2, 5, 2);
checkSleepLid.Size = new Size(231, 40);
checkSleepLid.TabIndex = 14;
checkSleepLid.Text = Strings.Sleep;
checkSleepLid.UseVisualStyleBackColor = true;
//
// checkShutdownLid
//
checkShutdownLid.Dock = DockStyle.Fill;
checkShutdownLid.Location = new Point(714, 183);
checkShutdownLid.Name = "checkShutdownLid";
checkShutdownLid.Padding = new Padding(15, 2, 5, 2);
checkShutdownLid.Size = new Size(231, 40);
checkShutdownLid.TabIndex = 15;
checkShutdownLid.Text = Strings.Shutdown;
checkShutdownLid.UseVisualStyleBackColor = true;
//
// groupOther
//
groupOther.Controls.Add(checkAutoApplyWindowsPowerMode);
groupOther.Controls.Add(checkKeyboardAuto);
groupOther.Controls.Add(checkUSBC);
groupOther.Controls.Add(checkNoOverdrive);
groupOther.Controls.Add(checkKeyboardAuto);
groupOther.Controls.Add(checkTopmost);
groupOther.Dock = DockStyle.Top;
groupOther.Location = new Point(10, 647);
groupOther.Location = new Point(10, 768);
groupOther.Name = "groupOther";
groupOther.Size = new Size(844, 293);
groupOther.Size = new Size(954, 276);
groupOther.TabIndex = 2;
groupOther.TabStop = false;
groupOther.Text = "Other";
//
// checkAutoApplyWindowsPowerMode
//
checkAutoApplyWindowsPowerMode.AutoSize = true;
checkAutoApplyWindowsPowerMode.Location = new Point(25, 220);
checkAutoApplyWindowsPowerMode.Name = "checkAutoApplyWindowsPowerMode";
checkAutoApplyWindowsPowerMode.Size = new Size(416, 36);
checkAutoApplyWindowsPowerMode.TabIndex = 47;
checkAutoApplyWindowsPowerMode.Text = "Auto Adjust Windows Power Mode";
checkAutoApplyWindowsPowerMode.UseVisualStyleBackColor = true;
//
// checkKeyboardAuto
//
checkKeyboardAuto.AutoSize = true;
checkKeyboardAuto.Location = new Point(25, 40);
checkKeyboardAuto.MaximumSize = new Size(780, 0);
checkKeyboardAuto.Name = "checkKeyboardAuto";
checkKeyboardAuto.Size = new Size(712, 36);
checkKeyboardAuto.TabIndex = 46;
checkKeyboardAuto.Text = Strings.KeyboardAuto;
checkKeyboardAuto.UseVisualStyleBackColor = true;
//
// checkUSBC
//
checkUSBC.AutoSize = true;
checkUSBC.Location = new Point(25, 210);
checkUSBC.Location = new Point(25, 85);
checkUSBC.Name = "checkUSBC";
checkUSBC.Size = new Size(659, 36);
checkUSBC.TabIndex = 4;
@@ -305,28 +620,17 @@ namespace GHelper
// checkNoOverdrive
//
checkNoOverdrive.AutoSize = true;
checkNoOverdrive.Location = new Point(25, 156);
checkNoOverdrive.Location = new Point(25, 130);
checkNoOverdrive.Name = "checkNoOverdrive";
checkNoOverdrive.Size = new Size(307, 36);
checkNoOverdrive.TabIndex = 3;
checkNoOverdrive.Text = Strings.DisableOverdrive;
checkNoOverdrive.UseVisualStyleBackColor = true;
//
// checkKeyboardAuto
//
checkKeyboardAuto.AutoSize = true;
checkKeyboardAuto.Location = new Point(25, 51);
checkKeyboardAuto.MaximumSize = new Size(780, 0);
checkKeyboardAuto.Name = "checkKeyboardAuto";
checkKeyboardAuto.Size = new Size(712, 36);
checkKeyboardAuto.TabIndex = 2;
checkKeyboardAuto.Text = Strings.KeyboardAuto;
checkKeyboardAuto.UseVisualStyleBackColor = true;
//
// checkTopmost
//
checkTopmost.AutoSize = true;
checkTopmost.Location = new Point(25, 104);
checkTopmost.Location = new Point(25, 175);
checkTopmost.Name = "checkTopmost";
checkTopmost.Size = new Size(390, 36);
checkTopmost.TabIndex = 1;
@@ -337,7 +641,9 @@ namespace GHelper
//
AutoScaleDimensions = new SizeF(13F, 32F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(864, 953);
AutoSize = true;
AutoSizeMode = AutoSizeMode.GrowAndShrink;
ClientSize = new Size(974, 1059);
Controls.Add(groupOther);
Controls.Add(groupLight);
Controls.Add(groupBindings);
@@ -345,6 +651,7 @@ namespace GHelper
MaximizeBox = false;
MdiChildrenMinimizedAnchorBottom = false;
MinimizeBox = false;
MinimumSize = new Size(1000, 0);
Name = "Extra";
Padding = new Padding(10);
ShowIcon = false;
@@ -355,10 +662,17 @@ namespace GHelper
((System.ComponentModel.ISupportInitialize)pictureHelp).EndInit();
groupLight.ResumeLayout(false);
groupLight.PerformLayout();
panelBacklightExtra.ResumeLayout(false);
panelBacklightExtra.PerformLayout();
((System.ComponentModel.ISupportInitialize)numericBacklightTime).EndInit();
((System.ComponentModel.ISupportInitialize)trackBrightness).EndInit();
panelXMG.ResumeLayout(false);
panelXMG.PerformLayout();
tableBacklight.ResumeLayout(false);
groupOther.ResumeLayout(false);
groupOther.PerformLayout();
ResumeLayout(false);
PerformLayout();
}
#endregion
@@ -374,19 +688,42 @@ namespace GHelper
private RComboBox comboFNF4;
private Label labelFNF4;
private GroupBox groupLight;
private CheckBox checkSleep;
private CheckBox checkBoot;
private CheckBox checkAwake;
private CheckBox checkShutdown;
private Label labelSpeed;
private RComboBox comboKeyboardSpeed;
private GroupBox groupOther;
private CheckBox checkTopmost;
private CheckBox checkKeyboardAuto;
private CheckBox checkNoOverdrive;
private PictureBox pictureHelp;
private TrackBar trackBrightness;
private Label labelBrightness;
private CheckBox checkUSBC;
private TableLayoutPanel tableBacklight;
private CheckBox checkShutdown;
private CheckBox checkAwake;
private CheckBox checkBoot;
private CheckBox checkSleep;
private CheckBox checkBootLid;
private Label labelBacklight;
private CheckBox checkSleepBar;
private CheckBox checkShutdownBar;
private Label labelBacklightBar;
private CheckBox checkAwakeBar;
private CheckBox checkBootBar;
private CheckBox checkSleepLid;
private CheckBox checkShutdownLid;
private Label labelBacklightLid;
private CheckBox checkAwakeLid;
private Label labelBacklightLogo;
private CheckBox checkAwakeLogo;
private CheckBox checkBootLogo;
private CheckBox checkSleepLogo;
private CheckBox checkShutdownLogo;
private Panel panelBacklightExtra;
private Label labelBrightness;
private TrackBar trackBrightness;
private Label labelSpeed;
private RComboBox comboKeyboardSpeed;
private Panel panelXMG;
private CheckBox checkXMG;
private Label labelBacklightTimeout;
private NumericUpDown numericBacklightTime;
private CheckBox checkKeyboardAuto;
private CheckBox checkAutoApplyWindowsPowerMode;
}
}

View File

@@ -58,7 +58,7 @@ namespace GHelper
InitializeComponent();
groupBindings.Text = Properties.Strings.KeyBindings;
groupLight.Text = Properties.Strings.KeyboardBacklight;
groupLight.Text = " " + Properties.Strings.LaptopBacklight;
groupOther.Text = Properties.Strings.Other;
checkAwake.Text = Properties.Strings.Awake;
@@ -68,11 +68,18 @@ namespace GHelper
labelSpeed.Text = Properties.Strings.AnimationSpeed;
labelBrightness.Text = Properties.Strings.Brightness;
labelBacklightTimeout.Text = Properties.Strings.BacklightTimeout;
checkKeyboardAuto.Text = Properties.Strings.KeyboardAuto;
checkNoOverdrive.Text = Properties.Strings.DisableOverdrive;
checkTopmost.Text = Properties.Strings.WindowTop;
checkUSBC.Text = Properties.Strings.OptimizedUSBC;
checkAutoApplyWindowsPowerMode.Text = Properties.Strings.ApplyWindowsPowerPlan;
labelBacklight.Text = Properties.Strings.Keyboard;
labelBacklightBar.Text = Properties.Strings.Lightbar;
labelBacklightLid.Text = Properties.Strings.Lid;
labelBacklightLogo.Text = Properties.Strings.Logo;
Text = Properties.Strings.ExtraSettings;
@@ -91,16 +98,74 @@ namespace GHelper
comboKeyboardSpeed.SelectedValue = Aura.Speed;
comboKeyboardSpeed.SelectedValueChanged += ComboKeyboardSpeed_SelectedValueChanged;
// Keyboard
checkAwake.Checked = !(Program.config.getConfig("keyboard_awake") == 0);
checkBoot.Checked = !(Program.config.getConfig("keyboard_boot") == 0);
checkSleep.Checked = !(Program.config.getConfig("keyboard_sleep") == 0);
checkShutdown.Checked = !(Program.config.getConfig("keyboard_shutdown") == 0);
// Lightbar
checkAwakeBar.Checked = !(Program.config.getConfig("keyboard_awake_bar") == 0);
checkBootBar.Checked = !(Program.config.getConfig("keyboard_boot_bar") == 0);
checkSleepBar.Checked = !(Program.config.getConfig("keyboard_sleep_bar") == 0);
checkShutdownBar.Checked = !(Program.config.getConfig("keyboard_shutdown_bar") == 0);
// Lid
checkAwakeLid.Checked = !(Program.config.getConfig("keyboard_awake_lid") == 0);
checkBootLid.Checked = !(Program.config.getConfig("keyboard_boot_lid") == 0);
checkSleepLid.Checked = !(Program.config.getConfig("keyboard_sleep_lid") == 0);
checkShutdownLid.Checked = !(Program.config.getConfig("keyboard_shutdown_lid") == 0);
// Logo
checkAwakeLogo.Checked = !(Program.config.getConfig("keyboard_awake_logo") == 0);
checkBootLogo.Checked = !(Program.config.getConfig("keyboard_boot_logo") == 0);
checkSleepLogo.Checked = !(Program.config.getConfig("keyboard_sleep_logo") == 0);
checkShutdownLogo.Checked = !(Program.config.getConfig("keyboard_shutdown_logo") == 0);
checkAwake.CheckedChanged += CheckPower_CheckedChanged;
checkBoot.CheckedChanged += CheckPower_CheckedChanged;
checkSleep.CheckedChanged += CheckPower_CheckedChanged;
checkShutdown.CheckedChanged += CheckPower_CheckedChanged;
checkAwakeBar.CheckedChanged += CheckPower_CheckedChanged;
checkBootBar.CheckedChanged += CheckPower_CheckedChanged;
checkSleepBar.CheckedChanged += CheckPower_CheckedChanged;
checkShutdownBar.CheckedChanged += CheckPower_CheckedChanged;
checkAwakeLid.CheckedChanged += CheckPower_CheckedChanged;
checkBootLid.CheckedChanged += CheckPower_CheckedChanged;
checkSleepLid.CheckedChanged += CheckPower_CheckedChanged;
checkShutdownLid.CheckedChanged += CheckPower_CheckedChanged;
checkAwakeLogo.CheckedChanged += CheckPower_CheckedChanged;
checkBootLogo.CheckedChanged += CheckPower_CheckedChanged;
checkSleepLogo.CheckedChanged += CheckPower_CheckedChanged;
checkShutdownLogo.CheckedChanged += CheckPower_CheckedChanged;
if (!Program.config.ContainsModel("Strix"))
{
labelBacklightBar.Visible = false;
checkAwakeBar.Visible = false;
checkBootBar.Visible = false;
checkSleepBar.Visible = false;
checkShutdownBar.Visible = false;
if (!Program.config.ContainsModel("Z13"))
{
labelBacklightLid.Visible = false;
checkAwakeLid.Visible = false;
checkBootLid.Visible = false;
checkSleepLid.Visible = false;
checkShutdownLid.Visible = false;
labelBacklightLogo.Visible = false;
checkAwakeLogo.Visible = false;
checkBootLogo.Visible = false;
checkSleepLogo.Visible = false;
checkShutdownLogo.Visible = false;
}
}
checkTopmost.Checked = (Program.config.getConfig("topmost") == 1);
checkTopmost.CheckedChanged += CheckTopmost_CheckedChanged; ;
@@ -113,12 +178,37 @@ namespace GHelper
checkUSBC.Checked = (Program.config.getConfig("optimized_usbc") == 1);
checkUSBC.CheckedChanged += CheckUSBC_CheckedChanged;
checkAutoApplyWindowsPowerMode.Checked = (Program.config.getConfig("auto_apply_power_plan") != 0);
checkAutoApplyWindowsPowerMode.CheckedChanged += checkAutoApplyWindowsPowerMode_CheckedChanged;
int kb_brightness = Program.config.getConfig("keyboard_brightness");
trackBrightness.Value = (kb_brightness >= 0 && kb_brightness <= 3) ? kb_brightness : 3;
pictureHelp.Click += PictureHelp_Click;
trackBrightness.Scroll += TrackBrightness_Scroll;
panelXMG.Visible = (Program.wmi.DeviceGet(ASUSWmi.GPUXGConnected) == 1);
checkXMG.Checked = !(Program.config.getConfig("xmg_light") == 0);
checkXMG.CheckedChanged += CheckXMG_CheckedChanged;
int kb_timeout = Program.config.getConfig("keyboard_light_tiomeout");
numericBacklightTime.Value = (kb_timeout >= 0) ? kb_timeout : 60;
numericBacklightTime.ValueChanged += NumericBacklightTime_ValueChanged;
}
private void NumericBacklightTime_ValueChanged(object? sender, EventArgs e)
{
Program.RunAsAdmin("extra");
Program.config.setConfig("keyboard_light_tiomeout", (int)numericBacklightTime.Value);
Aura.SetBacklightOffDelay((int)numericBacklightTime.Value);
}
private void CheckXMG_CheckedChanged(object? sender, EventArgs e)
{
Program.config.setConfig("xmg_light", (checkXMG.Checked ? 1 : 0));
Aura.ApplyXGMLight(checkXMG.Checked);
}
private void CheckUSBC_CheckedChanged(object? sender, EventArgs e)
@@ -161,7 +251,45 @@ namespace GHelper
Program.config.setConfig("keyboard_sleep", (checkSleep.Checked ? 1 : 0));
Program.config.setConfig("keyboard_shutdown", (checkShutdown.Checked ? 1 : 0));
Aura.ApplyAuraPower(checkAwake.Checked, checkBoot.Checked, checkSleep.Checked, checkShutdown.Checked);
Program.config.setConfig("keyboard_awake_bar", (checkAwakeBar.Checked ? 1 : 0));
Program.config.setConfig("keyboard_boot_bar", (checkBootBar.Checked ? 1 : 0));
Program.config.setConfig("keyboard_sleep_bar", (checkSleepBar.Checked ? 1 : 0));
Program.config.setConfig("keyboard_shutdown_bar", (checkShutdownBar.Checked ? 1 : 0));
Program.config.setConfig("keyboard_awake_lid", (checkAwakeLid.Checked ? 1 : 0));
Program.config.setConfig("keyboard_boot_lid", (checkBootLid.Checked ? 1 : 0));
Program.config.setConfig("keyboard_sleep_lid", (checkSleepLid.Checked ? 1 : 0));
Program.config.setConfig("keyboard_shutdown_lid", (checkShutdownLid.Checked ? 1 : 0));
Program.config.setConfig("keyboard_awake_logo", (checkAwakeLogo.Checked ? 1 : 0));
Program.config.setConfig("keyboard_boot_logo", (checkBootLogo.Checked ? 1 : 0));
Program.config.setConfig("keyboard_sleep_logo", (checkSleepLogo.Checked ? 1 : 0));
Program.config.setConfig("keyboard_shutdown_logo", (checkShutdownLogo.Checked ? 1 : 0));
List<AuraDev19b6> flags = new List<AuraDev19b6>();
if (checkAwake.Checked) flags.Add(AuraDev19b6.AwakeKeyb);
if (checkBoot.Checked) flags.Add(AuraDev19b6.BootKeyb);
if (checkSleep.Checked) flags.Add(AuraDev19b6.SleepKeyb);
if (checkShutdown.Checked) flags.Add(AuraDev19b6.ShutdownKeyb);
if (checkAwakeBar.Checked) flags.Add(AuraDev19b6.AwakeBar);
if (checkBootBar.Checked) flags.Add(AuraDev19b6.BootBar);
if (checkSleepBar.Checked) flags.Add(AuraDev19b6.SleepBar);
if (checkShutdownBar.Checked) flags.Add(AuraDev19b6.ShutdownBar);
if (checkAwakeLid.Checked) flags.Add(AuraDev19b6.AwakeLid);
if (checkBootLid.Checked) flags.Add(AuraDev19b6.BootLid);
if (checkSleepLid.Checked) flags.Add(AuraDev19b6.SleepLid);
if (checkShutdownLid.Checked) flags.Add(AuraDev19b6.ShutdownLid);
if (checkAwakeLogo.Checked) flags.Add(AuraDev19b6.AwakeLogo);
if (checkBootLogo.Checked) flags.Add(AuraDev19b6.BootLogo);
if (checkSleepLogo.Checked) flags.Add(AuraDev19b6.SleepLogo);
if (checkShutdownLogo.Checked) flags.Add(AuraDev19b6.ShutdownLogo);
Aura.ApplyAuraPower(flags);
}
private void ComboKeyboardSpeed_SelectedValueChanged(object? sender, EventArgs e)
@@ -176,5 +304,10 @@ namespace GHelper
Top = Program.settingsForm.Top;
Left = Program.settingsForm.Left - Width - 5;
}
private void checkAutoApplyWindowsPowerMode_CheckedChanged(object? sender, EventArgs e)
{
Program.config.setConfig("auto_apply_power_plan", checkAutoApplyWindowsPowerMode.Checked ? 1 : 0);
}
}
}

View File

@@ -1,4 +1,64 @@
<root>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">

287
app/Fans.Designer.cs generated
View File

@@ -31,12 +31,12 @@ namespace GHelper
/// </summary>
private void InitializeComponent()
{
ChartArea chartArea13 = new ChartArea();
Title title13 = new Title();
ChartArea chartArea14 = new ChartArea();
Title title14 = new Title();
ChartArea chartArea15 = new ChartArea();
Title title15 = new Title();
ChartArea chartArea1 = new ChartArea();
Title title1 = new Title();
ChartArea chartArea2 = new ChartArea();
Title title2 = new Title();
ChartArea chartArea3 = new ChartArea();
Title title3 = new Title();
panelFans = new Panel();
labelFansResult = new Label();
labelTip = new Label();
@@ -67,6 +67,14 @@ namespace GHelper
pictureBox1 = new PictureBox();
labelPowerLimits = new Label();
panelGPU = new Panel();
panelGPUTemp = new Panel();
labelGPUTemp = new Label();
labelGPUTempTitle = new Label();
trackGPUTemp = new TrackBar();
panelGPUBoost = new Panel();
labelGPUBoost = new Label();
labelGPUBoostTitle = new Label();
trackGPUBoost = new TrackBar();
panelGPUMemory = new Panel();
labelGPUMemory = new Label();
labelGPUMemoryTitle = new Label();
@@ -78,14 +86,6 @@ namespace GHelper
panelTitleGPU = new Panel();
pictureGPU = new PictureBox();
labelGPU = new Label();
panelGPUBoost = new Panel();
labelGPUBoost = new Label();
labelGPUBoostTitle = new Label();
trackGPUBoost = new TrackBar();
panelGPUTemp = new Panel();
labelGPUTemp = new Label();
labelGPUTempTitle = new Label();
trackGPUTemp = new TrackBar();
panelFans.SuspendLayout();
((System.ComponentModel.ISupportInitialize)picturePerf).BeginInit();
tableFanCharts.SuspendLayout();
@@ -102,16 +102,16 @@ namespace GHelper
panelTitleCPU.SuspendLayout();
((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
panelGPU.SuspendLayout();
panelGPUTemp.SuspendLayout();
((System.ComponentModel.ISupportInitialize)trackGPUTemp).BeginInit();
panelGPUBoost.SuspendLayout();
((System.ComponentModel.ISupportInitialize)trackGPUBoost).BeginInit();
panelGPUMemory.SuspendLayout();
((System.ComponentModel.ISupportInitialize)trackGPUMemory).BeginInit();
panelGPUCore.SuspendLayout();
((System.ComponentModel.ISupportInitialize)trackGPUCore).BeginInit();
panelTitleGPU.SuspendLayout();
((System.ComponentModel.ISupportInitialize)pictureGPU).BeginInit();
panelGPUBoost.SuspendLayout();
((System.ComponentModel.ISupportInitialize)trackGPUBoost).BeginInit();
panelGPUTemp.SuspendLayout();
((System.ComponentModel.ISupportInitialize)trackGPUTemp).BeginInit();
SuspendLayout();
//
// panelFans
@@ -211,8 +211,8 @@ namespace GHelper
//
// chartGPU
//
chartArea13.Name = "ChartArea1";
chartGPU.ChartAreas.Add(chartArea13);
chartArea1.Name = "ChartArea1";
chartGPU.ChartAreas.Add(chartArea1);
chartGPU.Dock = DockStyle.Fill;
chartGPU.Location = new Point(2, 350);
chartGPU.Margin = new Padding(2, 10, 2, 10);
@@ -220,13 +220,13 @@ namespace GHelper
chartGPU.Size = new Size(760, 320);
chartGPU.TabIndex = 17;
chartGPU.Text = "chartGPU";
title13.Name = "Title1";
chartGPU.Titles.Add(title13);
title1.Name = "Title1";
chartGPU.Titles.Add(title1);
//
// chartCPU
//
chartArea14.Name = "ChartArea1";
chartCPU.ChartAreas.Add(chartArea14);
chartArea2.Name = "ChartArea1";
chartCPU.ChartAreas.Add(chartArea2);
chartCPU.Dock = DockStyle.Fill;
chartCPU.Location = new Point(2, 10);
chartCPU.Margin = new Padding(2, 10, 2, 10);
@@ -234,13 +234,13 @@ namespace GHelper
chartCPU.Size = new Size(760, 320);
chartCPU.TabIndex = 14;
chartCPU.Text = "chartCPU";
title14.Name = "Title1";
chartCPU.Titles.Add(title14);
title2.Name = "Title1";
chartCPU.Titles.Add(title2);
//
// chartMid
//
chartArea15.Name = "ChartArea3";
chartMid.ChartAreas.Add(chartArea15);
chartArea3.Name = "ChartArea3";
chartMid.ChartAreas.Add(chartArea3);
chartMid.Dock = DockStyle.Fill;
chartMid.Location = new Point(2, 690);
chartMid.Margin = new Padding(2, 10, 2, 10);
@@ -248,8 +248,8 @@ namespace GHelper
chartMid.Size = new Size(760, 322);
chartMid.TabIndex = 14;
chartMid.Text = "chartMid";
title15.Name = "Title3";
chartMid.Titles.Add(title15);
title3.Name = "Title3";
chartMid.Titles.Add(title3);
chartMid.Visible = false;
//
// labelFans
@@ -316,16 +316,16 @@ namespace GHelper
panelPower.Controls.Add(panelTotal);
panelPower.Controls.Add(panelTitleCPU);
panelPower.Dock = DockStyle.Fill;
panelPower.Location = new Point(10, 634);
panelPower.Location = new Point(10, 652);
panelPower.Name = "panelPower";
panelPower.Size = new Size(523, 555);
panelPower.Size = new Size(523, 537);
panelPower.TabIndex = 43;
//
// panelApplyPower
//
panelApplyPower.Controls.Add(checkApplyPower);
panelApplyPower.Dock = DockStyle.Bottom;
panelApplyPower.Location = new Point(0, 463);
panelApplyPower.Location = new Point(0, 445);
panelApplyPower.Name = "panelApplyPower";
panelApplyPower.Padding = new Padding(10);
panelApplyPower.Size = new Size(523, 92);
@@ -348,11 +348,11 @@ namespace GHelper
// labelInfo
//
labelInfo.Dock = DockStyle.Top;
labelInfo.Location = new Point(0, 368);
labelInfo.Location = new Point(0, 342);
labelInfo.Margin = new Padding(4, 0, 4, 0);
labelInfo.Name = "labelInfo";
labelInfo.Padding = new Padding(5);
labelInfo.Size = new Size(523, 92);
labelInfo.Size = new Size(523, 149);
labelInfo.TabIndex = 43;
labelInfo.Text = "Experimental Feature";
//
@@ -364,7 +364,7 @@ namespace GHelper
panelCPU.Controls.Add(label2);
panelCPU.Controls.Add(trackCPU);
panelCPU.Dock = DockStyle.Top;
panelCPU.Location = new Point(0, 232);
panelCPU.Location = new Point(0, 206);
panelCPU.Margin = new Padding(4);
panelCPU.Name = "panelCPU";
panelCPU.Size = new Size(523, 136);
@@ -414,7 +414,7 @@ namespace GHelper
panelTotal.Controls.Add(labelPlatform);
panelTotal.Controls.Add(trackTotal);
panelTotal.Dock = DockStyle.Top;
panelTotal.Location = new Point(0, 92);
panelTotal.Location = new Point(0, 66);
panelTotal.Margin = new Padding(4);
panelTotal.Name = "panelTotal";
panelTotal.Size = new Size(523, 140);
@@ -465,7 +465,7 @@ namespace GHelper
panelTitleCPU.Dock = DockStyle.Top;
panelTitleCPU.Location = new Point(0, 0);
panelTitleCPU.Name = "panelTitleCPU";
panelTitleCPU.Size = new Size(523, 92);
panelTitleCPU.Size = new Size(523, 66);
panelTitleCPU.TabIndex = 42;
//
// pictureBox1
@@ -473,7 +473,7 @@ namespace GHelper
pictureBox1.BackgroundImage = Properties.Resources.icons8_processor_96;
pictureBox1.BackgroundImageLayout = ImageLayout.Zoom;
pictureBox1.InitialImage = null;
pictureBox1.Location = new Point(10, 44);
pictureBox1.Location = new Point(18, 18);
pictureBox1.Margin = new Padding(4, 2, 4, 10);
pictureBox1.Name = "pictureBox1";
pictureBox1.Size = new Size(36, 38);
@@ -484,7 +484,7 @@ namespace GHelper
//
labelPowerLimits.AutoSize = true;
labelPowerLimits.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelPowerLimits.Location = new Point(54, 48);
labelPowerLimits.Location = new Point(62, 20);
labelPowerLimits.Margin = new Padding(4, 0, 4, 0);
labelPowerLimits.Name = "labelPowerLimits";
labelPowerLimits.Size = new Size(229, 32);
@@ -502,9 +502,104 @@ namespace GHelper
panelGPU.Dock = DockStyle.Top;
panelGPU.Location = new Point(10, 0);
panelGPU.Name = "panelGPU";
panelGPU.Size = new Size(523, 634);
panelGPU.Padding = new Padding(0, 0, 0, 18);
panelGPU.Size = new Size(523, 652);
panelGPU.TabIndex = 44;
//
// panelGPUTemp
//
panelGPUTemp.AutoSize = true;
panelGPUTemp.AutoSizeMode = AutoSizeMode.GrowAndShrink;
panelGPUTemp.Controls.Add(labelGPUTemp);
panelGPUTemp.Controls.Add(labelGPUTempTitle);
panelGPUTemp.Controls.Add(trackGPUTemp);
panelGPUTemp.Dock = DockStyle.Top;
panelGPUTemp.Location = new Point(0, 485);
panelGPUTemp.Name = "panelGPUTemp";
panelGPUTemp.Size = new Size(523, 149);
panelGPUTemp.TabIndex = 47;
//
// labelGPUTemp
//
labelGPUTemp.Anchor = AnchorStyles.Top | AnchorStyles.Right;
labelGPUTemp.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelGPUTemp.Location = new Point(378, 14);
labelGPUTemp.Name = "labelGPUTemp";
labelGPUTemp.Size = new Size(130, 32);
labelGPUTemp.TabIndex = 44;
labelGPUTemp.Text = "87C";
labelGPUTemp.TextAlign = ContentAlignment.TopRight;
//
// labelGPUTempTitle
//
labelGPUTempTitle.AutoSize = true;
labelGPUTempTitle.Location = new Point(10, 14);
labelGPUTempTitle.Name = "labelGPUTempTitle";
labelGPUTempTitle.Size = new Size(173, 32);
labelGPUTempTitle.TabIndex = 43;
labelGPUTempTitle.Text = "Thermal Target";
//
// trackGPUTemp
//
trackGPUTemp.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
trackGPUTemp.Location = new Point(6, 57);
trackGPUTemp.Margin = new Padding(4, 2, 4, 2);
trackGPUTemp.Maximum = 87;
trackGPUTemp.Minimum = 75;
trackGPUTemp.Name = "trackGPUTemp";
trackGPUTemp.Size = new Size(502, 90);
trackGPUTemp.TabIndex = 42;
trackGPUTemp.TickFrequency = 5;
trackGPUTemp.TickStyle = TickStyle.TopLeft;
trackGPUTemp.Value = 87;
//
// panelGPUBoost
//
panelGPUBoost.AutoSize = true;
panelGPUBoost.AutoSizeMode = AutoSizeMode.GrowAndShrink;
panelGPUBoost.Controls.Add(labelGPUBoost);
panelGPUBoost.Controls.Add(labelGPUBoostTitle);
panelGPUBoost.Controls.Add(trackGPUBoost);
panelGPUBoost.Dock = DockStyle.Top;
panelGPUBoost.Location = new Point(0, 345);
panelGPUBoost.Name = "panelGPUBoost";
panelGPUBoost.Size = new Size(523, 140);
panelGPUBoost.TabIndex = 46;
//
// labelGPUBoost
//
labelGPUBoost.Anchor = AnchorStyles.Top | AnchorStyles.Right;
labelGPUBoost.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelGPUBoost.Location = new Point(374, 14);
labelGPUBoost.Name = "labelGPUBoost";
labelGPUBoost.Size = new Size(130, 32);
labelGPUBoost.TabIndex = 44;
labelGPUBoost.Text = "25W";
labelGPUBoost.TextAlign = ContentAlignment.TopRight;
//
// labelGPUBoostTitle
//
labelGPUBoostTitle.AutoSize = true;
labelGPUBoostTitle.Location = new Point(10, 14);
labelGPUBoostTitle.Name = "labelGPUBoostTitle";
labelGPUBoostTitle.Size = new Size(174, 32);
labelGPUBoostTitle.TabIndex = 43;
labelGPUBoostTitle.Text = "Dynamic Boost";
//
// trackGPUBoost
//
trackGPUBoost.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
trackGPUBoost.Location = new Point(6, 48);
trackGPUBoost.Margin = new Padding(4, 2, 4, 2);
trackGPUBoost.Maximum = 25;
trackGPUBoost.Minimum = 5;
trackGPUBoost.Name = "trackGPUBoost";
trackGPUBoost.Size = new Size(502, 90);
trackGPUBoost.TabIndex = 42;
trackGPUBoost.TickFrequency = 5;
trackGPUBoost.TickStyle = TickStyle.TopLeft;
trackGPUBoost.Value = 25;
//
// panelGPUMemory
//
panelGPUMemory.AutoSize = true;
@@ -534,9 +629,9 @@ namespace GHelper
labelGPUMemoryTitle.AutoSize = true;
labelGPUMemoryTitle.Location = new Point(10, 14);
labelGPUMemoryTitle.Name = "labelGPUMemoryTitle";
labelGPUMemoryTitle.Size = new Size(169, 32);
labelGPUMemoryTitle.Size = new Size(241, 32);
labelGPUMemoryTitle.TabIndex = 43;
labelGPUMemoryTitle.Text = "Memory Clock";
labelGPUMemoryTitle.Text = "Memory Clock Offset";
//
// trackGPUMemory
//
@@ -636,100 +731,6 @@ namespace GHelper
labelGPU.TabIndex = 40;
labelGPU.Text = "GPU Settings";
//
// panelGPUBoost
//
panelGPUBoost.AutoSize = true;
panelGPUBoost.AutoSizeMode = AutoSizeMode.GrowAndShrink;
panelGPUBoost.Controls.Add(labelGPUBoost);
panelGPUBoost.Controls.Add(labelGPUBoostTitle);
panelGPUBoost.Controls.Add(trackGPUBoost);
panelGPUBoost.Dock = DockStyle.Top;
panelGPUBoost.Location = new Point(0, 345);
panelGPUBoost.Name = "panelGPUBoost";
panelGPUBoost.Size = new Size(523, 140);
panelGPUBoost.TabIndex = 46;
//
// labelGPUBoost
//
labelGPUBoost.Anchor = AnchorStyles.Top | AnchorStyles.Right;
labelGPUBoost.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelGPUBoost.Location = new Point(374, 14);
labelGPUBoost.Name = "labelGPUBoost";
labelGPUBoost.Size = new Size(130, 32);
labelGPUBoost.TabIndex = 44;
labelGPUBoost.Text = "25W";
labelGPUBoost.TextAlign = ContentAlignment.TopRight;
//
// labelGPUBoostTitle
//
labelGPUBoostTitle.AutoSize = true;
labelGPUBoostTitle.Location = new Point(10, 14);
labelGPUBoostTitle.Name = "labelGPUBoostTitle";
labelGPUBoostTitle.Size = new Size(174, 32);
labelGPUBoostTitle.TabIndex = 43;
labelGPUBoostTitle.Text = "Dynamic Boost";
//
// trackGPUBoost
//
trackGPUBoost.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
trackGPUBoost.Location = new Point(6, 48);
trackGPUBoost.Margin = new Padding(4, 2, 4, 2);
trackGPUBoost.Maximum = 25;
trackGPUBoost.Minimum = 5;
trackGPUBoost.Name = "trackGPUBoost";
trackGPUBoost.Size = new Size(502, 90);
trackGPUBoost.TabIndex = 42;
trackGPUBoost.TickFrequency = 5;
trackGPUBoost.TickStyle = TickStyle.TopLeft;
trackGPUBoost.Value = 25;
//
// panelGPUTemp
//
panelGPUTemp.AutoSize = true;
panelGPUTemp.AutoSizeMode = AutoSizeMode.GrowAndShrink;
panelGPUTemp.Controls.Add(labelGPUTemp);
panelGPUTemp.Controls.Add(labelGPUTempTitle);
panelGPUTemp.Controls.Add(trackGPUTemp);
panelGPUTemp.Dock = DockStyle.Top;
panelGPUTemp.Location = new Point(0, 485);
panelGPUTemp.Name = "panelGPUTemp";
panelGPUTemp.Size = new Size(523, 149);
panelGPUTemp.TabIndex = 47;
//
// labelGPUTemp
//
labelGPUTemp.Anchor = AnchorStyles.Top | AnchorStyles.Right;
labelGPUTemp.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelGPUTemp.Location = new Point(378, 14);
labelGPUTemp.Name = "labelGPUTemp";
labelGPUTemp.Size = new Size(130, 32);
labelGPUTemp.TabIndex = 44;
labelGPUTemp.Text = "87C";
labelGPUTemp.TextAlign = ContentAlignment.TopRight;
//
// labelGPUTempTitle
//
labelGPUTempTitle.AutoSize = true;
labelGPUTempTitle.Location = new Point(10, 14);
labelGPUTempTitle.Name = "labelGPUTempTitle";
labelGPUTempTitle.Size = new Size(173, 32);
labelGPUTempTitle.TabIndex = 43;
labelGPUTempTitle.Text = "Thermal Target";
//
// trackGPUTemp
//
trackGPUTemp.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
trackGPUTemp.Location = new Point(6, 57);
trackGPUTemp.Margin = new Padding(4, 2, 4, 2);
trackGPUTemp.Maximum = 87;
trackGPUTemp.Minimum = 75;
trackGPUTemp.Name = "trackGPUTemp";
trackGPUTemp.Size = new Size(502, 90);
trackGPUTemp.TabIndex = 42;
trackGPUTemp.TickFrequency = 5;
trackGPUTemp.TickStyle = TickStyle.TopLeft;
trackGPUTemp.Value = 87;
//
// Fans
//
AutoScaleDimensions = new SizeF(192F, 192F);
@@ -773,6 +774,12 @@ namespace GHelper
((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
panelGPU.ResumeLayout(false);
panelGPU.PerformLayout();
panelGPUTemp.ResumeLayout(false);
panelGPUTemp.PerformLayout();
((System.ComponentModel.ISupportInitialize)trackGPUTemp).EndInit();
panelGPUBoost.ResumeLayout(false);
panelGPUBoost.PerformLayout();
((System.ComponentModel.ISupportInitialize)trackGPUBoost).EndInit();
panelGPUMemory.ResumeLayout(false);
panelGPUMemory.PerformLayout();
((System.ComponentModel.ISupportInitialize)trackGPUMemory).EndInit();
@@ -782,12 +789,6 @@ namespace GHelper
panelTitleGPU.ResumeLayout(false);
panelTitleGPU.PerformLayout();
((System.ComponentModel.ISupportInitialize)pictureGPU).EndInit();
panelGPUBoost.ResumeLayout(false);
panelGPUBoost.PerformLayout();
((System.ComponentModel.ISupportInitialize)trackGPUBoost).EndInit();
panelGPUTemp.ResumeLayout(false);
panelGPUTemp.PerformLayout();
((System.ComponentModel.ISupportInitialize)trackGPUTemp).EndInit();
ResumeLayout(false);
}

View File

@@ -15,6 +15,10 @@ namespace GHelper
static int MinRPM, MaxRPM;
const int fansMax = 100;
NvidiaGpuControl? nvControl = null;
public Fans()
{
@@ -30,10 +34,17 @@ namespace GHelper
buttonReset.Text = Properties.Strings.FactoryDefaults;
checkApplyFans.Text = Properties.Strings.ApplyFanCurve;
labelGPU.Text = Properties.Strings.GPUSettings;
labelGPUCoreTitle.Text = Properties.Strings.GPUCoreClockOffset;
labelGPUMemoryTitle.Text = Properties.Strings.GPUMemoryClockOffset;
labelGPUBoostTitle.Text = Properties.Strings.GPUBoost;
labelGPUTempTitle.Text = Properties.Strings.GPUTempTarget;
InitTheme();
MinRPM = 18;
MaxRPM = HardwareMonitor.GetFanMax();
MaxRPM = HardwareControl.GetFanMax();
labelTip.Visible = false;
labelTip.BackColor = Color.Transparent;
@@ -87,14 +98,14 @@ namespace GHelper
trackGPUCore.Scroll += trackGPU_Scroll;
trackGPUMemory.Scroll += trackGPU_Scroll;
trackGPUBoost.Scroll += trackGPU_Scroll;
trackGPUTemp.Scroll += trackGPU_Scroll;
trackGPUBoost.Scroll += trackGPUPower_Scroll;
trackGPUTemp.Scroll += trackGPUPower_Scroll;
trackGPUCore.MouseUp += TrackGPU_MouseUp;
trackGPUMemory.MouseUp += TrackGPU_MouseUp;
trackGPUBoost.MouseUp += TrackGPUBoost_MouseUp;
trackGPUTemp.MouseUp += TrackGPUBoost_MouseUp;
trackGPUBoost.MouseUp += TrackGPU_MouseUp;
trackGPUTemp.MouseUp += TrackGPU_MouseUp;
//labelInfo.MaximumSize = new Size(280, 0);
labelInfo.Text = Properties.Strings.PPTExperimental;
@@ -103,43 +114,29 @@ namespace GHelper
InitFans();
InitPower();
InitBoost();
InitGPU(true);
comboBoost.SelectedValueChanged += ComboBoost_Changed;
Shown += Fans_Shown;
InitGPUClocks();
}
private void TrackGPUBoost_MouseUp(object? sender, MouseEventArgs e)
{
Program.config.setConfig("gpu_boost", trackGPUBoost.Value);
Program.config.setConfig("gpu_temp", trackGPUTemp.Value);
Program.settingsForm.SetGPUPower();
}
private void TrackGPU_MouseUp(object? sender, MouseEventArgs e)
{
try
{
Program.config.setConfig("gpu_core", trackGPUCore.Value);
Program.config.setConfig("gpu_memory", trackGPUMemory.Value);
int status = Program.nvControl.SetClocks(trackGPUCore.Value, trackGPUMemory.Value);
if (status == -1) Program.RunAsAdmin("gpu");
}
catch (Exception ex)
{
Logger.WriteLine("F:" + ex.ToString());
}
InitGPUClocks();
Program.settingsForm.SetGPUPower();
Program.settingsForm.SetGPUClocks(true);
}
private void InitGPUClocks()
public void InitGPU(bool readClocks = false)
{
if (Program.nvControl is null || !Program.nvControl.IsValid)
if (HardwareControl.GpuControl is not null && HardwareControl.GpuControl.IsNvidia)
{
nvControl = (NvidiaGpuControl)HardwareControl.GpuControl;
}
else
{
panelGPU.Visible = false;
return;
@@ -149,19 +146,45 @@ namespace GHelper
{
panelGPU.Visible = true;
Program.nvControl.GetClocks(out int core, out int memory);
trackGPUCore.Value = Math.Max(Math.Min(core, NvidiaGpuControl.MaxCoreOffset), NvidiaGpuControl.MinCoreOffset);
trackGPUMemory.Value = Math.Max(Math.Min(memory, NvidiaGpuControl.MaxMemoryOffset), NvidiaGpuControl.MinMemoryOffset);
int gpu_boost = Program.config.getConfig("gpu_boost");
int gpu_temp = Program.config.getConfig("gpu_temp");
int gpu_boost = Program.config.getConfigPerf("gpu_boost");
int gpu_temp = Program.config.getConfigPerf("gpu_temp");
int core = Program.config.getConfigPerf("gpu_core");
int memory = Program.config.getConfigPerf("gpu_memory");
if (gpu_boost < 0) gpu_boost = ASUSWmi.MaxGPUBoost;
if (gpu_temp < 0) gpu_temp = ASUSWmi.MaxGPUTemp;
if (core == -1) core = 0;
if (memory == -1) memory = 0;
//if (readClocks)
//{
int status = nvControl.GetClocks(out int current_core, out int current_memory);
if (status != -1)
{
core = current_core;
memory = current_memory;
}
try
{
labelGPU.Text = nvControl.FullName;
} catch
{
}
//}
trackGPUCore.Value = Math.Max(Math.Min(core, NvidiaGpuControl.MaxCoreOffset), NvidiaGpuControl.MinCoreOffset);
trackGPUMemory.Value = Math.Max(Math.Min(memory, NvidiaGpuControl.MaxMemoryOffset), NvidiaGpuControl.MinMemoryOffset);
trackGPUBoost.Value = Math.Max(Math.Min(gpu_boost, ASUSWmi.MaxGPUBoost), ASUSWmi.MinGPUBoost);
trackGPUTemp.Value = Math.Max(Math.Min(gpu_temp, ASUSWmi.MaxGPUTemp), ASUSWmi.MinGPUTemp);
panelGPUBoost.Visible = (Program.wmi.DeviceGet(ASUSWmi.PPT_GPUC0) >= 0);
panelGPUTemp.Visible = (Program.wmi.DeviceGet(ASUSWmi.PPT_GPUC2) >= 0);
VisualiseGPUSettings();
}
@@ -183,6 +206,22 @@ namespace GHelper
private void trackGPU_Scroll(object? sender, EventArgs e)
{
if (sender is null) return;
TrackBar track = (TrackBar)sender;
track.Value = (int)Math.Round((float)track.Value / 5) * 5;
Program.config.setConfigPerf("gpu_core", trackGPUCore.Value);
Program.config.setConfigPerf("gpu_memory", trackGPUMemory.Value);
VisualiseGPUSettings();
}
private void trackGPUPower_Scroll(object? sender, EventArgs e)
{
Program.config.setConfigPerf("gpu_boost", trackGPUBoost.Value);
Program.config.setConfigPerf("gpu_temp", trackGPUTemp.Value);
VisualiseGPUSettings();
}
@@ -215,7 +254,7 @@ namespace GHelper
chart.ChartAreas[0].AxisX.Interval = 10;
chart.ChartAreas[0].AxisY.Minimum = 0;
chart.ChartAreas[0].AxisY.Maximum = 100;
chart.ChartAreas[0].AxisY.Maximum = fansMax;
chart.ChartAreas[0].AxisY.LabelStyle.Font = new Font("Arial", 7F);
@@ -224,10 +263,10 @@ namespace GHelper
chart.ChartAreas[0].AxisX.LineColor = chartGrid;
chart.ChartAreas[0].AxisY.LineColor = chartGrid;
for (int i = 0; i <= 90; i += 10)
for (int i = 0; i <= fansMax-10; i += 10)
chart.ChartAreas[0].AxisY.CustomLabels.Add(i - 2, i + 2, ChartPercToRPM(i));
chart.ChartAreas[0].AxisY.CustomLabels.Add(98, 102, Properties.Strings.RPM);
chart.ChartAreas[0].AxisY.CustomLabels.Add(fansMax-2, fansMax+2, Properties.Strings.RPM);
chart.ChartAreas[0].AxisY.Interval = 10;
@@ -238,6 +277,8 @@ namespace GHelper
private void Fans_Shown(object? sender, EventArgs e)
{
panelSliders.Visible = panelGPU.Visible || panelPower.Visible;
if (Height > Program.settingsForm.Height)
{
Top = Program.settingsForm.Top + Program.settingsForm.Height - Height;
@@ -249,8 +290,8 @@ namespace GHelper
Top = Program.settingsForm.Top;
}
Left = Program.settingsForm.Left - Width - 5;
}
@@ -337,13 +378,13 @@ namespace GHelper
bool cpuBmode = (Program.wmi.DeviceGet(ASUSWmi.PPT_CPUB0) >= 0); // 2022 model +
bool cpuAmode = (Program.wmi.DeviceGet(ASUSWmi.PPT_TotalA0) >= 0); // 2021 model +
panelSliders.Visible = cpuAmode;
panelPower.Visible = cpuAmode;
panelCPU.Visible = cpuBmode;
// Yes, that's stupid, but Total slider on 2021 model actually adjusts CPU PPT
if (!cpuBmode)
{
labelPlatform.Text = "CPU SPPT";
labelPlatform.Text = "CPU PPT";
}
int limit_total;
@@ -434,11 +475,16 @@ namespace GHelper
int mode = Program.config.getConfig("performance_mode");
byte[] curve = Program.config.getFanConfig(device);
if (def == 1 || curve.Length != 16)
if (def == 1 || ASUSWmi.IsEmptyCurve(curve))
{
curve = Program.wmi.GetFanCurve(device, mode);
if (ASUSWmi.IsEmptyCurve(curve))
curve = Program.config.getDefaultCurve(device);
if (curve.Length != 16 || curve.All(singleByte => singleByte == 0))
curve = Program.config.getDefaultCurve(device);
curve = ASUSWmi.FixFanCurve(curve);
}
//Debug.WriteLine(BitConverter.ToString(curve));
@@ -486,6 +532,20 @@ namespace GHelper
Program.config.setConfigPerf("auto_apply_power", 0);
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
trackGPUCore.Value = 0;
trackGPUMemory.Value = 0;
trackGPUBoost.Value = ASUSWmi.MaxGPUBoost;
trackGPUTemp.Value = ASUSWmi.MaxGPUTemp;
Program.config.setConfigPerf("gpu_boost", trackGPUBoost.Value);
Program.config.setConfigPerf("gpu_temp", trackGPUTemp.Value);
Program.config.setConfigPerf("gpu_core", trackGPUCore.Value);
Program.config.setConfigPerf("gpu_memory", trackGPUMemory.Value);
VisualiseGPUSettings();
Program.settingsForm.SetGPUClocks(true);
Program.settingsForm.SetGPUPower();
}
private void ChartCPU_MouseUp(object? sender, MouseEventArgs e)
@@ -537,7 +597,7 @@ namespace GHelper
if (dx > 100) dx = 100;
if (dy < 0) dy = 0;
if (dy > 100) dy = 100;
if (dy > fansMax) dy = fansMax;
dymin = (dx - 65) * 1.2;

View File

@@ -16,7 +16,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AssemblyVersion>0.58</AssemblyVersion>
<AssemblyVersion>0.64</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -59,8 +59,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="FftSharp" Version="2.0.0" />
<PackageReference Include="hidlibrary" Version="3.3.40" />
<PackageReference Include="HidSharpCore" Version="1.2.1.1" />
<PackageReference Include="NAudio" Version="2.1.0" />
<PackageReference Include="System.Management" Version="7.0.1" />
<PackageReference Include="TaskScheduler" Version="2.10.1" />
<PackageReference Include="WinForms.DataVisualization" Version="1.8.0" />

View File

@@ -11,7 +11,7 @@ public class AmdGpuControl : IGpuControl {
public bool IsNvidia => false;
public string FullName => _internalDiscreteAdapter!.AdapterName;
public AmdGpuControl() {
if (!Adl2.Load())
return;

View File

@@ -1,8 +1,9 @@
namespace GHelper.Gpu;
public interface IGpuControl : IDisposable {
public interface IGpuControl : IDisposable {
bool IsNvidia { get; }
bool IsValid { get; }
public string FullName { get; }
int? GetCurrentTemperature();
int? GetGpuUse();
}

View File

@@ -1,8 +1,12 @@
using NvAPIWrapper.GPU;
using NvAPIWrapper.Native;
using NvAPIWrapper.Native.Delegates;
using NvAPIWrapper.Native.GPU;
using NvAPIWrapper.Native.GPU.Structures;
using NvAPIWrapper.Native.Interfaces.GPU;
using System;
using System.Diagnostics;
using System.Management;
using static NvAPIWrapper.Native.GPU.Structures.PerformanceStates20InfoV1;
namespace GHelper.Gpu;
@@ -16,7 +20,7 @@ public class NvidiaGpuControl : IGpuControl
public const int MinCoreOffset = -250;
public const int MinMemoryOffset = -250;
private readonly PhysicalGPU? _internalGpu;
private static PhysicalGPU? _internalGpu;
public NvidiaGpuControl()
{
@@ -27,6 +31,8 @@ public class NvidiaGpuControl : IGpuControl
public bool IsNvidia => IsValid;
public string FullName => _internalGpu!.FullName;
public int? GetCurrentTemperature()
{
if (!IsValid)
@@ -45,19 +51,83 @@ public class NvidiaGpuControl : IGpuControl
}
public void GetClocks(out int core, out int memory)
public int GetClocks(out int core, out int memory)
{
PhysicalGPU internalGpu = _internalGpu!;
Logger.WriteLine(internalGpu.FullName);
Logger.WriteLine(internalGpu.ArchitectInformation.ToString());
IPerformanceStates20Info states = GPUApi.GetPerformanceStates20(internalGpu.Handle);
//Logger.WriteLine(internalGpu.FullName);
//Logger.WriteLine(internalGpu.ArchitectInformation.ToString());
Logger.WriteLine("IPerformanceStates20Info type : " + states.GetType());
try
{
IPerformanceStates20Info states = GPUApi.GetPerformanceStates20(internalGpu.Handle);
core = states.Clocks[PerformanceStateId.P0_3DPerformance][0].FrequencyDeltaInkHz.DeltaValue / 1000;
memory = states.Clocks[PerformanceStateId.P0_3DPerformance][1].FrequencyDeltaInkHz.DeltaValue / 1000;
Logger.WriteLine($"GET GPU CLOCKS: {core}, {memory}");
return 0;
core = states.Clocks[PerformanceStateId.P0_3DPerformance][0].FrequencyDeltaInkHz.DeltaValue / 1000;
memory = states.Clocks[PerformanceStateId.P0_3DPerformance][1].FrequencyDeltaInkHz.DeltaValue / 1000;
} catch (Exception ex)
{
Logger.WriteLine("GET GPU CLOCKS:" + ex.Message);
core = memory = 0;
return -1;
}
}
private static void RunCMD(string name, string args)
{
var cmd = new Process();
cmd.StartInfo.UseShellExecute = false;
cmd.StartInfo.CreateNoWindow = true;
cmd.StartInfo.RedirectStandardOutput = true;
cmd.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
cmd.StartInfo.FileName = name;
cmd.StartInfo.Arguments = args;
cmd.Start();
Logger.WriteLine(cmd.StandardOutput.ReadToEnd());
cmd.WaitForExit();
}
public bool RestartGPUPnP()
{
if (!IsValid) return false;
try
{
PhysicalGPU internalGpu = _internalGpu!;
var pnpDeviceId = internalGpu.BusInformation.PCIIdentifiers.ToString();
Logger.WriteLine("Device ID:" + pnpDeviceId);
RunCMD("pnputil", $"/disable-device /deviceid \"{pnpDeviceId}\"");
Thread.Sleep(3000);
RunCMD("pnputil", $"/enable-device /deviceid \"{pnpDeviceId}\"");
Thread.Sleep(2000);
return true;
}
catch (Exception ex)
{
Logger.WriteLine(ex.ToString());
return false;
}
}
public bool RestartGPU()
{
try
{
string script = @"$device = Get-PnpDevice | Where-Object { $_.FriendlyName -imatch 'NVIDIA' -and $_.Class -eq 'Display' }; Disable-PnpDevice $device.InstanceId -Confirm:$false; Start-Sleep -Seconds 3; Enable-PnpDevice $device.InstanceId -Confirm:$false";
Logger.WriteLine(script);
RunCMD("powershell", script);
//Thread.Sleep(2000);
return true;
}
catch (Exception ex )
{
Logger.WriteLine(ex.ToString());
return false;
}
}
public int SetClocksFromConfig()
@@ -79,7 +149,7 @@ public class NvidiaGpuControl : IGpuControl
var coreClock = new PerformanceStates20ClockEntryV1(PublicClockDomain.Graphics, new PerformanceStates20ParameterDelta(core * 1000));
var memoryClock = new PerformanceStates20ClockEntryV1(PublicClockDomain.Memory, new PerformanceStates20ParameterDelta(memory * 1000));
PerformanceStates20ClockEntryV1[] clocks = { coreClock , memoryClock};
PerformanceStates20ClockEntryV1[] clocks = { coreClock, memoryClock };
PerformanceStates20BaseVoltageEntryV1[] voltages = { };
PerformanceState20[] performanceStates = { new PerformanceState20(PerformanceStateId.P0_3DPerformance, clocks, voltages) };
@@ -88,11 +158,12 @@ public class NvidiaGpuControl : IGpuControl
try
{
Logger.WriteLine($"SET GPU CLOCKS: {core}, {memory}");
GPUApi.SetPerformanceStates20(internalGpu.Handle, overclock);
}
catch (Exception ex)
{
Logger.WriteLine(ex.ToString());
Logger.WriteLine("SET GPU CLOCKS: "+ex.Message);
return -1;
}
@@ -111,7 +182,7 @@ public class NvidiaGpuControl : IGpuControl
}
catch (Exception ex)
{
Logger.WriteLine(ex.ToString());
Logger.WriteLine(ex.Message);
return null;
}
}

View File

@@ -2,7 +2,7 @@
using GHelper.Gpu;
using System.Diagnostics;
public static class HardwareMonitor
public static class HardwareControl
{
public static IGpuControl? GpuControl;
@@ -38,12 +38,12 @@ public static class HardwareMonitor
}
int fanMax = GetFanMax();
if (fan > fanMax) SetFanMax(fan);
if (fan > fanMax && fan < 110) SetFanMax(fan);
if (Program.config.getConfig("fan_rpm") == 1)
return " Fan: " + (fan * 100).ToString() + "RPM";
return GHelper.Properties.Strings.FanSpeed + (fan * 100).ToString() + GHelper.Properties.Strings.RPM;
else
return " Fan: " + Math.Min(Math.Round((float)fan / fanMax * 100), 100).ToString() + "%"; // relatively to 6000 rpm
return GHelper.Properties.Strings.FanSpeed + Math.Min(Math.Round((float)fan / fanMax * 100), 100).ToString() + "%"; // relatively to 6000 rpm
}
private static int GetGpuUse()
@@ -51,6 +51,7 @@ public static class HardwareMonitor
try
{
int? gpuUse = GpuControl?.GetGpuUse();
Logger.WriteLine("GPU usage: " + GpuControl?.FullName + " " + gpuUse + "%");
if (gpuUse is not null) return (int)gpuUse;
}
catch (Exception ex)
@@ -81,9 +82,9 @@ public static class HardwareMonitor
cpuTemp = ct.NextValue() - 273;
}
}
catch
catch (Exception ex)
{
Debug.WriteLine("Failed reading CPU temp");
Debug.WriteLine("Failed reading CPU temp :" + ex.Message);
}
try
@@ -94,8 +95,7 @@ public static class HardwareMonitor
catch (Exception ex)
{
gpuTemp = -1;
Debug.WriteLine("Failed reading GPU temp");
Debug.WriteLine(ex.ToString());
Debug.WriteLine("Failed reading GPU temp :" + ex.Message);
}
if (gpuTemp is null || gpuTemp < 0)
@@ -114,7 +114,7 @@ public static class HardwareMonitor
}
}
public static bool IsUsedGPU(int threshold = 20)
public static bool IsUsedGPU(int threshold = 10)
{
if (GetGpuUse() > threshold)
{
@@ -124,9 +124,17 @@ public static class HardwareMonitor
return false;
}
public static NvidiaGpuControl? GetNvidiaGpuControl()
{
if ((bool)GpuControl?.IsNvidia)
return (NvidiaGpuControl)GpuControl;
else
return null;
}
public static void RecreateGpuControlWithDelay(int delay = 5)
{
// Re-enabling the discrete GPU takes a bit of time,
// so a simple workaround is to refresh again after that happens
Task.Run(async () =>
@@ -134,9 +142,6 @@ public static class HardwareMonitor
await Task.Delay(TimeSpan.FromSeconds(delay));
RecreateGpuControl();
});
}
public static void RecreateGpuControl()
@@ -145,8 +150,6 @@ public static class HardwareMonitor
{
GpuControl?.Dispose();
// Detect valid GPU temperature provider.
// We start with NVIDIA because there's always at least an integrated AMD GPU
IGpuControl _gpuControl = new NvidiaGpuControl();
if (_gpuControl.IsValid)
{
@@ -156,7 +159,6 @@ public static class HardwareMonitor
_gpuControl.Dispose();
/*
_gpuControl = new AmdGpuControl();
if (_gpuControl.IsValid)
{
@@ -164,7 +166,6 @@ public static class HardwareMonitor
return;
}
_gpuControl.Dispose();
*/
GpuControl = null;
}

View File

@@ -647,12 +647,14 @@ public class NativeMethods
//Logger.WriteLine(screen.DeviceName);
count++;
}
if (displayNum > 0 && count == 0) laptopScreen = defaultDevice;
}
catch (Exception ex)
{
Logger.WriteLine(ex.ToString());
Logger.WriteLine("Can't detect internal screen");
//laptopScreen = Screen.PrimaryScreen.DeviceName;
laptopScreen = Screen.PrimaryScreen.DeviceName;
}
@@ -761,6 +763,7 @@ public class NativeMethods
{
PowerSetActiveScheme(IntPtr.Zero, new Guid(scheme));
PowerSetActiveOverlayScheme(new Guid(scheme));
Logger.WriteLine(scheme);
}
public static void SetPowerScheme(int mode)

View File

@@ -1,481 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using NvAPIWrapper.Native;
using NvAPIWrapper.Native.DRS;
using NvAPIWrapper.Native.DRS.Structures;
namespace NvAPIWrapper.DRS
{
/// <summary>
/// Represents a NVIDIA driver settings profile
/// </summary>
public class DriverSettingsProfile
{
internal DriverSettingsProfile(DRSProfileHandle handle, DriverSettingsSession parentSession)
{
Handle = handle;
Session = parentSession;
}
/// <summary>
/// Gets a list of applications under this profile
/// </summary>
public IEnumerable<ProfileApplication> Applications
{
get
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid profile instance."
);
}
return DRSApi.EnumApplications(Session.Handle, Handle)
.Select(application => new ProfileApplication(application, this));
}
}
/// <summary>
/// Gets or sets the profile support value for GPU series
/// </summary>
public DRSGPUSupport GPUSupport
{
get
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid profile instance."
);
}
var profileInfo = DRSApi.GetProfileInfo(Session.Handle, Handle);
return profileInfo.GPUSupport;
}
set
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid profile instance."
);
}
var profileInfo = DRSApi.GetProfileInfo(Session.Handle, Handle);
profileInfo.GPUSupport = value;
DRSApi.SetProfileInfo(Session.Handle, Handle, profileInfo);
}
}
/// <summary>
/// Gets the profile handle
/// </summary>
public DRSProfileHandle Handle { get; private set; }
/// <summary>
/// Gets a boolean value indicating if this profile is predefined
/// </summary>
public bool IsPredefined
{
get
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid profile instance."
);
}
var profileInfo = DRSApi.GetProfileInfo(Session.Handle, Handle);
return profileInfo.IsPredefined;
}
}
/// <summary>
/// Gets a boolean value indicating if this profile is valid and contains a non-zero handle
/// </summary>
public bool IsValid
{
get => !Handle.IsNull;
}
/// <summary>
/// Gets the name of the profile
/// </summary>
public string Name
{
get
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid profile instance."
);
}
var profileInfo = DRSApi.GetProfileInfo(Session.Handle, Handle);
return profileInfo.Name;
}
}
/// <summary>
/// Gets the number of application registered under this profile
/// </summary>
public int NumberOfApplications
{
get
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid profile instance."
);
}
var profileInfo = DRSApi.GetProfileInfo(Session.Handle, Handle);
return profileInfo.NumberOfApplications;
}
}
/// <summary>
/// Gets the number of settings under this profile
/// </summary>
public int NumberOfSettings
{
get
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid profile instance."
);
}
var profileInfo = DRSApi.GetProfileInfo(Session.Handle, Handle);
return profileInfo.NumberOfSettings;
}
}
/// <summary>
/// Gets the session that had queried this profile
/// </summary>
public DriverSettingsSession Session { get; }
/// <summary>
/// Gets a list of settings under this profile
/// </summary>
public IEnumerable<ProfileSetting> Settings
{
get
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid profile instance."
);
}
return DRSApi.EnumSettings(Session.Handle, Handle).Select(setting => new ProfileSetting(setting));
}
}
/// <summary>
/// Creates a new profile
/// </summary>
/// <param name="session">The session to create this profile in.</param>
/// <param name="profileName">The name of the profile.</param>
/// <param name="gpuSupport">The supported GPU series for this profile.</param>
/// <returns>An instance of <see cref="DriverSettingsProfile" /> representing this newly created profile.</returns>
public static DriverSettingsProfile CreateProfile(
DriverSettingsSession session,
string profileName,
DRSGPUSupport? gpuSupport = null)
{
gpuSupport = gpuSupport ?? new DRSGPUSupport();
var profileInfo = new DRSProfileV1(profileName, gpuSupport.Value);
var profileHandle = DRSApi.CreateProfile(session.Handle, profileInfo);
return new DriverSettingsProfile(profileHandle, session);
}
/// <inheritdoc />
public override string ToString()
{
if (!IsValid)
{
return "[Invalid]";
}
if (IsPredefined)
{
return $"{Name} (Predefined)";
}
return Name;
}
/// <summary>
/// Deletes this profile and makes this instance invalid.
/// </summary>
public void Delete()
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid profile instance."
);
}
DRSApi.DeleteProfile(Session.Handle, Handle);
Handle = DRSProfileHandle.DefaultHandle;
}
/// <summary>
/// Deletes an application by its name.
/// </summary>
/// <param name="applicationName">The name of the application to be deleted.</param>
public void DeleteApplicationByName(string applicationName)
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid profile instance."
);
}
DRSApi.DeleteApplication(Session.Handle, Handle, applicationName);
}
/// <summary>
/// Deletes a setting by its identification number
/// </summary>
/// <param name="settingId">The identification number of the setting to be deleted.</param>
public void DeleteSetting(uint settingId)
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid profile instance."
);
}
DRSApi.DeleteProfileSetting(Session.Handle, Handle, settingId);
}
/// <summary>
/// Deletes a setting by its known identification number.
/// </summary>
/// <param name="settingId">The known identification number of the setting to be deleted.</param>
public void DeleteSetting(KnownSettingId settingId)
{
DeleteSetting(SettingInfo.GetSettingId(settingId));
}
/// <summary>
/// Finds an application by its name.
/// </summary>
/// <param name="applicationName">The name of the application to search for.</param>
/// <returns>
/// An instance of <see cref="ProfileApplication" /> if an application is found; otherwise <see langword="null" />
/// .
/// </returns>
public ProfileApplication GetApplicationByName(string applicationName)
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid profile instance."
);
}
var application = DRSApi.GetApplicationInfo(Session.Handle, Handle, applicationName);
if (application == null)
{
return null;
}
return new ProfileApplication(application, this);
}
/// <summary>
/// Searches for a setting using its identification number.
/// </summary>
/// <param name="settingId">The identification number of the setting to search for.</param>
/// <returns>An instance of <see cref="ProfileSetting" /> if a setting is found; otherwise <see langword="null" />.</returns>
public ProfileSetting GetSetting(uint settingId)
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid profile instance."
);
}
var setting = DRSApi.GetSetting(Session.Handle, Handle, settingId);
if (setting == null)
{
return null;
}
return new ProfileSetting(setting.Value);
}
/// <summary>
/// Searches for a setting using its known identification number.
/// </summary>
/// <param name="settingId">The known identification number of the setting to search for.</param>
/// <returns>An instance of <see cref="ProfileSetting" /> if a setting is found; otherwise <see langword="null" />.</returns>
public ProfileSetting GetSetting(KnownSettingId settingId)
{
return GetSetting(SettingInfo.GetSettingId(settingId));
}
/// <summary>
/// Restores applications and settings of this profile to their default. This also deletes custom profiles resulting in
/// their handles becoming invalid.
/// </summary>
public void RestoreDefaults()
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid profile instance."
);
}
var isPredefined = IsPredefined;
DRSApi.RestoreDefaults(Session.Handle, Handle);
if (!isPredefined)
{
Handle = DRSProfileHandle.DefaultHandle;
}
}
/// <summary>
/// Restores a setting to its default value.
/// </summary>
/// <param name="settingId">The identification number of the setting.</param>
public void RestoreSettingToDefault(uint settingId)
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid profile instance."
);
}
DRSApi.RestoreDefaults(Session.Handle, Handle, settingId);
}
/// <summary>
/// Restores a setting to its default value.
/// </summary>
/// <param name="settingId">The known identification number of the setting.</param>
public void RestoreSettingToDefault(KnownSettingId settingId)
{
RestoreSettingToDefault(SettingInfo.GetSettingId(settingId));
}
/// <summary>
/// Sets a new value for a setting or creates a new setting and sets its value
/// </summary>
/// <param name="settingId">The known identification number of the setting to change its value.</param>
/// <param name="settingType">The type of the setting value.</param>
/// <param name="value">The new value for the setting.</param>
public void SetSetting(KnownSettingId settingId, DRSSettingType settingType, object value)
{
SetSetting(SettingInfo.GetSettingId(settingId), settingType, value);
}
/// <summary>
/// Sets a new value for a setting or creates a new setting and sets its value
/// </summary>
/// <param name="settingId">The known identification number of the setting to change its value.</param>
/// <param name="value">The new value for the setting.</param>
public void SetSetting(KnownSettingId settingId, string value)
{
SetSetting(SettingInfo.GetSettingId(settingId), value);
}
/// <summary>
/// Sets a new value for a setting or creates a new setting and sets its value
/// </summary>
/// <param name="settingId">The known identification number of the setting to change its value.</param>
/// <param name="value">The new value for the setting.</param>
public void SetSetting(KnownSettingId settingId, byte[] value)
{
SetSetting(SettingInfo.GetSettingId(settingId), value);
}
/// <summary>
/// Sets a new value for a setting or creates a new setting and sets its value
/// </summary>
/// <param name="settingId">The known identification number of the setting to change its value.</param>
/// <param name="value">The new value for the setting.</param>
public void SetSetting(KnownSettingId settingId, uint value)
{
SetSetting(SettingInfo.GetSettingId(settingId), value);
}
/// <summary>
/// Sets a new value for a setting or creates a new setting and sets its value
/// </summary>
/// <param name="settingId">The identification number of the setting to change its value.</param>
/// <param name="settingType">The type of the setting value.</param>
/// <param name="value">The new value for the setting.</param>
public void SetSetting(uint settingId, DRSSettingType settingType, object value)
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid profile instance."
);
}
var setting = new DRSSettingV1(settingId, settingType, value);
DRSApi.SetSetting(Session.Handle, Handle, setting);
}
/// <summary>
/// Sets a new value for a setting or creates a new setting and sets its value
/// </summary>
/// <param name="settingId">The identification number of the setting to change its value.</param>
/// <param name="value">The new value for the setting.</param>
public void SetSetting(uint settingId, string value)
{
SetSetting(settingId, DRSSettingType.UnicodeString, value);
}
/// <summary>
/// Sets a new value for a setting or creates a new setting and sets its value
/// </summary>
/// <param name="settingId">The identification number of the setting to change its value.</param>
/// <param name="value">The new value for the setting.</param>
public void SetSetting(uint settingId, byte[] value)
{
SetSetting(settingId, DRSSettingType.Binary, value);
}
/// <summary>
/// Sets a new value for a setting or creates a new setting and sets its value
/// </summary>
/// <param name="settingId">The identification number of the setting to change its value.</param>
/// <param name="value">The new value for the setting.</param>
public void SetSetting(uint settingId, uint value)
{
SetSetting(settingId, DRSSettingType.Integer, value);
}
}
}

View File

@@ -1,236 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using NvAPIWrapper.Native;
using NvAPIWrapper.Native.DRS.Structures;
namespace NvAPIWrapper.DRS
{
/// <summary>
/// Represents a driver settings session. This is the starting point for using DRS set of functionalities.
/// </summary>
public class DriverSettingsSession : IDisposable
{
internal DriverSettingsSession(DRSSessionHandle handle)
{
Handle = handle;
}
private DriverSettingsSession() : this(DRSApi.CreateSession())
{
}
/// <summary>
/// Gets the base settings profile
/// </summary>
public DriverSettingsProfile BaseProfile
{
get
{
var profileHandle = DRSApi.GetBaseProfile(Handle);
if (profileHandle.IsNull)
{
return null;
}
return new DriverSettingsProfile(profileHandle, this);
}
}
/// <summary>
/// Gets the global settings profile
/// </summary>
public DriverSettingsProfile CurrentGlobalProfile
{
get
{
var profileHandle = DRSApi.GetCurrentGlobalProfile(Handle);
if (profileHandle.IsNull)
{
return null;
}
return new DriverSettingsProfile(profileHandle, this);
}
set
{
if (value == null)
{
throw new ArgumentNullException(nameof(value));
}
if (string.IsNullOrEmpty(value.Name))
{
throw new ArgumentException("Profile name can not be empty.", nameof(value));
}
DRSApi.SetCurrentGlobalProfile(Handle, value.Name);
}
}
/// <summary>
/// Gets the session handle
/// </summary>
public DRSSessionHandle Handle { get; }
/// <summary>
/// Gets the number of registered profiles
/// </summary>
public int NumberOfProfiles
{
get => DRSApi.GetNumberOfProfiles(Handle);
}
/// <summary>
/// Gets the list of all registered profiles
/// </summary>
public IEnumerable<DriverSettingsProfile> Profiles
{
get { return DRSApi.EnumProfiles(Handle).Select(handle => new DriverSettingsProfile(handle, this)); }
}
/// <inheritdoc />
public void Dispose()
{
ReleaseUnmanagedResources();
GC.SuppressFinalize(this);
}
/// <summary>
/// Creates a new session and load the settings
/// </summary>
/// <returns>A new instance of <see cref="DriverSettingsSession" /> representing a session.</returns>
public static DriverSettingsSession CreateAndLoad()
{
var session = new DriverSettingsSession();
session.Load();
return session;
}
/// <summary>
/// Creates a new session and load the settings from a file
/// </summary>
/// <param name="fileName">The full path of file to load settings from.</param>
/// <returns>A new instance of <see cref="DriverSettingsSession" /> representing a session.</returns>
public static DriverSettingsSession CreateAndLoad(string fileName)
{
var session = new DriverSettingsSession();
session.Load(fileName);
return session;
}
/// <inheritdoc />
public override string ToString()
{
return $"{Handle} ({NumberOfProfiles} Profiles)";
}
/// <summary>
/// Finds an application by name. This method is useful when passed a full path of a file as it does return an
/// application almost always describing the NVIDIA driver behavior regarding the passed executable file.
/// </summary>
/// <param name="applicationName">The name of the application (with extension) or the full path of an executable file.</param>
/// <returns>An instance of <see cref="ProfileApplication" /> class.</returns>
public ProfileApplication FindApplication(string applicationName)
{
var application = DRSApi.FindApplicationByName(Handle, applicationName, out var profileHandle);
if (application == null || !profileHandle.HasValue || profileHandle.Value.IsNull)
{
return null;
}
var profile = new DriverSettingsProfile(profileHandle.Value, this);
return new ProfileApplication(application, profile);
}
/// <summary>
/// Finds a profile based on the application named passed. This method is useful when passed a full path of a file as
/// it does return a profile almost always describing the NVIDIA driver behavior regarding the passed executable file.
/// </summary>
/// <param name="applicationName">The name of the application (with extension) or the full path of an executable file.</param>
/// <returns>
/// An instance of <see cref="DriverSettingsProfile" /> class describing the NVIDIA driver behavior regarding the
/// passed executable file.
/// </returns>
public DriverSettingsProfile FindApplicationProfile(string applicationName)
{
var application = DRSApi.FindApplicationByName(Handle, applicationName, out var profileHandle);
if (application == null || !profileHandle.HasValue || profileHandle.Value.IsNull)
{
return null;
}
return new DriverSettingsProfile(profileHandle.Value, this);
}
/// <summary>
/// Finds a profile based on its name.
/// </summary>
/// <param name="profileName">The profile name to search for.</param>
/// <returns>An instance of <see cref="DriverSettingsProfile" /> class.</returns>
public DriverSettingsProfile FindProfileByName(string profileName)
{
var profileHandle = DRSApi.FindProfileByName(Handle, profileName);
if (profileHandle.IsNull)
{
return null;
}
return new DriverSettingsProfile(profileHandle, this);
}
/// <summary>
/// Resets all settings to default.
/// </summary>
public void RestoreDefaults()
{
DRSApi.RestoreDefaults(Handle);
}
/// <summary>
/// Saves the current session settings
/// </summary>
public void Save()
{
DRSApi.SaveSettings(Handle);
}
/// <summary>
/// Saves the current session settings to a file
/// </summary>
/// <param name="fileName">The full path of file to save settings to.</param>
public void Save(string fileName)
{
DRSApi.SaveSettings(Handle, fileName);
}
private void Load()
{
DRSApi.LoadSettings(Handle);
}
private void Load(string fileName)
{
DRSApi.LoadSettings(Handle, fileName);
}
private void ReleaseUnmanagedResources()
{
DRSApi.DestroySession(Handle);
}
/// <inheritdoc />
~DriverSettingsSession()
{
ReleaseUnmanagedResources();
}
}
}

View File

@@ -1,555 +0,0 @@
using System.ComponentModel;
namespace NvAPIWrapper.DRS
{
#pragma warning disable 1591
public enum KnownSettingId : uint
{
/// <summary>
/// Antialiasing - Line gamma
/// </summary>
[Description("Antialiasing - Line gamma")]
OpenGLAntiAliasingLineGamma = 0x2089BF6C,
/// <summary>
/// Deep color for 3D applications
/// </summary>
[Description("Deep color for 3D applications")]
OpenGLDeepColorScanOut = 0x2097C2F6,
/// <summary>
/// OpenGL default swap interval
/// </summary>
[Description("OpenGL default swap interval")]
OpenGLDefaultSwapInterval = 0x206A6582,
/// <summary>
/// OpenGL default swap interval fraction
/// </summary>
[Description("OpenGL default swap interval fraction")]
OpenGLDefaultSwapIntervalFractional = 0x206C4581,
/// <summary>
/// OpenGL default swap interval sign
/// </summary>
[Description("OpenGL default swap interval sign")]
OpenGLDefaultSwapIntervalSign = 0x20655CFA,
/// <summary>
/// Event Log Severity Threshold
/// </summary>
[Description("Event Log Severity Threshold")]
OpenGLEventLogSeverityThreshold = 0x209DF23E,
/// <summary>
/// Extension String version
/// </summary>
[Description("Extension String version")]
OpenGLExtensionStringVersion = 0x20FF7493,
/// <summary>
/// Buffer-flipping mode
/// </summary>
[Description("Buffer-flipping mode")] OpenGLForceBlit = 0x201F619F,
/// <summary>
/// Force Stereo shuttering
/// </summary>
[Description("Force Stereo shuttering")]
OpenGLForceStereo = 0x204D9A0C,
/// <summary>
/// Preferred OpenGL GPU
/// </summary>
[Description("Preferred OpenGL GPU")] OpenGLImplicitGPUAffinity = 0x20D0F3E6,
/// <summary>
/// Maximum frames allowed
/// </summary>
[Description("Maximum frames allowed")]
OpenGLMaximumFramesAllowed = 0x208E55E3,
/// <summary>
/// Exported Overlay pixel types
/// </summary>
[Description("Exported Overlay pixel types")]
OpenGLOverlayPixelType = 0x209AE66F,
/// <summary>
/// Enable overlay
/// </summary>
[Description("Enable overlay")] OpenGLOverlaySupport = 0x206C28C4,
/// <summary>
/// High level control of the rendering quality on OpenGL
/// </summary>
[Description("High level control of the rendering quality on OpenGL")]
OpenGLQualityEnhancements = 0x20797D6C,
/// <summary>
/// Unified back/depth buffer
/// </summary>
[Description("Unified back/depth buffer")]
OpenGLSingleBackDepthBuffer = 0x20A29055,
/// <summary>
/// Enable NV_gpu_multicast extension
/// </summary>
[Description("Enable NV_gpu_multicast extension")]
OpenGLSLIMulticast = 0x2092D3BE,
/// <summary>
/// Threaded optimization
/// </summary>
[Description("Threaded optimization")] OpenGLThreadControl = 0x20C1221E,
/// <summary>
/// Event Log Tmon Severity Threshold
/// </summary>
[Description("Event Log Tmon Severity Threshold")]
OpenGLTMONLevel = 0x202888C1,
/// <summary>
/// Triple buffering
/// </summary>
[Description("Triple buffering")] OpenGLTripleBuffer = 0x20FDD1F9,
/// <summary>
/// Antialiasing - Behavior Flags
/// </summary>
[Description("Antialiasing - Behavior Flags")]
AntiAliasingBehaviorFlags = 0x10ECDB82,
/// <summary>
/// Antialiasing - Transparency Multisampling
/// </summary>
[Description("Antialiasing - Transparency Multisampling")]
AntiAliasingModeAlphaToCoverage = 0x10FC2D9C,
/// <summary>
/// Antialiasing - Gamma correction
/// </summary>
[Description("Antialiasing - Gamma correction")]
AntiAliasingModeGammaCorrection = 0x107D639D,
/// <summary>
/// Antialiasing - Setting
/// </summary>
[Description("Antialiasing - Setting")]
AntiAliasingModeMethod = 0x10D773D2,
/// <summary>
/// Antialiasing - Transparency Supersampling
/// </summary>
[Description("Antialiasing - Transparency Supersampling")]
AntiAliasingModeReplay = 0x10D48A85,
/// <summary>
/// Antialiasing - Mode
/// </summary>
[Description("Antialiasing - Mode")] AntiAliasingModeSelector = 0x107EFC5B,
/// <summary>
/// Antialiasing - SLI AA
/// </summary>
[Description("Antialiasing - SLI AA")] AntiAliasingModeSelectorSLIAntiAliasing = 0x107AFC5B,
/// <summary>
/// Anisotropic filtering setting
/// </summary>
[Description("Anisotropic filtering setting")]
AnisotropicModeLevel = 0x101E61A9,
/// <summary>
/// Anisotropic filtering mode
/// </summary>
[Description("Anisotropic filtering mode")]
AnisotropicModeSelector = 0x10D2BB16,
/// <summary>
/// NVIDIA Predefined Ansel Usage
/// </summary>
[Description("NVIDIA Predefined Ansel Usage")]
AnselAllow = 0x1035DB89,
/// <summary>
/// Enable Ansel
/// </summary>
[Description("Enable Ansel")] AnselEnable = 0x1075D972,
/// <summary>
/// Ansel flags for enabled applications
/// </summary>
[Description("Ansel flags for enabled applications")]
AnselWhiteListed = 0x1085DA8A,
/// <summary>
/// Application Profile Notification Popup Timeout
/// </summary>
[Description("Application Profile Notification Popup Timeout")]
ApplicationProfileNotificationTimeOut = 0x104554B6,
/// <summary>
/// Steam Application ID
/// </summary>
[Description("Steam Application ID")] ApplicationSteamId = 0x107CDDBC,
/// <summary>
/// Battery Boost
/// </summary>
[Description("Battery Boost")] BatteryBoost = 0x10115C89,
/// <summary>
/// Do not display this profile in the Control Panel
/// </summary>
[Description("Do not display this profile in the Control Panel")]
ControlPanelHiddenProfile = 0x106D5CFF,
/// <summary>
/// List of Universal GPU ids
/// </summary>
[Description("List of Universal GPU ids")]
CUDAExcludedGPUs = 0x10354FF8,
/// <summary>
/// Maximum GPU Power
/// </summary>
[Description("Maximum GPU Power")] D3DOpenGLGPUMaximumPower = 0x10D1EF29,
/// <summary>
/// Export Performance Counters
/// </summary>
[Description("Export Performance Counters")]
ExportPerformanceCounters = 0x108F0841,
/// <summary>
/// NVIDIA Predefined FXAA Usage
/// </summary>
[Description("NVIDIA Predefined FXAA Usage")]
FXAAAllow = 0x1034CB89,
/// <summary>
/// Enable FXAA
/// </summary>
[Description("Enable FXAA")] FXAAEnable = 0x1074C972,
/// <summary>
/// Enable FXAA Indicator
/// </summary>
[Description("Enable FXAA Indicator")] FXAAIndicatorEnable = 0x1068FB9C,
/// <summary>
/// SLI indicator
/// </summary>
[Description("SLI indicator")] MCSFRShowSplit = 0x10287051,
/// <summary>
/// NVIDIA Quality upscaling
/// </summary>
[Description("NVIDIA Quality upscaling")]
NvidiaQualityUpScaling = 0x10444444,
/// <summary>
/// Maximum AA samples allowed for a given application
/// </summary>
[Description("Maximum AA samples allowed for a given application")]
OptimusMaximumAntiAliasing = 0x10F9DC83,
/// <summary>
/// Display the PhysX indicator
/// </summary>
[Description("Display the PhysX indicator")]
PhysxIndicator = 0x1094F16F,
/// <summary>
/// Power management mode
/// </summary>
[Description("Power management mode")] PreferredPerformanceState = 0x1057EB71,
/// <summary>
/// No override of Anisotropic filtering
/// </summary>
[Description("No override of Anisotropic filtering")]
PreventUiAnisotropicOverride = 0x103BCCB5,
/// <summary>
/// Frame Rate Limiter
/// </summary>
[Description("Frame Rate Limiter")] PerformanceStateFrameRateLimiter = 0x10834FEE,
/// <summary>
/// Frame Rate Limiter 2 Control
/// </summary>
[Description("Frame Rate Limiter 2 Control")]
PerformanceStateFrameRateLimiter2Control = 0x10834FFF,
/// <summary>
/// Frame Rate Monitor
/// </summary>
[Description("Frame Rate Monitor")] PerformanceStateFrameRateLimiterGpsControl = 0x10834F01,
/// <summary>
/// Frame Rate Monitor Control
/// </summary>
[Description("Frame Rate Monitor Control")]
PerformanceStateFrameRateMonitorControl = 0x10834F05,
/// <summary>
/// Maximum resolution allowed for a given application
/// </summary>
[Description("Maximum resolution allowed for a given application")]
ShimMaxResolution = 0x10F9DC82,
/// <summary>
/// Optimus flags for enabled applications
/// </summary>
[Description("Optimus flags for enabled applications")]
ShimMCCOMPAT = 0x10F9DC80,
/// <summary>
/// Enable application for Optimus
/// </summary>
[Description("Enable application for Optimus")]
ShimRenderingMode = 0x10F9DC81,
/// <summary>
/// Shim Rendering Mode Options per application for Optimus
/// </summary>
[Description("Shim Rendering Mode Options per application for Optimus")]
ShimRenderingOptions = 0x10F9DC84,
/// <summary>
/// Number of GPUs to use on SLI rendering mode
/// </summary>
[Description("Number of GPUs to use on SLI rendering mode")]
SLIGPUCount = 0x1033DCD1,
/// <summary>
/// NVIDIA predefined number of GPUs to use on SLI rendering mode
/// </summary>
[Description("NVIDIA predefined number of GPUs to use on SLI rendering mode")]
SLIPredefinedGPUCount = 0x1033DCD2,
/// <summary>
/// NVIDIA predefined number of GPUs to use on SLI rendering mode on DirectX 10
/// </summary>
[Description("NVIDIA predefined number of GPUs to use on SLI rendering mode on DirectX 10")]
SLIPredefinedGPUCountDX10 = 0x1033DCD3,
/// <summary>
/// NVIDIA predefined SLI mode
/// </summary>
[Description("NVIDIA predefined SLI mode")]
SLIPredefinedMode = 0x1033CEC1,
/// <summary>
/// NVIDIA predefined SLI mode on DirectX 10
/// </summary>
[Description("NVIDIA predefined SLI mode on DirectX 10")]
SLIPredefinedModeDX10 = 0x1033CEC2,
/// <summary>
/// SLI rendering mode
/// </summary>
[Description("SLI rendering mode")] SLIRenderingMode = 0x1033CED1,
/// <summary>
/// Virtual Reality pre-rendered frames
/// </summary>
[Description("Virtual Reality pre-rendered frames")]
VRPreRenderLimit = 0x10111133,
/// <summary>
/// Toggle the VRR global feature
/// </summary>
[Description("Toggle the VRR global feature")]
VRRFeatureIndicator = 0x1094F157,
/// <summary>
/// Display the VRR Overlay Indicator
/// </summary>
[Description("Display the VRR Overlay Indicator")]
VRROverlayIndicator = 0x1095F16F,
/// <summary>
/// VRR requested state
/// </summary>
[Description("VRR requested state")] VRRRequestState = 0x1094F1F7,
/// <summary>
/// G-SYNC
/// </summary>
[Description("G-SYNC")] VRRApplicationOverride = 0x10A879CF,
/// <summary>
/// G-SYNC
/// </summary>
[Description("G-SYNC")] VRRApplicationOverrideRequestState = 0x10A879AC,
/// <summary>
/// Enable G-SYNC globally
/// </summary>
[Description("Enable G-SYNC globally")]
VRRMode = 0x1194F158,
/// <summary>
/// Flag to control smooth AFR behavior
/// </summary>
[Description("Flag to control smooth AFR behavior")]
VSyncSmoothAFR = 0x101AE763,
/// <summary>
/// Variable refresh Rate
/// </summary>
[Description("Variable refresh Rate")] VSyncVRRControl = 0x10A879CE,
/// <summary>
/// Vsync - Behavior Flags
/// </summary>
[Description("Vsync - Behavior Flags")]
VSyncBehaviorFlags = 0x10FDEC23,
/// <summary>
/// Stereo - Swap eyes
/// </summary>
[Description("Stereo - Swap eyes")] WKSAPIStereoEyesExchange = 0x11AE435C,
/// <summary>
/// Stereo - Display mode
/// </summary>
[Description("Stereo - Display mode")] WKSAPIStereoMode = 0x11E91A61,
/// <summary>
/// Memory Allocation Policy
/// </summary>
[Description("Memory Allocation Policy")]
WKSMemoryAllocationPolicy = 0x11112233,
/// <summary>
/// Stereo - Dongle Support
/// </summary>
[Description("Stereo - Dongle Support")]
WKSStereoDongleSupport = 0x112493BD,
/// <summary>
/// Stereo - Enable
/// </summary>
[Description("Stereo - Enable")] WKSStereoSupport = 0x11AA9E99,
/// <summary>
/// Stereo <20> swap mode
/// </summary>
[Description("Stereo <20> swap mode")] WKSStereoSwapMode = 0x11333333,
/// <summary>
/// Ambient Occlusion
/// </summary>
[Description("Ambient Occlusion")] AmbientOcclusionMode = 0x667329,
/// <summary>
/// NVIDIA Predefined Ambient Occlusion Usage
/// </summary>
[Description("NVIDIA Predefined Ambient Occlusion Usage")]
AmbientOcclusionModeActive = 0x664339,
/// <summary>
/// Texture filtering - Driver Controlled LOD Bias
/// </summary>
[Description("Texture filtering - Driver Controlled LOD Bias")]
AutoLODBiasAdjust = 0x638E8F,
/// <summary>
/// Export Performance Counters for DX9 only
/// </summary>
[Description("Export Performance Counters for DX9 only")]
ExportPerformanceCountersDX9Only = 0xB65E72,
/// <summary>
/// ICafe Settings
/// </summary>
[Description("ICafe Settings")] ICafeLogoConfig = 0xDB1337,
/// <summary>
/// Texture filtering - LOD Bias
/// </summary>
[Description("Texture filtering - LOD Bias")]
LODBiasAdjust = 0x738E8F,
/// <summary>
/// Enable sample interleaving (MFAA)
/// </summary>
[Description("Enable sample interleaving (MFAA)")]
MaxwellBSampleInterleave = 0x98C1AC,
/// <summary>
/// Maximum pre-rendered frames
/// </summary>
[Description("Maximum pre-rendered frames")]
PreRenderLimit = 0x7BA09E,
/// <summary>
/// Shader Cache
/// </summary>
[Description("Shader Cache")] PerformanceStateShaderDiskCache = 0x198FFF,
/// <summary>
/// Texture filtering - Anisotropic sample optimization
/// </summary>
[Description("Texture filtering - Anisotropic sample optimization")]
PerformanceStateTextureFilteringAnisotropicOptimization = 0xE73211,
/// <summary>
/// Texture filtering - Anisotropic filter optimization
/// </summary>
[Description("Texture filtering - Anisotropic filter optimization")]
PerformanceStateTextureFilteringBiLinearInAnisotropic = 0x84CD70,
/// <summary>
/// Texture filtering - Trilinear optimization
/// </summary>
[Description("Texture filtering - Trilinear optimization")]
PerformanceStateTextureFilteringDisableTrilinearSlope = 0x2ECAF2,
/// <summary>
/// Texture filtering - Negative LOD bias
/// </summary>
[Description("Texture filtering - Negative LOD bias")]
PerformanceStateTextureFilteringNoNegativeLODBias = 0x19BB68,
/// <summary>
/// Texture filtering - Quality
/// </summary>
[Description("Texture filtering - Quality")]
QualityEnhancements = 0xCE2691,
/// <summary>
/// Preferred refresh rate
/// </summary>
[Description("Preferred refresh rate")]
RefreshRateOverride = 0x64B541,
/// <summary>
/// PowerThrottle
/// </summary>
[Description("PowerThrottle")] SetPowerThrottleForPCIeCompliance = 0xAE785C,
/// <summary>
/// VAB Default Data
/// </summary>
[Description("VAB Default Data")] SetVABData = 0xAB8687,
/// <summary>
/// Vertical Sync
/// </summary>
[Description("Vertical Sync")] VSyncMode = 0xA879CF,
/// <summary>
/// Vertical Sync Tear Control
/// </summary>
[Description("Vertical Sync Tear Control")]
VSyncTearControl = 0x5A375C,
InvalidSetting = 0xFFFFFFFF
}
#pragma warning restore 1591
}

View File

@@ -1,424 +0,0 @@
using System;
using NvAPIWrapper.Native;
using NvAPIWrapper.Native.DRS.Structures;
using NvAPIWrapper.Native.Exceptions;
using NvAPIWrapper.Native.Interfaces.DRS;
namespace NvAPIWrapper.DRS
{
/// <summary>
/// Represents an application rule registered in a profile
/// </summary>
public class ProfileApplication
{
private IDRSApplication _application;
internal ProfileApplication(IDRSApplication application, DriverSettingsProfile profile)
{
Profile = profile;
_application = application;
}
/// <summary>
/// Gets the application name
/// </summary>
public string ApplicationName
{
get
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid application instance."
);
}
return _application.ApplicationName;
}
}
/// <summary>
/// Gets the application command line
/// </summary>
public string CommandLine
{
get
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid application instance."
);
}
if (_application is DRSApplicationV4 applicationV4)
{
return applicationV4.ApplicationCommandLine;
}
return null;
}
}
/// <summary>
/// Gets a list of files that are necessary to be present inside the application parent directory
/// </summary>
public string[] FilesInFolder
{
get
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid application instance."
);
}
if (_application is DRSApplicationV2 applicationV2)
{
return applicationV2.FilesInFolder;
}
if (_application is DRSApplicationV3 applicationV3)
{
return applicationV3.FilesInFolder;
}
if (_application is DRSApplicationV4 applicationV4)
{
return applicationV4.FilesInFolder;
}
return null;
}
}
/// <summary>
/// Gets the application friendly name
/// </summary>
public string FriendlyName
{
get
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid application instance."
);
}
return _application.FriendlyName;
}
}
/// <summary>
/// Gets a boolean value indicating if this application rule needs a specific command line; or <see langword="null" />
/// if this information is not available.
/// </summary>
public bool? HasCommandLine
{
get
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid application instance."
);
}
if (_application is DRSApplicationV3 applicationV3)
{
return applicationV3.HasCommandLine;
}
if (_application is DRSApplicationV4 applicationV4)
{
return applicationV4.HasCommandLine;
}
return null;
}
}
/// <summary>
/// Gets a boolean value indicating if this application is a metro application; or <see langword="null" /> if this
/// information is not available.
/// </summary>
public bool? IsMetroApplication
{
get
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid application instance."
);
}
if (_application is DRSApplicationV3 applicationV3)
{
return applicationV3.IsMetroApplication;
}
if (_application is DRSApplicationV4 applicationV4)
{
return applicationV4.IsMetroApplication;
}
return null;
}
}
/// <summary>
/// Gets a boolean value indicating if this application is predefined by the NVIDIA driver
/// </summary>
public bool IsPredefined
{
get
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid application instance."
);
}
return _application.IsPredefined;
}
}
/// <summary>
/// Gets a boolean value indicating if this instance of <see cref="ProfileApplication" /> is a valid instance
/// representing an application in a profile
/// </summary>
public bool IsValid
{
get => _application != null && Profile.IsValid;
}
/// <summary>
/// Gets the application launcher name
/// </summary>
public string LauncherName
{
get
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid application instance."
);
}
return _application.LauncherName;
}
}
/// <summary>
/// Gets the parent profile instance
/// </summary>
public DriverSettingsProfile Profile { get; }
/// <summary>
/// Creates a new application
/// </summary>
/// <param name="profile">The profile to create the new application in.</param>
/// <param name="applicationName">The application name (with extension).</param>
/// <param name="friendlyName">The application friendly name.</param>
/// <param name="launcherName">The application launcher name.</param>
/// <param name="fileInFolders">An array of files necessary to be present inside the application parent directory.</param>
/// <param name="isMetro">A boolean value indicating if this application is a metro application.</param>
/// <param name="commandLine">The application command line string.</param>
/// <returns>A new instance of <see cref="ProfileApplication" /> representing the newly created application.</returns>
// ReSharper disable once TooManyArguments
// ReSharper disable once FunctionComplexityOverflow
public static ProfileApplication CreateApplication(
DriverSettingsProfile profile,
string applicationName,
string friendlyName = null,
string launcherName = null,
string[] fileInFolders = null,
bool isMetro = false,
string commandLine = null
)
{
var createDelegates = new Func<string, string, string, string[], bool, string, IDRSApplication>[]
{
CreateApplicationInstanceV4,
CreateApplicationInstanceV3,
CreateApplicationInstanceV2,
CreateApplicationInstanceV1
};
Exception lastException = null;
IDRSApplication application = null;
foreach (var func in createDelegates)
{
try
{
// ReSharper disable once EventExceptionNotDocumented
application = func(
applicationName,
friendlyName,
launcherName,
fileInFolders,
isMetro,
commandLine
);
break;
}
catch (NVIDIANotSupportedException e)
{
// ignore
lastException = e;
}
}
if (application == null)
{
// ReSharper disable once ThrowingSystemException
throw lastException;
}
application = DRSApi.CreateApplication(profile.Session.Handle, profile.Handle, application);
return new ProfileApplication(application, profile);
}
// ReSharper disable once TooManyArguments
private static IDRSApplication CreateApplicationInstanceV1(
string applicationName,
string friendlyName = null,
string launcherName = null,
string[] fileInFolders = null,
bool isMetro = false,
string commandLine = null
)
{
if (!string.IsNullOrWhiteSpace(commandLine))
{
throw new NotSupportedException(
"CommandLine is not supported with the current execution environment."
);
}
if (fileInFolders?.Length > 0)
{
throw new NotSupportedException(
"Same folder file presence check is not supported with the current execution environment."
);
}
return new DRSApplicationV1(
applicationName,
friendlyName,
launcherName
);
}
// ReSharper disable once TooManyArguments
private static IDRSApplication CreateApplicationInstanceV2(
string applicationName,
string friendlyName = null,
string launcherName = null,
string[] fileInFolders = null,
bool isMetro = false,
string commandLine = null
)
{
if (!string.IsNullOrWhiteSpace(commandLine))
{
throw new NotSupportedException(
"CommandLine is not supported with the current execution environment."
);
}
return new DRSApplicationV2(
applicationName,
friendlyName,
launcherName,
fileInFolders
);
}
// ReSharper disable once TooManyArguments
private static IDRSApplication CreateApplicationInstanceV3(
string applicationName,
string friendlyName = null,
string launcherName = null,
string[] fileInFolders = null,
bool isMetro = false,
string commandLine = null
)
{
if (!string.IsNullOrWhiteSpace(commandLine))
{
throw new NotSupportedException(
"CommandLine is not supported with the current execution environment."
);
}
return new DRSApplicationV3(
applicationName,
friendlyName,
launcherName,
fileInFolders,
isMetro
);
}
// ReSharper disable once TooManyArguments
private static IDRSApplication CreateApplicationInstanceV4(
string applicationName,
string friendlyName = null,
string launcherName = null,
string[] fileInFolders = null,
bool isMetro = false,
string commandLine = null
)
{
return new DRSApplicationV4(
applicationName,
friendlyName,
launcherName,
fileInFolders,
isMetro,
commandLine
);
}
/// <inheritdoc />
public override string ToString()
{
if (!IsValid)
{
return "[Invalid]";
}
if (IsPredefined)
{
return $"{ApplicationName} (Predefined)";
}
return ApplicationName;
}
/// <summary>
/// Deletes this application and makes this instance invalid
/// </summary>
public void Delete()
{
if (!IsValid)
{
throw new InvalidOperationException(
"Can not perform this operation with an invalid application instance."
);
}
DRSApi.DeleteApplication(Profile.Session.Handle, Profile.Handle, _application);
_application = null;
}
}
}

View File

@@ -1,126 +0,0 @@
using System;
using NvAPIWrapper.Native.DRS;
using NvAPIWrapper.Native.DRS.Structures;
namespace NvAPIWrapper.DRS
{
/// <summary>
/// Represents a profile setting and its value
/// </summary>
public class ProfileSetting
{
private readonly DRSSettingV1 _setting;
internal ProfileSetting(DRSSettingV1 setting)
{
_setting = setting;
}
/// <summary>
/// Gets the current value of the setting
/// </summary>
public object CurrentValue
{
get
{
if (IsPredefinedValueValid && IsCurrentValuePredefined)
{
return _setting.PredefinedValue;
}
return _setting.CurrentValue;
}
}
/// <summary>
/// Gets a boolean value indicating if the current value is the predefined value.
/// </summary>
public bool IsCurrentValuePredefined
{
get => _setting.IsCurrentValuePredefined;
}
/// <summary>
/// Gets a boolean value indicating if this setting had a predefined valid value.
/// </summary>
public bool IsPredefinedValueValid
{
get => _setting.IsPredefinedValueValid;
}
/// <summary>
/// Gets the predefined value of this setting.
/// </summary>
public object PredefinedValue
{
get
{
if (!IsPredefinedValueValid)
{
throw new InvalidOperationException("Predefined value is not valid.");
}
return _setting.PredefinedValue;
}
}
/// <summary>
/// Gets the setting identification number
/// </summary>
public uint SettingId
{
get => _setting.Id;
}
/// <summary>
/// Gets additional information regarding this setting including possible valid values
/// </summary>
public SettingInfo SettingInfo
{
get => SettingInfo.FromId(SettingId);
}
/// <summary>
/// Gets the profile location of this setting
/// </summary>
public DRSSettingLocation SettingLocation
{
get => _setting.SettingLocation;
}
/// <summary>
/// Gets the value type of this setting
/// </summary>
public DRSSettingType SettingType
{
get => _setting.SettingType;
}
/// <inheritdoc />
public override string ToString()
{
string settingName = null;
try
{
settingName = SettingInfo.Name;
}
catch
{
// ignore;
}
if (string.IsNullOrWhiteSpace(settingName))
{
settingName = $"#{SettingId:X}";
}
if (IsCurrentValuePredefined)
{
return $"{settingName} = {CurrentValue ?? "[NULL]"} (Predefined)";
}
return $"{settingName} = {CurrentValue ?? "[NULL]"}";
}
}
}

View File

@@ -1,360 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using NvAPIWrapper.Native;
using NvAPIWrapper.Native.DRS;
namespace NvAPIWrapper.DRS
{
/// <summary>
/// Contains information about a setting
/// </summary>
public class SettingInfo
{
private static uint[] _availableSettingIds;
private SettingInfo(uint settingId)
{
SettingId = settingId;
}
/// <summary>
/// Gets an array of available possible valid values.
/// </summary>
public object[] AvailableValues
{
get
{
if (!IsAvailable)
{
return null;
}
return DRSApi.EnumAvailableSettingValues(SettingId).Values;
}
}
/// <summary>
/// Gets the default value of this setting
/// </summary>
public object DefaultValue
{
get
{
if (!IsAvailable)
{
return null;
}
var values = DRSApi.EnumAvailableSettingValues(SettingId);
return values.DefaultValue;
}
}
/// <summary>
/// Gets a boolean value indicating if this setting is available on this machine and with the current version of NVIDIA
/// driver
/// </summary>
public bool IsAvailable
{
get => GetAvailableSetting().Any(info => info.SettingId == SettingId);
}
/// <summary>
/// Gets a boolean value indicating if this setting is know by this library
/// </summary>
public bool IsKnown
{
get => IsSettingKnown(SettingId);
}
/// <summary>
/// Gets the description of this setting from the library or <see langword="null" /> if this setting is not known by
/// the library.
/// </summary>
public string KnownDescription
{
get
{
if (!IsKnown || KnownSettingId == null)
{
return null;
}
return GetSettingDescription(KnownSettingId.Value);
}
}
/// <summary>
/// Gets the known identification number of this setting from the library or <see langword="null" /> if this setting is
/// not known by the library.
/// </summary>
public KnownSettingId? KnownSettingId
{
get
{
if (!IsKnown)
{
return null;
}
return GetKnownSettingId(SettingId);
}
}
/// <summary>
/// Gets the type of a static class or an enum containing possible known values for this setting from the library or
/// <see langword="null" /> if this setting is not known by the library
/// </summary>
public Type KnownValueType
{
get
{
if (!IsKnown || !IsAvailable)
{
return null;
}
var name = KnownSettingId.ToString();
var nameSpace = typeof(SettingInfo).Namespace + ".SettingValues";
if (SettingType == DRSSettingType.Integer)
{
return Assembly.GetExecutingAssembly().GetTypes().FirstOrDefault(type =>
type.IsEnum &&
type.Namespace?.Equals(nameSpace, StringComparison.InvariantCultureIgnoreCase) == true &&
type.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase));
}
if (SettingType == DRSSettingType.String || SettingType == DRSSettingType.UnicodeString)
{
return Assembly.GetExecutingAssembly().GetTypes().FirstOrDefault(type =>
type.IsClass &&
type.Namespace?.Equals(nameSpace, StringComparison.InvariantCultureIgnoreCase) == true &&
type.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase));
}
return null;
}
}
/// <summary>
/// Gets the name of the setting from NVIDIA driver or <see langword="null" /> if the setting is not available on this
/// machine.
/// </summary>
public string Name
{
get
{
if (!IsAvailable)
{
return null;
}
return DRSApi.GetSettingNameFromId(SettingId);
}
}
/// <summary>
/// Gets the setting identification number
/// </summary>
public uint SettingId { get; }
/// <summary>
/// Gets the value type of the setting from NVIDIA driver or <see langword="null" /> if the setting is not available on
/// this machine.
/// </summary>
public DRSSettingType? SettingType
{
get
{
if (!IsAvailable)
{
return null;
}
var values = DRSApi.EnumAvailableSettingValues(SettingId);
return values.SettingType;
}
}
/// <summary>
/// Gets information regarding a setting from its identification number.
/// </summary>
/// <param name="settingId">The identification number of the setting to get information about.</param>
/// <returns>An instance of <see cref="SettingInfo" /> containing information about the setting.</returns>
public static SettingInfo FromId(uint settingId)
{
return new SettingInfo(settingId);
}
/// <summary>
/// Gets information regarding a setting from its known identification number.
/// </summary>
/// <param name="settingId">The known identification number of the setting to get information about.</param>
/// <returns>An instance of <see cref="SettingInfo" /> containing information about the setting.</returns>
public static SettingInfo FromKnownSettingId(KnownSettingId settingId)
{
return FromId(GetSettingId(settingId));
}
/// <summary>
/// Gets information regarding a setting from its name.
/// </summary>
/// <param name="settingName">The name of the setting to get information about.</param>
/// <returns>An instance of <see cref="SettingInfo" /> containing information about the setting.</returns>
public static SettingInfo FromName(string settingName)
{
var settingId = DRSApi.GetSettingIdFromName(settingName);
return FromId(settingId);
}
/// <summary>
/// Gets a list of all available setting on this machine
/// </summary>
/// <returns>Instances of <see cref="SettingInfo" /> each representing a available setting on this machine.</returns>
public static SettingInfo[] GetAvailableSetting()
{
if (_availableSettingIds == null)
{
_availableSettingIds = DRSApi.EnumAvailableSettingIds();
}
return _availableSettingIds.Select(FromId).ToArray();
}
/// <summary>
/// Gets the known identification number of a setting from its identification number
/// </summary>
/// <param name="settingId">The setting identification number.</param>
/// <returns>The known setting identification number if the setting is known; otherwise <see langword="null" />.</returns>
public static KnownSettingId? GetKnownSettingId(uint settingId)
{
if (!IsSettingKnown(settingId))
{
return null;
}
return (KnownSettingId) settingId;
}
/// <summary>
/// Gets the known setting description from its identification number
/// </summary>
/// <param name="knownSettingId">The known setting identification number.</param>
/// <returns>The known setting description if available; otherwise <see langword="null" />.</returns>
public static string GetSettingDescription(KnownSettingId knownSettingId)
{
var enumName = Enum.GetName(typeof(KnownSettingId), knownSettingId);
if (enumName == null)
{
return null;
}
var enumField = typeof(KnownSettingId).GetField(enumName);
if (enumField == null)
{
return null;
}
var descriptionAttribute = enumField
.GetCustomAttributes(typeof(DescriptionAttribute), false)
.OfType<DescriptionAttribute>()
.FirstOrDefault();
if (string.IsNullOrWhiteSpace(descriptionAttribute?.Description))
{
return null;
}
return descriptionAttribute.Description;
}
/// <summary>
/// Gets the identification number of a setting from its known identification number
/// </summary>
/// <param name="knownSettingId">The known setting identification number.</param>
/// <returns>The setting identification number.</returns>
public static uint GetSettingId(KnownSettingId knownSettingId)
{
return (uint) knownSettingId;
}
/// <summary>
/// Checks if a setting is known by this library.
/// </summary>
/// <param name="settingId">The setting identification number.</param>
/// <returns>true if setting is known by this library; otherwise false.</returns>
public static bool IsSettingKnown(uint settingId)
{
return Enum.IsDefined(typeof(KnownSettingId), settingId);
}
/// <inheritdoc />
public override string ToString()
{
try
{
var settingName = Name;
if (!string.IsNullOrWhiteSpace(settingName))
{
return settingName;
}
}
catch
{
// ignore;
}
return $"#{SettingId:X}";
}
/// <summary>
/// Tries to resolve the name of a known value using its actual value
/// </summary>
/// <param name="value">The actual value</param>
/// <returns>The name of the known value member.</returns>
public string ResolveKnownValueName(object value)
{
if (!IsKnown)
{
return null;
}
var valueType = KnownValueType;
if (valueType == null)
{
return null;
}
if (valueType.IsEnum)
{
return Enum.GetName(valueType, value);
}
var comparerType = typeof(EqualityComparer<>).MakeGenericType(value.GetType());
var comparer = comparerType.GetProperty(nameof(EqualityComparer<object>.Default))?.GetValue(null);
if (!(comparer is IEqualityComparer equalityComparer))
{
return null;
}
return valueType.GetFields()
.FirstOrDefault(info =>
info.IsStatic &&
equalityComparer.Equals(info.GetValue(null), value)
)?.Name;
}
}
}

View File

@@ -1,17 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum AmbientOcclusionMode : uint
{
Off = 0x0,
Low = 0x1,
Medium = 0x2,
High = 0x3,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum AmbientOcclusionModeActive : uint
{
Disabled = 0x0,
Enabled = 0x1,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,17 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum AnisotropicModeLevel : uint
{
Mask = 0xFFFF,
NonePoint = 0x0,
NoneLinear = 0x1,
Maximum = 0x10,
Default = 0x1
}
#pragma warning restore 1591
}

View File

@@ -1,19 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum AnisotropicModeSelector : uint
{
Mask = 0xF,
Application = 0x0,
User = 0x1,
Condition = 0x2,
Maximum = 0x2,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum AnselAllow : uint
{
Disallowed = 0x0,
Allowed = 0x1,
Default = 0x1
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum AnselEnable : uint
{
Off = 0x0,
On = 0x1,
Default = 0x1
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum AnselWhiteListed : uint
{
Disallowed = 0x0,
Allowed = 0x1,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,43 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum AntiAliasingBehaviorFlags : uint
{
None = 0x0,
TreatOverrideAsApplicationControlled = 0x1,
TreatOverrideAsEnhance = 0x2,
DisableOverride = 0x3,
TreatEnhanceAsApplicationControlled = 0x4,
TreatEnhanceAsOverride = 0x8,
DisableEnhance = 0xC,
MapVCAAToMultiSampling = 0x10000,
SLIDisableTransparencySupersampling = 0x20000,
DisableCplaa = 0x40000,
SkipRTDIMCheckForEnhance = 0x80000,
DisableSLIAntiAliasing = 0x100000,
Default = 0x0,
AntiAliasingRTBPPDIV4 = 0xF0000000,
AntiAliasingRTBPPDIV4Shift = 0x1C,
NonAntiAliasingRTBPPDIV4 = 0xF000000,
NonAntiAliasingRTBPPDIV4Shift = 0x18,
Mask = 0xFF1F000F
}
#pragma warning restore 1591
}

View File

@@ -1,17 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum AntiAliasingModeAlphaToCoverage : uint
{
ModeMask = 0x4,
ModeOff = 0x0,
ModeOn = 0x4,
ModeMaximum = 0x4,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,23 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum AntiAliasingModeGammaCorrection : uint
{
Mask = 0x3,
Off = 0x0,
OnIfFOS = 0x1,
OnAlways = 0x2,
Maximum = 0x2,
Default = 0x0,
DefaultTesla = 0x2,
DefaultFermi = 0x2
}
#pragma warning restore 1591
}

View File

@@ -1,109 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum AntiAliasingModeMethod : uint
{
None = 0x0,
SuperSample2XHorizontal = 0x1,
SuperSample2XVertical = 0x2,
SuperSample15X15 = 0x2,
Free0X03 = 0x3,
Free0X04 = 0x4,
SuperSample4X = 0x5,
SuperSample4XBias = 0x6,
SuperSample4XGaussian = 0x7,
Free0X08 = 0x8,
Free0X09 = 0x9,
SuperSample9X = 0xA,
SuperSample9XBias = 0xB,
SuperSample16X = 0xC,
SuperSample16XBias = 0xD,
MultiSample2XDiagonal = 0xE,
MultiSample2XQuincunx = 0xF,
MultiSample4X = 0x10,
Free0X11 = 0x11,
MultiSample4XGaussian = 0x12,
MixedSample4XSkewed4Tap = 0x13,
Free0X14 = 0x14,
Free0X15 = 0x15,
MixedSample6X = 0x16,
MixedSample6XSkewed6Tap = 0x17,
MixedSample8X = 0x18,
MixedSample8XSkewed8Tap = 0x19,
MixedSample16X = 0x1A,
MultiSample4XGamma = 0x1B,
MultiSample16X = 0x1C,
VCAA32X8V24 = 0x1D,
CorruptionCheck = 0x1E,
_6XCT = 0x1F,
MultiSample2XDiagonalGamma = 0x20,
SuperSample4XGamma = 0x21,
MultiSample4XFosgamma = 0x22,
MultiSample2XDiagonalFosgamma = 0x23,
SuperSample4XFosgamma = 0x24,
MultiSample8X = 0x25,
VCAA8X4V4 = 0x26,
VCAA16X4V12 = 0x27,
VCAA16X8V8 = 0x28,
MixedSample32X = 0x29,
SuperVCAA64X4V12 = 0x2A,
SuperVCAA64X8V8 = 0x2B,
MixedSample64X = 0x2C,
MixedSample128X = 0x2D,
Count = 0x2E,
MethodMask = 0xFFFF,
MethodMaximum = 0xF1C57815,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,49 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum AntiAliasingModeReplay : uint
{
SamplesMask = 0x70,
SamplesOne = 0x0,
SamplesTwo = 0x10,
SamplesFour = 0x20,
SamplesEight = 0x30,
SamplesMaximum = 0x30,
ModeMask = 0xF,
ModeOff = 0x0,
ModeAlphaTest = 0x1,
ModePixelKill = 0x2,
ModeDynamicBranch = 0x4,
ModeOptimal = 0x4,
ModeAll = 0x8,
ModeMaximum = 0xF,
Transparency = 0x23,
DisAllowTraa = 0x100,
TransparencyDefault = 0x0,
TransparencyDefaultTesla = 0x0,
TransparencyDefaultFermi = 0x0,
Mask = 0x17F,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,19 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum AntiAliasingModeSelector : uint
{
Mask = 0x3,
ApplicationControl = 0x0,
Override = 0x1,
Enhance = 0x2,
Maximum = 0x2,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum AntiAliasingModeSelectorSLIAntiAliasing : uint
{
Disabled = 0x0,
Enabled = 0x1,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,21 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum ApplicationProfileNotificationTimeOut : uint
{
Disabled = 0x0,
NineSeconds = 0x9,
FifteenSeconds = 0xF,
ThirtySeconds = 0x1E,
OneMinute = 0x3C,
TwoMinutes = 0x78,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum AutoLODBiasAdjust : uint
{
Off = 0x0,
On = 0x1,
Default = 0x1
}
#pragma warning restore 1591
}

View File

@@ -1,17 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum BatteryBoost : uint
{
Minimum = 0x1,
Maximum = 0xFF,
Enabled = 0x10000000,
Disabled = 0x0,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,10 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public static class CUDAExcludedGPUs
{
public const string Default = "none";
public const string None = "none";
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum ControlPanelHiddenProfile : uint
{
Disabled = 0x0,
Enabled = 0x1,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,10 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public static class D3DOpenGLGPUMaximumPower
{
public const string Default = "0";
public const string DefaultPower = "0";
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum ExportPerformanceCounters : uint
{
Off = 0x0,
On = 0x1,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum ExportPerformanceCountersDX9Only : uint
{
Off = 0x0,
On = 0x1,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum FXAAAllow : uint
{
Disallowed = 0x0,
Allowed = 0x1,
Default = 0x1
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum FXAAEnable : uint
{
Off = 0x0,
On = 0x1,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum FXAAIndicatorEnable : uint
{
Off = 0x0,
On = 0x1,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum LODBiasAdjust : uint
{
Minimum = 0xFFFFFF80,
Maximum = 0x80,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum MCSFRShowSplit : uint
{
Disabled = 0x34534064,
Enabled = 0x24545582,
Default = 0x34534064
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum MaxwellBSampleInterleave : uint
{
Off = 0x0,
On = 0x1,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum NvidiaQualityUpScaling : uint
{
Off = 0x0,
On = 0x1,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,17 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum OpenGLAntiAliasingLineGamma : uint
{
Disabled = 0x10,
Enabled = 0x23,
Minimum = 0x1,
Maximum = 0x64,
Default = 0x10
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum OpenGLDeepColorScanOut : uint
{
Disable = 0x0,
Enable = 0x1,
Default = 0x1
}
#pragma warning restore 1591
}

View File

@@ -1,27 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum OpenGLDefaultSwapInterval : uint
{
Tear = 0x0,
VSyncOne = 0x1,
VSync = 0x1,
ValueMask = 0xFFFF,
ForceMask = 0xF0000000,
ForceOff = 0xF0000000,
ForceOn = 0x10000000,
ApplicationControlled = 0x0,
Disable = 0xFFFFFFFF,
Default = 0x1
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum OpenGLDefaultSwapIntervalFractional : uint
{
ZeroScanLines = 0x0,
OneFullFrameOfScanLines = 0x64,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum OpenGLDefaultSwapIntervalSign : uint
{
Positive = 0x0,
Negative = 0x1,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,19 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum OpenGLEventLogSeverityThreshold : uint
{
Disable = 0x0,
Critical = 0x1,
Warning = 0x2,
Information = 0x3,
All = 0x4,
Default = 0x4
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum OpenGLForceBlit : uint
{
On = 0x1,
Off = 0x0,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum OpenGLForceStereo : uint
{
Off = 0x0,
On = 0x1,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,12 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public static class OpenGLImplicitGPUAffinity
{
public const string AutoSelect = "autoselect";
public const string Default = "autoselect";
public const string EnvironmentVariable = "OGL_DEFAULT_RENDERING_GPU";
}
#pragma warning restore 1591
}

View File

@@ -1,17 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum OpenGLOverlayPixelType : uint
{
None = 0x0,
CI = 0x1,
RGBA = 0x2,
CIAndRGBA = 0x3,
Default = 0x1
}
#pragma warning restore 1591
}

View File

@@ -1,15 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum OpenGLOverlaySupport : uint
{
Off = 0x0,
On = 0x1,
ForceSoftware = 0x2,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,17 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum OpenGLQualityEnhancements : uint
{
HighQuality = 0xFFFFFFF6,
Quality = 0x0,
Performance = 0xA,
HighPerformance = 0x14,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,17 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum OpenGLSLIMulticast : uint
{
Disable = 0x0,
Enable = 0x1,
ForceDisable = 0x2,
AllowMosaic = 0x4,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,15 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum OpenGLSingleBackDepthBuffer : uint
{
Disable = 0x0,
Enable = 0x1,
UseHardwareDefault = 0xFFFFFFFF,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,21 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum OpenGLTMONLevel : uint
{
Disable = 0x0,
Critical = 0x1,
Warning = 0x2,
Information = 0x3,
Most = 0x4,
Verbose = 0x5,
Default = 0x4
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum OpenGLThreadControl : uint
{
Enable = 0x1,
Disable = 0x2,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum OpenGLTripleBuffer : uint
{
Disabled = 0x0,
Enabled = 0x1,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum OptimusMaximumAntiAliasing : uint
{
Minimum = 0x0,
Maximum = 0x10,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,47 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum PerformanceStateFrameRateLimiter : uint
{
Disabled = 0x0,
FPS20 = 0x14,
FPS30 = 0x1E,
FPS40 = 0x28,
Fpsmask = 0xFF,
NoAlign = 0x4000,
BBQM = 0x8000,
LowerFPSToAlign = 0x20000,
ForceVSyncOff = 0x40000,
GpsWeb = 0x80000,
Disallowed = 0x200000,
UseCPUWait = 0x400000,
NoLagOffset = 0x800000,
Accurate = 0x10000000,
AllowWindowed = 0x20000000,
ForceOn = 0x40000000,
Enabled = 0x80000000,
OpenGLRemoteDesktop = 0xE000003C,
Mask = 0xF0EEC0FF,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,27 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum PerformanceStateFrameRateLimiter2Control : uint
{
DelayCE = 0x0,
Delay3D = 0x1,
AvoidNoop = 0x2,
DelayCEPresent3D = 0x8,
AllowAllMaxwell = 0x10,
AllowAll = 0x20,
ForceOff = 0x40,
EnableVCE = 0x80,
DefaultForGM10X = 0x11,
Default = 0x88
}
#pragma warning restore 1591
}

View File

@@ -1,31 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum PerformanceStateFrameRateLimiterGpsControl : uint
{
Disabled = 0x0,
DecreaseFilterMask = 0x1FF,
PauseTimeMask = 0xFE00,
PauseTimeShift = 0x9,
TargetRenderTimeMask = 0xFF0000,
TargetRenderTimeShift = 0x10,
PerformanceStepSizeMask = 0x1F000000,
PerformanceStepSizeShift = 0x18,
IncreaseFilterMask = 0xE0000000,
IncreaseFilterShift = 0x1D,
OptimalSetting = 0x4A5A3219,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,39 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum PerformanceStateFrameRateMonitorControl : uint
{
Disabled = 0x0,
ThresholdPctMask = 0xFF,
MovingAverageXMask = 0xF00,
MovingAverageXShift = 0x8,
EnableFineGrained = 0x400000,
EnableOnVSync = 0x800000,
VSyncOffsetMask = 0xF000,
VSyncOffsetShift = 0xC,
FPSUseFrl = 0x0,
FPS30 = 0x1E000000,
FPS60 = 0x3C000000,
FPSMask = 0xFF000000,
FPSShift = 0x18,
OptimalSetting = 0x364,
VSyncOptimalSetting = 0x80F364,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum PerformanceStateShaderDiskCache : uint
{
Off = 0x0,
On = 0x1,
Default = 0x1
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum PerformanceStateTextureFilteringAnisotropicOptimization : uint
{
Off = 0x0,
On = 0x1,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum PerformanceStateTextureFilteringBiLinearInAnisotropic : uint
{
Off = 0x0,
On = 0x1,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum PerformanceStateTextureFilteringDisableTrilinearSlope : uint
{
Off = 0x0,
On = 0x1,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum PerformanceStateTextureFilteringNoNegativeLODBias : uint
{
Off = 0x0,
On = 0x1,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum PhysxIndicator : uint
{
Disabled = 0x34534064,
Enabled = 0x24545582,
Default = 0x34534064
}
#pragma warning restore 1591
}

View File

@@ -1,15 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum PreRenderLimit : uint
{
Minimum = 0x0,
Maximum = 0xFF,
ApplicationControlled = 0x0,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,25 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum PreferredPerformanceState : uint
{
Adaptive = 0x0,
PreferMaximum = 0x1,
DriverControlled = 0x2,
PreferConsistentPerformance = 0x3,
PreferMinimum = 0x4,
OptimalPower = 0x5,
Minimum = 0x0,
Maximum = 0x5,
Default = 0x5
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum PreventUiAnisotropicOverride : uint
{
Off = 0x0,
On = 0x1,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,17 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum QualityEnhancements : uint
{
HighQuality = 0xFFFFFFF6,
Quality = 0x0,
Performance = 0xA,
HighPerformance = 0x14,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,15 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum RefreshRateOverride : uint
{
ApplicationControlled = 0x0,
HighestAvailable = 0x1,
LowLatencyRefreshRateMask = 0xFF0,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,19 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum SLIGPUCount : uint
{
AutoSelect = 0x0,
One = 0x1,
Two = 0x2,
Three = 0x3,
Four = 0x4,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,19 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum SLIPredefinedGPUCount : uint
{
AutoSelect = 0x0,
One = 0x1,
Two = 0x2,
Three = 0x3,
Four = 0x4,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,19 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum SLIPredefinedGPUCountDX10 : uint
{
AutoSelect = 0x0,
One = 0x1,
Two = 0x2,
Three = 0x3,
Four = 0x4,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,21 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum SLIPredefinedMode : uint
{
AutoSelect = 0x0,
ForceSingle = 0x1,
ForceAFR = 0x2,
ForceAFR2 = 0x3,
ForceSFR = 0x4,
ForceAFROfSFRFallback3AFR = 0x5,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,21 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum SLIPredefinedModeDX10 : uint
{
AutoSelect = 0x0,
ForceSingle = 0x1,
ForceAFR = 0x2,
ForceAFR2 = 0x3,
ForceSFR = 0x4,
ForceAFROfSFRFallback3AFR = 0x5,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,21 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum SLIRenderingMode : uint
{
AutoSelect = 0x0,
ForceSingle = 0x1,
ForceAFR = 0x2,
ForceAFR2 = 0x3,
ForceSFR = 0x4,
ForceAFROfSFRFallback3AFR = 0x5,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum SetPowerThrottleForPCIeCompliance : uint
{
Off = 0x0,
On = 0x1,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,21 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum SetVABData : uint
{
Zero = 0x0,
UIntOne = 0x1,
FloatOne = 0x3F800000,
FloatPosInf = 0x7F800000,
FloatNan = 0x7FC00000,
UseAPIDefaults = 0xFFFFFFFF,
Default = 0xFFFFFFFF
}
#pragma warning restore 1591
}

View File

@@ -1,25 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum ShimMCCOMPAT : uint
{
Integrated = 0x0,
Enable = 0x1,
UserEditable = 0x2,
Mask = 0x3,
VideoMask = 0x4,
VaryingBit = 0x8,
AutoSelect = 0x10,
OverrideBit = 0x80000000,
Default = 0x10
}
#pragma warning restore 1591
}

View File

@@ -1,25 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum ShimRenderingMode : uint
{
Integrated = 0x0,
Enable = 0x1,
UserEditable = 0x2,
Mask = 0x3,
VideoMask = 0x4,
VaryingBit = 0x8,
AutoSelect = 0x10,
OverrideBit = 0x80000000,
Default = 0x10
}
#pragma warning restore 1591
}

View File

@@ -1,59 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum ShimRenderingOptions : uint
{
DefaultRenderingMode = 0x0,
DisableAsyncPresent = 0x1,
EHShellDetect = 0x2,
FlashplayerHostDetect = 0x4,
VideoDRMApplicationDetect = 0x8,
IgnoreOverrides = 0x10,
Reserved1 = 0x20,
EnableDWMAsyncPresent = 0x40,
Reserved2 = 0x80,
AllowInheritance = 0x100,
DisableWrappers = 0x200,
DisableDxgiWrappers = 0x400,
PruneUnsupportedFormats = 0x800,
EnableAlphaFormat = 0x1000,
IGPUTranscoding = 0x2000,
DisableCUDA = 0x4000,
AllowCpCapabilitiesForVideo = 0x8000,
IGPUTranscodingFwdOptimus = 0x10000,
DisableDuringSecureBoot = 0x20000,
InvertForQuadro = 0x40000,
InvertForMSHybrid = 0x80000,
RegisterProcessEnableGold = 0x100000,
HandleWindowedModePerformanceOptimal = 0x200000,
HandleWin7AsyncRuntimeBug = 0x400000,
ExplicitAdapterOptedByApplication = 0x800000,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,15 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum VRPreRenderLimit : uint
{
Minimum = 0x0,
Maximum = 0xFF,
ApplicationControlled = 0x0,
Default = 0x1
}
#pragma warning restore 1591
}

View File

@@ -1,19 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum VRRApplicationOverride : uint
{
Allow = 0x0,
ForceOff = 0x1,
DisAllow = 0x2,
ULMB = 0x3,
FixedRefresh = 0x4,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,19 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum VRRApplicationOverrideRequestState : uint
{
Allow = 0x0,
ForceOff = 0x1,
DisAllow = 0x2,
ULMB = 0x3,
FixedRefresh = 0x4,
Default = 0x0
}
#pragma warning restore 1591
}

View File

@@ -1,13 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum VRRFeatureIndicator : uint
{
Disabled = 0x0,
Enabled = 0x1,
Default = 0x1
}
#pragma warning restore 1591
}

View File

@@ -1,15 +0,0 @@
namespace NvAPIWrapper.DRS.SettingValues
{
#pragma warning disable 1591
public enum VRRMode : uint
{
Disabled = 0x0,
FullScreenOnly = 0x1,
FullScreenAndWindowed = 0x2,
Default = 0x1
}
#pragma warning restore 1591
}

Some files were not shown because too many files have changed in this diff Show More