mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Compare commits
147 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a1dd9f137 | ||
|
|
325f16cf55 | ||
|
|
42cc1bdb98 | ||
|
|
83a2d1dc9f | ||
|
|
3aae223b15 | ||
|
|
b22d2f8ceb | ||
|
|
2041861a14 | ||
|
|
dfc3c0e515 | ||
|
|
796ec34284 | ||
|
|
50894a59d3 | ||
|
|
1472004d4b | ||
|
|
36c42ed05f | ||
|
|
66220351f1 | ||
|
|
8f2c8842e0 | ||
|
|
1cda822820 | ||
|
|
2afba74dd5 | ||
|
|
e69f9d1014 | ||
|
|
47d96aca61 | ||
|
|
f36fb6ca55 | ||
|
|
e765b4f037 | ||
|
|
f395c706f6 | ||
|
|
444fdcdd97 | ||
|
|
b874900393 | ||
|
|
05aad0f1ad | ||
|
|
a34cc1cb03 | ||
|
|
8c557344db | ||
|
|
5b2a4cb065 | ||
|
|
51bcad8bbe | ||
|
|
125aa44e6c | ||
|
|
9e6ca7c2e2 | ||
|
|
252cc9d868 | ||
|
|
0b03b62a2d | ||
|
|
ff7a5463d6 | ||
|
|
5134aaca9d | ||
|
|
2a5c2e02ac | ||
|
|
80e3971dad | ||
|
|
ac60986646 | ||
|
|
1e0169a71d | ||
|
|
e0346a8af8 | ||
|
|
4ee97fdbc4 | ||
|
|
34075b67d4 | ||
|
|
4ed9675d99 | ||
|
|
af3538e105 | ||
|
|
d818405e04 | ||
|
|
9794229f3f | ||
|
|
9f56959c67 | ||
|
|
09e6676b7c | ||
|
|
6adb2e2fcf | ||
|
|
08cc4409a9 | ||
|
|
1ac0f2be08 | ||
|
|
05e66d3b95 | ||
|
|
0f8f1e9ce5 | ||
|
|
d37b46c588 | ||
|
|
020a7d074f | ||
|
|
7eb7cc9f78 | ||
|
|
38d60e88ea | ||
|
|
0cc16765b6 | ||
|
|
96f705806b | ||
|
|
d1cceda2ab | ||
|
|
381b4dd3e8 | ||
|
|
a99dcbf445 | ||
|
|
4751383a3a | ||
|
|
06320afcb3 | ||
|
|
0eb6209eda | ||
|
|
a342cab9a6 | ||
|
|
12c6482f61 | ||
|
|
20933bfd8d | ||
|
|
c66c8e9030 | ||
|
|
14b677514b | ||
|
|
ce266ffe07 | ||
|
|
f29410fa2a | ||
|
|
7117b58746 | ||
|
|
0456fa013c | ||
|
|
6a4aa4e138 | ||
|
|
d75067b40c | ||
|
|
de45038911 | ||
|
|
e23c727e79 | ||
|
|
2f2c534278 | ||
|
|
bdbec79aba | ||
|
|
e3d0a04fa4 | ||
|
|
4dd7d41cf4 | ||
|
|
8370217cef | ||
|
|
63c1829edd | ||
|
|
69e5a0448e | ||
|
|
b74b9ae257 | ||
|
|
71e007d8ad | ||
|
|
6896166c3c | ||
|
|
fd89d9c13a | ||
|
|
8bec153da8 | ||
|
|
7d968f5f08 | ||
|
|
ac5fc3f96e | ||
|
|
8590d0301a | ||
|
|
8804d19567 | ||
|
|
57ce0631a3 | ||
|
|
b796f9f9d4 | ||
|
|
f39563fcdf | ||
|
|
853d0c231d | ||
|
|
df3324d641 | ||
|
|
75c90ee155 | ||
|
|
4015e0a7f7 | ||
|
|
2a82e41894 | ||
|
|
a5541dfe10 | ||
|
|
fd3a139c47 | ||
|
|
608b8571d4 | ||
|
|
82a39bcfa1 | ||
|
|
f9ccd92dc6 | ||
|
|
1fadc6c31e | ||
|
|
0b7dd42a5d | ||
|
|
51cd700e25 | ||
|
|
7484253007 | ||
|
|
f5cf768017 | ||
|
|
ca57669596 | ||
|
|
35f1a3a25b | ||
|
|
b7afe94b8d | ||
|
|
97c97e8e19 | ||
|
|
ffc5a6f641 | ||
|
|
f87e6c5c88 | ||
|
|
22f136fe9e | ||
|
|
6d85376734 | ||
|
|
62512a7c05 | ||
|
|
7a6301328c | ||
|
|
3c6c4d122d | ||
|
|
0142c25929 | ||
|
|
27bc7339d8 | ||
|
|
2985fe378c | ||
|
|
71daba25a8 | ||
|
|
16feeb05a1 | ||
|
|
c69bf65c84 | ||
|
|
56ea434626 | ||
|
|
432508cfc5 | ||
|
|
deb515066d | ||
|
|
ac19a822f7 | ||
|
|
41caaefc97 | ||
|
|
a4488fa93b | ||
|
|
57c893ef77 | ||
|
|
07020c3561 | ||
|
|
ea134b640b | ||
|
|
5c3f1259f6 | ||
|
|
09fd4e4a13 | ||
|
|
31c48eb998 | ||
|
|
0c1f216853 | ||
|
|
83dc491b64 | ||
|
|
a75d1ad604 | ||
|
|
88f466103e | ||
|
|
efb9b73ff5 | ||
|
|
2c4bdb87aa | ||
|
|
832f13d8e4 |
25
.github/workflows/build.yml
vendored
Normal file
25
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ main ]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: windows-2022
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Setup dotnet
|
||||||
|
uses: actions/setup-dotnet@v3
|
||||||
|
with:
|
||||||
|
dotnet-version: |
|
||||||
|
7.0.x
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
dotnet build app/GHelper.sln
|
||||||
28
.github/workflows/codeql.yml
vendored
Normal file
28
.github/workflows/codeql.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
name: CodeQL
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ main ]
|
||||||
|
schedule:
|
||||||
|
- cron: '34 18 * * 3'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
codeql:
|
||||||
|
runs-on: windows-2022
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v2
|
||||||
|
with:
|
||||||
|
languages: c#
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v2
|
||||||
|
- name: Analyze
|
||||||
|
uses: github/codeql-action/analyze@v2
|
||||||
28
.github/workflows/release.yml
vendored
Normal file
28
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [ published ]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: windows-2022
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Setup dotnet
|
||||||
|
uses: actions/setup-dotnet@v3
|
||||||
|
with:
|
||||||
|
dotnet-version: |
|
||||||
|
7.0.x
|
||||||
|
- name: Publish
|
||||||
|
run: |
|
||||||
|
dotnet publish app/GHelper.sln --configuration Release --runtime win-x64 -p:PublishSingleFile=true --no-self-contained
|
||||||
|
powershell Compress-Archive app/bin/x64/Release/net7.0-windows8.0/win-x64/publish/GHelper.exe GHelper.zip
|
||||||
|
- name: Upload
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
gh release upload ${{ github.ref_name }} app/bin/x64/Release/net7.0-windows8.0/win-x64/publish/GHelper.exe GHelper.zip
|
||||||
312
app/AnimeMatrix/AniMatrix.cs
Normal file
312
app/AnimeMatrix/AniMatrix.cs
Normal file
@@ -0,0 +1,312 @@
|
|||||||
|
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
|
||||||
|
{
|
||||||
|
System.Timers.Timer matrixTimer = default!;
|
||||||
|
AnimeMatrixDevice mat;
|
||||||
|
|
||||||
|
double[] AudioValues;
|
||||||
|
WasapiCapture AudioDevice;
|
||||||
|
|
||||||
|
public bool IsValid => mat != null;
|
||||||
|
|
||||||
|
private long lastPresent;
|
||||||
|
private List<double> maxes = new List<double>();
|
||||||
|
|
||||||
|
public AniMatrix()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
mat = new AnimeMatrixDevice();
|
||||||
|
Task.Run(mat.WakeUp);
|
||||||
|
matrixTimer = new System.Timers.Timer(100);
|
||||||
|
matrixTimer.Elapsed += MatrixTimer_Elapsed;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
mat = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetMatrix()
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!IsValid) return;
|
||||||
|
|
||||||
|
int brightness = AppConfig.getConfig("matrix_brightness");
|
||||||
|
int running = AppConfig.getConfig("matrix_running");
|
||||||
|
|
||||||
|
bool auto = AppConfig.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(AppConfig.getConfigString("matrix_picture"));
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
SetMatrixClock();
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
SetMatrixAudio();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
mat.SetBuiltInAnimation(true, animation);
|
||||||
|
Logger.WriteLine("Matrix builtin " + animation.AsByte);
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//mat.SetBrightness((BrightnessMode)brightness);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
private void StartMatrixTimer(int interval = 100)
|
||||||
|
{
|
||||||
|
matrixTimer.Interval = interval;
|
||||||
|
matrixTimer.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void StopMatrixTimer()
|
||||||
|
{
|
||||||
|
matrixTimer.Stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void MatrixTimer_Elapsed(object? sender, ElapsedEventArgs e)
|
||||||
|
{
|
||||||
|
//if (!IsValid) return;
|
||||||
|
|
||||||
|
switch (AppConfig.getConfig("matrix_running"))
|
||||||
|
{
|
||||||
|
case 2:
|
||||||
|
mat.PresentNextFrame();
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
mat.PresentClock();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void SetMatrixClock()
|
||||||
|
{
|
||||||
|
mat.SetBuiltInAnimation(false);
|
||||||
|
StartMatrixTimer(1000);
|
||||||
|
Logger.WriteLine("Matrix Clock");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
StopMatrixAudio();
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
using Starlight.Communication;
|
using Starlight.Communication;
|
||||||
using System.Drawing.Drawing2D;
|
using System.Drawing.Drawing2D;
|
||||||
|
using System.Drawing.Text;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Management;
|
using System.Management;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -61,7 +62,8 @@ namespace Starlight.AnimeMatrix
|
|||||||
public enum AnimeType
|
public enum AnimeType
|
||||||
{
|
{
|
||||||
GA401,
|
GA401,
|
||||||
GA402
|
GA402,
|
||||||
|
GU604
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -88,12 +90,15 @@ namespace Starlight.AnimeMatrix
|
|||||||
//public int FullEvenRows = -1;
|
//public int FullEvenRows = -1;
|
||||||
|
|
||||||
public int dx = 0;
|
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;
|
public int MaxColumns = 34;
|
||||||
|
|
||||||
private int frameIndex = 0;
|
private int frameIndex = 0;
|
||||||
|
|
||||||
private static AnimeType _model = AnimeType.GA402;
|
private static AnimeType _model = AnimeType.GA402;
|
||||||
|
|
||||||
|
|
||||||
public AnimeMatrixDevice()
|
public AnimeMatrixDevice()
|
||||||
: base(0x0B05, 0x193B, 640)
|
: base(0x0B05, 0x193B, 640)
|
||||||
{
|
{
|
||||||
@@ -112,6 +117,16 @@ namespace Starlight.AnimeMatrix
|
|||||||
UpdatePageLength = 410;
|
UpdatePageLength = 410;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (model.Contains("GU604"))
|
||||||
|
{
|
||||||
|
_model = AnimeType.GU604;
|
||||||
|
|
||||||
|
MaxColumns = 39;
|
||||||
|
MaxRows = 92;
|
||||||
|
LedCount = 1711;
|
||||||
|
frameShiftX = -5;
|
||||||
|
UpdatePageLength = 630;
|
||||||
|
}
|
||||||
|
|
||||||
_displayBuffer = new byte[LedCount];
|
_displayBuffer = new byte[LedCount];
|
||||||
|
|
||||||
@@ -173,6 +188,9 @@ namespace Starlight.AnimeMatrix
|
|||||||
{
|
{
|
||||||
return (y + 1) / 2 - 3;
|
return (y + 1) / 2 - 3;
|
||||||
}
|
}
|
||||||
|
case AnimeType.GU604:
|
||||||
|
return (int)Math.Ceiling(Math.Max(0, y - 9) / 2F);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return (int)Math.Ceiling(Math.Max(0, y - 11) / 2F);
|
return (int)Math.Ceiling(Math.Max(0, y - 11) / 2F);
|
||||||
}
|
}
|
||||||
@@ -184,6 +202,8 @@ namespace Starlight.AnimeMatrix
|
|||||||
{
|
{
|
||||||
case AnimeType.GA401:
|
case AnimeType.GA401:
|
||||||
return 33;
|
return 33;
|
||||||
|
case AnimeType.GU604:
|
||||||
|
return 39;
|
||||||
default:
|
default:
|
||||||
return 34;
|
return 34;
|
||||||
}
|
}
|
||||||
@@ -226,7 +246,7 @@ namespace Starlight.AnimeMatrix
|
|||||||
if (!IsRowInRange(y)) return;
|
if (!IsRowInRange(y)) return;
|
||||||
|
|
||||||
if (x >= FirstX(y) && x < Width(y))
|
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()
|
public void WakeUp()
|
||||||
@@ -325,13 +345,21 @@ namespace Starlight.AnimeMatrix
|
|||||||
public void PresentClock()
|
public void PresentClock()
|
||||||
{
|
{
|
||||||
int second = DateTime.Now.Second;
|
int second = DateTime.Now.Second;
|
||||||
|
string time;
|
||||||
|
|
||||||
if (CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern.Contains("H"))
|
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
|
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 = "")
|
public void PresentText(string text1, string text2 = "")
|
||||||
{
|
{
|
||||||
using (Bitmap bmp = new Bitmap(MaxColumns * 3, MaxRows))
|
using (Bitmap bmp = new Bitmap(MaxColumns * 3, MaxRows))
|
||||||
@@ -341,14 +369,14 @@ namespace Starlight.AnimeMatrix
|
|||||||
g.CompositingQuality = CompositingQuality.HighQuality;
|
g.CompositingQuality = CompositingQuality.HighQuality;
|
||||||
g.SmoothingMode = SmoothingMode.AntiAlias;
|
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);
|
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)
|
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);
|
SizeF textSize = g.MeasureString(text2, font);
|
||||||
g.DrawString(text2, font, Brushes.White, (MaxColumns * 3 - textSize.Width) + 1, 25);
|
g.DrawString(text2, font, Brushes.White, (MaxColumns * 3 - textSize.Width) + 1, 25);
|
||||||
@@ -419,6 +447,24 @@ namespace Starlight.AnimeMatrix
|
|||||||
|
|
||||||
Clear();
|
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);
|
int maxX = (int)Math.Sqrt(MaxRows * MaxRows + MaxColumns * MaxColumns);
|
||||||
|
|
||||||
using (Bitmap bmp = new Bitmap(maxX, MaxRows))
|
using (Bitmap bmp = new Bitmap(maxX, MaxRows))
|
||||||
@@ -428,10 +474,10 @@ namespace Starlight.AnimeMatrix
|
|||||||
g.CompositingQuality = CompositingQuality.HighQuality;
|
g.CompositingQuality = CompositingQuality.HighQuality;
|
||||||
g.SmoothingMode = SmoothingMode.AntiAlias;
|
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);
|
SizeF textSize = g.MeasureString(text, font);
|
||||||
g.DrawString(text, font, Brushes.White, 4, 0);
|
g.DrawString(text, font, Brushes.White, 4, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,20 +2,18 @@
|
|||||||
using System.Management;
|
using System.Management;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
|
||||||
public class AppConfig
|
public static class AppConfig
|
||||||
{
|
{
|
||||||
|
|
||||||
public string appPath;
|
private static string configFile;
|
||||||
string configFile;
|
private static string? _model;
|
||||||
|
|
||||||
string _model;
|
private static Dictionary<string, object> config = new Dictionary<string, object>();
|
||||||
|
|
||||||
public Dictionary<string, object> config = new Dictionary<string, object>();
|
static AppConfig()
|
||||||
|
|
||||||
public AppConfig()
|
|
||||||
{
|
{
|
||||||
|
|
||||||
appPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\GHelper";
|
string appPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\GHelper";
|
||||||
configFile = appPath + "\\config.json";
|
configFile = appPath + "\\config.json";
|
||||||
|
|
||||||
if (!System.IO.Directory.Exists(appPath))
|
if (!System.IO.Directory.Exists(appPath))
|
||||||
@@ -41,7 +39,7 @@ public class AppConfig
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public string GetModel()
|
public static string GetModel()
|
||||||
{
|
{
|
||||||
if (_model is null)
|
if (_model is null)
|
||||||
{
|
{
|
||||||
@@ -58,14 +56,14 @@ public class AppConfig
|
|||||||
|
|
||||||
return _model;
|
return _model;
|
||||||
}
|
}
|
||||||
public bool ContainsModel(string contains)
|
public static bool ContainsModel(string contains)
|
||||||
{
|
{
|
||||||
|
|
||||||
GetModel();
|
GetModel();
|
||||||
return (_model is not null && _model.Contains(contains));
|
return (_model is not null && _model.Contains(contains));
|
||||||
|
|
||||||
}
|
}
|
||||||
private void initConfig()
|
private static void initConfig()
|
||||||
{
|
{
|
||||||
config = new Dictionary<string, object>();
|
config = new Dictionary<string, object>();
|
||||||
config["performance_mode"] = 0;
|
config["performance_mode"] = 0;
|
||||||
@@ -73,22 +71,26 @@ public class AppConfig
|
|||||||
File.WriteAllText(configFile, jsonString);
|
File.WriteAllText(configFile, jsonString);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getConfig(string name, bool performance = false)
|
public static int getConfig(string name, int empty = -1)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (config.ContainsKey(name))
|
if (config.ContainsKey(name))
|
||||||
return int.Parse(config[name].ToString());
|
return int.Parse(config[name].ToString());
|
||||||
else return -1;
|
else return empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string getConfigString(string name)
|
public static bool isConfig(string name)
|
||||||
|
{
|
||||||
|
return getConfig(name) == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string getConfigString(string name, string empty = null)
|
||||||
{
|
{
|
||||||
if (config.ContainsKey(name))
|
if (config.ContainsKey(name))
|
||||||
return config[name].ToString();
|
return config[name].ToString();
|
||||||
else return null;
|
else return empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConfig(string name, int value)
|
public static void setConfig(string name, int value)
|
||||||
{
|
{
|
||||||
config[name] = value;
|
config[name] = value;
|
||||||
string jsonString = JsonSerializer.Serialize(config, new JsonSerializerOptions { WriteIndented = true });
|
string jsonString = JsonSerializer.Serialize(config, new JsonSerializerOptions { WriteIndented = true });
|
||||||
@@ -101,7 +103,7 @@ public class AppConfig
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConfig(string name, string value)
|
public static void setConfig(string name, string value)
|
||||||
{
|
{
|
||||||
config[name] = value;
|
config[name] = value;
|
||||||
string jsonString = JsonSerializer.Serialize(config, new JsonSerializerOptions { WriteIndented = true });
|
string jsonString = JsonSerializer.Serialize(config, new JsonSerializerOptions { WriteIndented = true });
|
||||||
@@ -115,22 +117,32 @@ public class AppConfig
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string getParamName(int device, string paramName = "fan_profile")
|
public static string getParamName(AsusFan device, string paramName = "fan_profile")
|
||||||
{
|
{
|
||||||
int mode = getConfig("performance_mode");
|
int mode = getConfig("performance_mode");
|
||||||
string name;
|
string name;
|
||||||
|
|
||||||
if (device == 1)
|
switch (device)
|
||||||
name = "gpu";
|
{
|
||||||
else if (device == 2)
|
case AsusFan.GPU:
|
||||||
name = "mid";
|
name = "gpu";
|
||||||
else
|
break;
|
||||||
name = "cpu";
|
case AsusFan.Mid:
|
||||||
|
name = "mid";
|
||||||
|
break;
|
||||||
|
case AsusFan.XGM:
|
||||||
|
name = "xgm";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
name = "cpu";
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return paramName + "_" + name + "_" + mode;
|
return paramName + "_" + name + "_" + mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] getFanConfig(int device)
|
public static byte[] getFanConfig(AsusFan device)
|
||||||
{
|
{
|
||||||
string curveString = getConfigString(getParamName(device));
|
string curveString = getConfigString(getParamName(device));
|
||||||
byte[] curve = { };
|
byte[] curve = { };
|
||||||
@@ -141,7 +153,7 @@ public class AppConfig
|
|||||||
return curve;
|
return curve;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFanConfig(int device, byte[] curve)
|
public static void setFanConfig(AsusFan device, byte[] curve)
|
||||||
{
|
{
|
||||||
string bitCurve = BitConverter.ToString(curve);
|
string bitCurve = BitConverter.ToString(curve);
|
||||||
setConfig(getParamName(device), bitCurve);
|
setConfig(getParamName(device), bitCurve);
|
||||||
@@ -156,7 +168,7 @@ public class AppConfig
|
|||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] getDefaultCurve(int device)
|
public static byte[] getDefaultCurve(AsusFan device)
|
||||||
{
|
{
|
||||||
int mode = getConfig("performance_mode");
|
int mode = getConfig("performance_mode");
|
||||||
byte[] curve;
|
byte[] curve;
|
||||||
@@ -164,19 +176,19 @@ public class AppConfig
|
|||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
if (device == 1)
|
if (device == AsusFan.GPU)
|
||||||
curve = StringToBytes("14-3F-44-48-4C-50-54-62-16-1F-26-2D-39-47-55-5F");
|
curve = StringToBytes("14-3F-44-48-4C-50-54-62-16-1F-26-2D-39-47-55-5F");
|
||||||
else
|
else
|
||||||
curve = StringToBytes("14-3F-44-48-4C-50-54-62-11-1A-22-29-34-43-51-5A");
|
curve = StringToBytes("14-3F-44-48-4C-50-54-62-11-1A-22-29-34-43-51-5A");
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (device == 1)
|
if (device == AsusFan.GPU)
|
||||||
curve = StringToBytes("3C-41-42-46-47-4B-4C-62-08-11-11-1D-1D-26-26-2D");
|
curve = StringToBytes("3C-41-42-46-47-4B-4C-62-08-11-11-1D-1D-26-26-2D");
|
||||||
else
|
else
|
||||||
curve = StringToBytes("3C-41-42-46-47-4B-4C-62-03-0C-0C-16-16-22-22-29");
|
curve = StringToBytes("3C-41-42-46-47-4B-4C-62-03-0C-0C-16-16-22-22-29");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (device == 1)
|
if (device == AsusFan.GPU)
|
||||||
curve = StringToBytes("3A-3D-40-44-48-4D-51-62-0C-16-1D-1F-26-2D-34-4A");
|
curve = StringToBytes("3A-3D-40-44-48-4D-51-62-0C-16-1D-1F-26-2D-34-4A");
|
||||||
else
|
else
|
||||||
curve = StringToBytes("3A-3D-40-44-48-4D-51-62-08-11-16-1A-22-29-30-45");
|
curve = StringToBytes("3A-3D-40-44-48-4D-51-62-08-11-16-1A-22-29-30-45");
|
||||||
@@ -186,19 +198,19 @@ public class AppConfig
|
|||||||
return curve;
|
return curve;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string getConfigPerfString(string name)
|
public static string getConfigPerfString(string name)
|
||||||
{
|
{
|
||||||
int mode = getConfig("performance_mode");
|
int mode = getConfig("performance_mode");
|
||||||
return getConfigString(name + "_" + mode);
|
return getConfigString(name + "_" + mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getConfigPerf(string name)
|
public static int getConfigPerf(string name)
|
||||||
{
|
{
|
||||||
int mode = getConfig("performance_mode");
|
int mode = getConfig("performance_mode");
|
||||||
return getConfig(name + "_" + mode);
|
return getConfig(name + "_" + mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConfigPerf(string name, int value)
|
public static void setConfigPerf(string name, int value)
|
||||||
{
|
{
|
||||||
int mode = getConfig("performance_mode");
|
int mode = getConfig("performance_mode");
|
||||||
setConfig(name + "_" + mode, value);
|
setConfig(name + "_" + mode, value);
|
||||||
|
|||||||
@@ -1,7 +1,29 @@
|
|||||||
using System.Management;
|
using System.Management;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
public class ASUSWmi
|
public enum AsusFan
|
||||||
|
{
|
||||||
|
CPU = 0,
|
||||||
|
GPU = 1,
|
||||||
|
Mid = 2,
|
||||||
|
XGM = 3
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum AsusMode
|
||||||
|
{
|
||||||
|
Balanced = 0,
|
||||||
|
Turbo = 1,
|
||||||
|
Silent = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum AsusGPU
|
||||||
|
{
|
||||||
|
Eco = 0,
|
||||||
|
Standard = 1,
|
||||||
|
Ultimate = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AsusACPI
|
||||||
{
|
{
|
||||||
|
|
||||||
const string FILE_NAME = @"\\.\\ATKACPI";
|
const string FILE_NAME = @"\\.\\ATKACPI";
|
||||||
@@ -9,10 +31,12 @@ public class ASUSWmi
|
|||||||
|
|
||||||
const uint DSTS = 0x53545344;
|
const uint DSTS = 0x53545344;
|
||||||
const uint DEVS = 0x53564544;
|
const uint DEVS = 0x53564544;
|
||||||
|
const uint INIT = 0x54494E49;
|
||||||
|
|
||||||
public const uint UniversalControl = 0x00100021;
|
public const uint UniversalControl = 0x00100021;
|
||||||
public const int KB_Light_Up = 0xc4;
|
public const int KB_Light_Up = 0xc4;
|
||||||
public const int KB_Light_Down = 0xc5;
|
public const int KB_Light_Down = 0xc5;
|
||||||
|
public const int Touchpad_Toggle = 0x6B;
|
||||||
|
|
||||||
public const int ChargerMode = 0x0012006C;
|
public const int ChargerMode = 0x0012006C;
|
||||||
|
|
||||||
@@ -57,6 +81,13 @@ public class ASUSWmi
|
|||||||
public const int TUF_KB = 0x00100056;
|
public const int TUF_KB = 0x00100056;
|
||||||
public const int TUF_KB_STATE = 0x00100057;
|
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 PerformanceBalanced = 0;
|
||||||
public const int PerformanceTurbo = 1;
|
public const int PerformanceTurbo = 1;
|
||||||
public const int PerformanceSilent = 2;
|
public const int PerformanceSilent = 2;
|
||||||
@@ -116,7 +147,43 @@ public class ASUSWmi
|
|||||||
|
|
||||||
private IntPtr handle;
|
private IntPtr handle;
|
||||||
|
|
||||||
public ASUSWmi()
|
// 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, "ATK4001");
|
||||||
|
|
||||||
|
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);
|
||||||
|
Logger.WriteLine("ACPI " + 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("ACPI Code: " + code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public AsusACPI()
|
||||||
{
|
{
|
||||||
handle = CreateFile(
|
handle = CreateFile(
|
||||||
FILE_NAME,
|
FILE_NAME,
|
||||||
@@ -127,16 +194,18 @@ public class ASUSWmi
|
|||||||
FILE_ATTRIBUTE_NORMAL,
|
FILE_ATTRIBUTE_NORMAL,
|
||||||
IntPtr.Zero
|
IntPtr.Zero
|
||||||
);
|
);
|
||||||
|
|
||||||
if (handle == new IntPtr(-1))
|
if (handle == new IntPtr(-1))
|
||||||
{
|
{
|
||||||
throw new Exception("Can't connect to ACPI");
|
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;
|
uint lpBytesReturned = 0;
|
||||||
bool result = DeviceIoControl(
|
return DeviceIoControl(
|
||||||
handle,
|
handle,
|
||||||
dwIoControlCode,
|
dwIoControlCode,
|
||||||
lpInBuffer,
|
lpInBuffer,
|
||||||
@@ -171,6 +240,13 @@ public class ASUSWmi
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public byte[] DeviceInit()
|
||||||
|
{
|
||||||
|
byte[] args = new byte[8];
|
||||||
|
return CallMethod(INIT, args);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public int DeviceSet(uint DeviceID, int Status, string logName)
|
public int DeviceSet(uint DeviceID, int Status, string logName)
|
||||||
{
|
{
|
||||||
byte[] args = new byte[8];
|
byte[] args = new byte[8];
|
||||||
@@ -204,7 +280,7 @@ public class ASUSWmi
|
|||||||
byte[] args = new byte[8];
|
byte[] args = new byte[8];
|
||||||
BitConverter.GetBytes((uint)DeviceID).CopyTo(args, 0);
|
BitConverter.GetBytes((uint)DeviceID).CopyTo(args, 0);
|
||||||
byte[] status = CallMethod(DSTS, args);
|
byte[] status = CallMethod(DSTS, args);
|
||||||
|
|
||||||
return BitConverter.ToInt32(status, 0) - 65536;
|
return BitConverter.ToInt32(status, 0) - 65536;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -214,12 +290,26 @@ public class ASUSWmi
|
|||||||
byte[] args = new byte[8];
|
byte[] args = new byte[8];
|
||||||
BitConverter.GetBytes((uint)DeviceID).CopyTo(args, 0);
|
BitConverter.GetBytes((uint)DeviceID).CopyTo(args, 0);
|
||||||
BitConverter.GetBytes((uint)Status).CopyTo(args, 4);
|
BitConverter.GetBytes((uint)Status).CopyTo(args, 4);
|
||||||
|
|
||||||
return CallMethod(DSTS, args);
|
return CallMethod(DSTS, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int SetGPUEco(int eco)
|
||||||
|
{
|
||||||
|
int ecoFlag = DeviceGet(GPUEco);
|
||||||
|
if (ecoFlag < 0) return -1;
|
||||||
|
|
||||||
public int SetFanCurve(int device, byte[] curve)
|
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(AsusFan device, byte[] curve)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (curve.Length != 16) return -1;
|
if (curve.Length != 16) return -1;
|
||||||
@@ -228,16 +318,14 @@ public class ASUSWmi
|
|||||||
int result;
|
int result;
|
||||||
|
|
||||||
for (int i = 8; i < curve.Length; i++)
|
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%
|
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)
|
switch (device)
|
||||||
{
|
{
|
||||||
case 1:
|
case AsusFan.GPU:
|
||||||
result = DeviceSet(DevsGPUFanCurve, curve, "FanGPU");
|
result = DeviceSet(DevsGPUFanCurve, curve, "FanGPU");
|
||||||
break;
|
break;
|
||||||
case 2:
|
case AsusFan.Mid:
|
||||||
result = DeviceSet(DevsMidFanCurve, curve, "FanMid");
|
result = DeviceSet(DevsMidFanCurve, curve, "FanMid");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -248,7 +336,7 @@ public class ASUSWmi
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] GetFanCurve(int device, int mode = 0)
|
public byte[] GetFanCurve(AsusFan device, int mode = 0)
|
||||||
{
|
{
|
||||||
uint fan_mode;
|
uint fan_mode;
|
||||||
|
|
||||||
@@ -262,9 +350,9 @@ public class ASUSWmi
|
|||||||
|
|
||||||
switch (device)
|
switch (device)
|
||||||
{
|
{
|
||||||
case 1:
|
case AsusFan.GPU:
|
||||||
return DeviceGetBuffer(DevsGPUFanCurve, fan_mode);
|
return DeviceGetBuffer(DevsGPUFanCurve, fan_mode);
|
||||||
case 2:
|
case AsusFan.Mid:
|
||||||
return DeviceGetBuffer(DevsMidFanCurve, fan_mode);
|
return DeviceGetBuffer(DevsMidFanCurve, fan_mode);
|
||||||
default:
|
default:
|
||||||
return DeviceGetBuffer(DevsCPUFanCurve, fan_mode);
|
return DeviceGetBuffer(DevsCPUFanCurve, fan_mode);
|
||||||
@@ -272,6 +360,58 @@ public class ASUSWmi
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool IsInvalidCurve(byte[] curve)
|
||||||
|
{
|
||||||
|
return curve.Length != 16 || IsEmptyCurve(curve);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool IsEmptyCurve(byte[] curve)
|
||||||
|
{
|
||||||
|
return 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 bool IsXGConnected()
|
||||||
|
{
|
||||||
|
//return true;
|
||||||
|
return DeviceGet(GPUXGConnected) == 1;
|
||||||
|
}
|
||||||
|
|
||||||
public void TUFKeyboardBrightness(int brightness)
|
public void TUFKeyboardBrightness(int brightness)
|
||||||
{
|
{
|
||||||
int param = 0x80 | (brightness & 0x7F);
|
int param = 0x80 | (brightness & 0x7F);
|
||||||
@@ -321,7 +461,8 @@ public class ASUSWmi
|
|||||||
watcher.Scope = new ManagementScope("root\\wmi");
|
watcher.Scope = new ManagementScope("root\\wmi");
|
||||||
watcher.Query = new WqlEventQuery("SELECT * FROM AsusAtkWmiEvent");
|
watcher.Query = new WqlEventQuery("SELECT * FROM AsusAtkWmiEvent");
|
||||||
watcher.Start();
|
watcher.Start();
|
||||||
} catch
|
}
|
||||||
|
catch
|
||||||
{
|
{
|
||||||
Logger.WriteLine("Can't connect to ASUS WMI events");
|
Logger.WriteLine("Can't connect to ASUS WMI events");
|
||||||
}
|
}
|
||||||
407
app/AsusUSB.cs
Normal file
407
app/AsusUSB.cs
Normal file
@@ -0,0 +1,407 @@
|
|||||||
|
using HidLibrary;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace GHelper
|
||||||
|
{
|
||||||
|
|
||||||
|
[Flags]
|
||||||
|
public enum AuraDev19b6 : uint
|
||||||
|
{
|
||||||
|
BootLogo = 1,
|
||||||
|
BootKeyb = 1 << 1,
|
||||||
|
AwakeLogo = 1 << 2,
|
||||||
|
AwakeKeyb = 1 << 3,
|
||||||
|
SleepLogo = 1 << 4,
|
||||||
|
SleepKeyb = 1 << 5,
|
||||||
|
ShutdownLogo = 1 << 6,
|
||||||
|
ShutdownKeyb = 1 << 7,
|
||||||
|
BootBar = 1u << (7 + 2),
|
||||||
|
AwakeBar = 1u << (7 + 3),
|
||||||
|
SleepBar = 1u << (7 + 4),
|
||||||
|
ShutdownBar = 1u << (7 + 5),
|
||||||
|
BootLid = 1u << (15 + 1),
|
||||||
|
AwakeLid = 1u << (15 + 2),
|
||||||
|
SleepLid = 1u << (15 + 3),
|
||||||
|
ShutdownLid = 1u << (15 + 4)
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class AuraDev19b6Extensions
|
||||||
|
{
|
||||||
|
public static byte[] ToBytes(this AuraDev19b6[] controls)
|
||||||
|
{
|
||||||
|
uint a = 0;
|
||||||
|
foreach (var n in controls)
|
||||||
|
{
|
||||||
|
a |= (uint)n;
|
||||||
|
}
|
||||||
|
return new byte[] { 0x5d, 0xbd, 0x01, (byte)(a & 0xff), (byte)((a & 0xff00) >> 8), (byte)((a & 0xff0000) >> 16) };
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ushort BitOr(this AuraDev19b6 self, AuraDev19b6 rhs)
|
||||||
|
{
|
||||||
|
return (ushort)(self | rhs);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ushort BitAnd(this AuraDev19b6 self, AuraDev19b6 rhs)
|
||||||
|
{
|
||||||
|
return (ushort)(self & rhs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static class AsusUSB
|
||||||
|
{
|
||||||
|
|
||||||
|
public const int ASUS_ID = 0x0b05;
|
||||||
|
|
||||||
|
public const byte INPUT_HID_ID = 0x5a;
|
||||||
|
public const byte AURA_HID_ID = 0x5d;
|
||||||
|
|
||||||
|
public static readonly byte[] LED_INIT1 = new byte[] { AURA_HID_ID, 0xb9 };
|
||||||
|
public static readonly byte[] LED_INIT2 = Encoding.ASCII.GetBytes("]ASUS Tech.Inc.");
|
||||||
|
public static readonly byte[] LED_INIT3 = new byte[] { AURA_HID_ID, 0x05, 0x20, 0x31, 0, 0x08 };
|
||||||
|
public static readonly byte[] LED_INIT4 = Encoding.ASCII.GetBytes("^ASUS Tech.Inc.");
|
||||||
|
public static readonly byte[] LED_INIT5 = new byte[] { 0x5e, 0x05, 0x20, 0x31, 0, 0x08 };
|
||||||
|
|
||||||
|
static byte[] MESSAGE_SET = { AURA_HID_ID, 0xb5, 0, 0, 0 };
|
||||||
|
static byte[] MESSAGE_APPLY = { AURA_HID_ID, 0xb4 };
|
||||||
|
|
||||||
|
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;
|
||||||
|
public static Color Color1 = Color.White;
|
||||||
|
public static Color Color2 = Color.Black;
|
||||||
|
|
||||||
|
|
||||||
|
public static Dictionary<int, string> GetSpeeds()
|
||||||
|
{
|
||||||
|
return new Dictionary<int, string>
|
||||||
|
{
|
||||||
|
{ 0, Properties.Strings.AuraSlow },
|
||||||
|
{ 1, Properties.Strings.AuraNormal },
|
||||||
|
{ 2, Properties.Strings.AuraFast }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static Dictionary<int, string> _modes = new Dictionary<int, string>
|
||||||
|
{
|
||||||
|
{ 0, Properties.Strings.AuraStatic },
|
||||||
|
{ 1, Properties.Strings.AuraBreathe },
|
||||||
|
{ 2, Properties.Strings.AuraColorCycle },
|
||||||
|
{ 3, Properties.Strings.AuraRainbow },
|
||||||
|
{ 10, Properties.Strings.AuraStrobe },
|
||||||
|
};
|
||||||
|
|
||||||
|
static Dictionary<int, string> _modesStrix = new Dictionary<int, string>
|
||||||
|
{
|
||||||
|
{ 0, Properties.Strings.AuraStatic },
|
||||||
|
{ 1, Properties.Strings.AuraBreathe },
|
||||||
|
{ 2, Properties.Strings.AuraColorCycle },
|
||||||
|
{ 3, Properties.Strings.AuraRainbow },
|
||||||
|
{ 4, "Star" },
|
||||||
|
{ 5, "Rain" },
|
||||||
|
{ 6, "Highlight" },
|
||||||
|
{ 7, "Laser" },
|
||||||
|
{ 8, "Ripple" },
|
||||||
|
{ 10, Properties.Strings.AuraStrobe},
|
||||||
|
{ 11, "Comet" },
|
||||||
|
{ 12, "Flash" },
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
public static Dictionary<int, string> GetModes()
|
||||||
|
{
|
||||||
|
if (AppConfig.ContainsModel("TUF"))
|
||||||
|
{
|
||||||
|
_modes.Remove(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AppConfig.ContainsModel("401"))
|
||||||
|
{
|
||||||
|
_modes.Remove(2);
|
||||||
|
_modes.Remove(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AppConfig.ContainsModel("Strix") || AppConfig.ContainsModel("Scar"))
|
||||||
|
{
|
||||||
|
return _modesStrix;
|
||||||
|
}
|
||||||
|
|
||||||
|
return _modes;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static int Mode
|
||||||
|
{
|
||||||
|
get { return mode; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (GetModes().ContainsKey(value))
|
||||||
|
mode = value;
|
||||||
|
else
|
||||||
|
mode = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool HasSecondColor()
|
||||||
|
{
|
||||||
|
return (mode == 1 && !AppConfig.ContainsModel("TUF"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Speed
|
||||||
|
{
|
||||||
|
get { return speed; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (GetSpeeds().ContainsKey(value))
|
||||||
|
speed = value;
|
||||||
|
else
|
||||||
|
speed = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetColor(int colorCode)
|
||||||
|
{
|
||||||
|
Color1 = Color.FromArgb(colorCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetColor2(int colorCode)
|
||||||
|
{
|
||||||
|
Color2 = Color.FromArgb(colorCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static IEnumerable<HidDevice> GetHidDevices(int[] deviceIds, int minInput = 18, int minFeatures = 1)
|
||||||
|
{
|
||||||
|
HidDevice[] HidDeviceList = HidDevices.Enumerate(ASUS_ID, deviceIds).ToArray();
|
||||||
|
foreach (HidDevice device in HidDeviceList)
|
||||||
|
if (device.IsConnected
|
||||||
|
&& device.Capabilities.FeatureReportByteLength >= minFeatures
|
||||||
|
&& device.Capabilities.InputReportByteLength >= minInput)
|
||||||
|
yield return device;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HidDevice? GetDevice(byte reportID = INPUT_HID_ID)
|
||||||
|
{
|
||||||
|
HidDevice[] HidDeviceList = HidDevices.Enumerate(ASUS_ID, deviceIds).ToArray();
|
||||||
|
HidDevice input = null;
|
||||||
|
|
||||||
|
foreach (HidDevice device in HidDeviceList)
|
||||||
|
if (device.ReadFeatureData(out byte[] data, reportID))
|
||||||
|
{
|
||||||
|
input = device;
|
||||||
|
//Logger.WriteLine("HID Device("+ reportID + ")" + + device.Capabilities.FeatureReportByteLength + "|" + device.Capabilities.InputReportByteLength + device.DevicePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool TouchpadToggle()
|
||||||
|
{
|
||||||
|
HidDevice? input = GetDevice();
|
||||||
|
if (input != null) return input.WriteFeatureData(new byte[] { INPUT_HID_ID, 0xf4, 0x6b });
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static byte[] AuraMessage(int mode, Color color, Color color2, int speed)
|
||||||
|
{
|
||||||
|
|
||||||
|
byte[] msg = new byte[17];
|
||||||
|
msg[0] = AURA_HID_ID;
|
||||||
|
msg[1] = 0xb3;
|
||||||
|
msg[2] = 0x00; // Zone
|
||||||
|
msg[3] = (byte)mode; // Aura Mode
|
||||||
|
msg[4] = (byte)(color.R); // R
|
||||||
|
msg[5] = (byte)(color.G); // G
|
||||||
|
msg[6] = (byte)(color.B); // B
|
||||||
|
msg[7] = (byte)speed; // aura.speed as u8;
|
||||||
|
msg[8] = 0; // aura.direction as u8;
|
||||||
|
msg[10] = (byte)(color2.R); // R
|
||||||
|
msg[11] = (byte)(color2.G); // G
|
||||||
|
msg[12] = (byte)(color2.B); // B
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Init()
|
||||||
|
{
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
var devices = GetHidDevices(deviceIds, 0);
|
||||||
|
foreach (HidDevice device in devices)
|
||||||
|
{
|
||||||
|
device.OpenDevice();
|
||||||
|
device.WriteFeatureData(LED_INIT1);
|
||||||
|
device.WriteFeatureData(LED_INIT2);
|
||||||
|
device.WriteFeatureData(LED_INIT3);
|
||||||
|
device.WriteFeatureData(LED_INIT4);
|
||||||
|
device.WriteFeatureData(LED_INIT5);
|
||||||
|
device.CloseDevice();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void ApplyBrightness(int brightness)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (AppConfig.ContainsModel("TUF"))
|
||||||
|
Program.acpi.TUFKeyboardBrightness(brightness);
|
||||||
|
|
||||||
|
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
|
||||||
|
byte[] msg = { AURA_HID_ID, 0xba, 0xc5, 0xc4, (byte)brightness };
|
||||||
|
|
||||||
|
var devices = GetHidDevices(deviceIds);
|
||||||
|
foreach (HidDevice device in devices)
|
||||||
|
{
|
||||||
|
device.OpenDevice();
|
||||||
|
device.WriteFeatureData(msg);
|
||||||
|
Logger.WriteLine("KB Backlight:" + BitConverter.ToString(msg));
|
||||||
|
device.CloseDevice();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Backup payload for old models
|
||||||
|
if (AppConfig.ContainsModel("503"))
|
||||||
|
{
|
||||||
|
byte[] msgBackup = { INPUT_HID_ID, 0xba, 0xc5, 0xc4, (byte)brightness };
|
||||||
|
|
||||||
|
var devicesBackup = GetHidDevices(deviceIds, 0);
|
||||||
|
foreach (HidDevice device in devicesBackup)
|
||||||
|
{
|
||||||
|
device.OpenDevice();
|
||||||
|
device.WriteFeatureData(msgBackup);
|
||||||
|
device.CloseDevice();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void ApplyAuraPower(List<AuraDev19b6> flags)
|
||||||
|
{
|
||||||
|
|
||||||
|
byte[] msg = AuraDev19b6Extensions.ToBytes(flags.ToArray());
|
||||||
|
|
||||||
|
|
||||||
|
var devices = GetHidDevices(deviceIds);
|
||||||
|
//Logger.WriteLine("USB-KB = " + BitConverter.ToString(msg));
|
||||||
|
|
||||||
|
foreach (HidDevice device in devices)
|
||||||
|
{
|
||||||
|
device.OpenDevice();
|
||||||
|
device.WriteFeatureData(msg);
|
||||||
|
Logger.WriteLine("USB-KB " + device.Attributes.ProductHexId + ":" + BitConverter.ToString(msg));
|
||||||
|
device.CloseDevice();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AppConfig.ContainsModel("TUF"))
|
||||||
|
Program.acpi.TUFKeyboardPower(
|
||||||
|
flags.Contains(AuraDev19b6.AwakeKeyb),
|
||||||
|
flags.Contains(AuraDev19b6.BootKeyb),
|
||||||
|
flags.Contains(AuraDev19b6.SleepKeyb),
|
||||||
|
flags.Contains(AuraDev19b6.ShutdownKeyb));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void ApplyAura()
|
||||||
|
{
|
||||||
|
|
||||||
|
int _speed;
|
||||||
|
|
||||||
|
switch (Speed)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
_speed = 0xeb;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
_speed = 0xf5;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
_speed = 0xe1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
byte[] msg = AuraMessage(Mode, Color1, Color2, _speed);
|
||||||
|
|
||||||
|
var devices = GetHidDevices(deviceIds);
|
||||||
|
|
||||||
|
if (devices.Count() == 0)
|
||||||
|
{
|
||||||
|
Logger.WriteLine("USB-KB : not found");
|
||||||
|
devices = GetHidDevices(deviceIds, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (HidDevice device in devices)
|
||||||
|
{
|
||||||
|
device.OpenDevice();
|
||||||
|
device.WriteFeatureData(msg);
|
||||||
|
device.WriteFeatureData(MESSAGE_SET);
|
||||||
|
device.WriteFeatureData(MESSAGE_APPLY);
|
||||||
|
device.CloseDevice();
|
||||||
|
Logger.WriteLine("USB-KB " + device.Capabilities.FeatureReportByteLength + "|" + device.Capabilities.InputReportByteLength + device.Description + device.DevicePath + ":" + BitConverter.ToString(msg));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AppConfig.ContainsModel("TUF"))
|
||||||
|
Program.acpi.TUFKeyboardRGB(Mode, Color1, _speed);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Reference : thanks to https://github.com/RomanYazvinsky/ for initial discovery of XGM payloads
|
||||||
|
public static int SetXGM(byte[] msg)
|
||||||
|
{
|
||||||
|
|
||||||
|
//Logger.WriteLine("XGM Payload :" + BitConverter.ToString(msg));
|
||||||
|
|
||||||
|
var payload = new byte[300];
|
||||||
|
Array.Copy(msg, payload, msg.Length);
|
||||||
|
|
||||||
|
foreach (HidDevice device in GetHidDevices(new int[] { 0x1970 }, 0, 300))
|
||||||
|
{
|
||||||
|
device.OpenDevice();
|
||||||
|
Logger.WriteLine("XGM " + device.Attributes.ProductHexId + "|" + device.Capabilities.FeatureReportByteLength + ":" + BitConverter.ToString(msg));
|
||||||
|
device.WriteFeatureData(payload);
|
||||||
|
device.CloseDevice();
|
||||||
|
//return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ApplyXGMLight(bool status)
|
||||||
|
{
|
||||||
|
SetXGM(new byte[] { 0x5e, 0xc5, status ? (byte)0x50 : (byte)0 });
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static int ResetXGM()
|
||||||
|
{
|
||||||
|
return SetXGM(new byte[] { 0x5e, 0xd1, 0x02 });
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int SetXGMFan(byte[] curve)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (AsusACPI.IsInvalidCurve(curve)) return -1;
|
||||||
|
|
||||||
|
byte[] msg = new byte[19];
|
||||||
|
Array.Copy(new byte[] { 0x5e, 0xd1, 0x01 }, msg, 3);
|
||||||
|
Array.Copy(curve, 0, msg, 3, curve.Length);
|
||||||
|
|
||||||
|
return SetXGM(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
300
app/Aura.cs
300
app/Aura.cs
@@ -1,300 +0,0 @@
|
|||||||
using HidLibrary;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using static Starlight.AnimeMatrix.BuiltInAnimation;
|
|
||||||
|
|
||||||
namespace GHelper
|
|
||||||
{
|
|
||||||
|
|
||||||
[Flags]
|
|
||||||
public enum AuraDev19b6 : uint
|
|
||||||
{
|
|
||||||
BootLogo = 1,
|
|
||||||
BootKeyb = 1 << 1,
|
|
||||||
AwakeLogo = 1 << 2,
|
|
||||||
AwakeKeyb = 1 << 3,
|
|
||||||
SleepLogo = 1 << 4,
|
|
||||||
SleepKeyb = 1 << 5,
|
|
||||||
ShutdownLogo = 1 << 6,
|
|
||||||
ShutdownKeyb = 1 << 7,
|
|
||||||
BootBar = 1u << (7 + 2),
|
|
||||||
AwakeBar = 1u << (7 + 3),
|
|
||||||
SleepBar = 1u << (7 + 4),
|
|
||||||
ShutdownBar = 1u << (7 + 5),
|
|
||||||
BootLid = 1u << (15 + 1),
|
|
||||||
AwakeLid = 1u << (15 + 2),
|
|
||||||
SleepLid = 1u << (15 + 3),
|
|
||||||
ShutdownLid = 1u << (15 + 4)
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class AuraDev19b6Extensions
|
|
||||||
{
|
|
||||||
public static byte[] ToBytes(this AuraDev19b6[] controls)
|
|
||||||
{
|
|
||||||
uint a = 0;
|
|
||||||
foreach (var n in controls)
|
|
||||||
{
|
|
||||||
a |= (uint)n;
|
|
||||||
}
|
|
||||||
return new byte[] { 0x5d, 0xbd, 0x01, (byte)(a & 0xff), (byte)((a & 0xff00) >> 8), (byte)((a & 0xff0000) >> 16) };
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ushort BitOr(this AuraDev19b6 self, AuraDev19b6 rhs)
|
|
||||||
{
|
|
||||||
return (ushort)(self | rhs);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ushort BitAnd(this AuraDev19b6 self, AuraDev19b6 rhs)
|
|
||||||
{
|
|
||||||
return (ushort)(self & rhs);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Aura
|
|
||||||
{
|
|
||||||
|
|
||||||
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 };
|
|
||||||
|
|
||||||
private static int mode = 0;
|
|
||||||
private static int speed = 1;
|
|
||||||
public static Color Color1 = Color.White;
|
|
||||||
public static Color Color2 = Color.Black;
|
|
||||||
|
|
||||||
|
|
||||||
public static Dictionary<int, string> GetSpeeds()
|
|
||||||
{
|
|
||||||
return new Dictionary<int, string>
|
|
||||||
{
|
|
||||||
{ 0, Properties.Strings.AuraSlow },
|
|
||||||
{ 1, Properties.Strings.AuraNormal },
|
|
||||||
{ 2, Properties.Strings.AuraFast }
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
static Dictionary<int, string> _modes = new Dictionary<int, string>
|
|
||||||
{
|
|
||||||
{ 0, Properties.Strings.AuraStatic },
|
|
||||||
{ 1, Properties.Strings.AuraBreathe },
|
|
||||||
{ 2, Properties.Strings.AuraColorCycle },
|
|
||||||
{ 3, Properties.Strings.AuraRainbow },
|
|
||||||
{ 10, Properties.Strings.AuraStrobe },
|
|
||||||
};
|
|
||||||
|
|
||||||
static Dictionary<int, string> _modesStrix = new Dictionary<int, string>
|
|
||||||
{
|
|
||||||
{ 0, Properties.Strings.AuraStatic },
|
|
||||||
{ 1, Properties.Strings.AuraBreathe },
|
|
||||||
{ 2, Properties.Strings.AuraColorCycle },
|
|
||||||
{ 3, Properties.Strings.AuraRainbow },
|
|
||||||
{ 4, "Star" },
|
|
||||||
{ 5, "Rain" },
|
|
||||||
{ 6, "Highlight" },
|
|
||||||
{ 7, "Laser" },
|
|
||||||
{ 8, "Ripple" },
|
|
||||||
{ 10, Properties.Strings.AuraStrobe},
|
|
||||||
{ 11, "Comet" },
|
|
||||||
{ 12, "Flash" },
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
public static Dictionary<int, string> GetModes()
|
|
||||||
{
|
|
||||||
if (Program.config.ContainsModel("TUF"))
|
|
||||||
{
|
|
||||||
_modes.Remove(3);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Program.config.ContainsModel("401"))
|
|
||||||
{
|
|
||||||
_modes.Remove(2);
|
|
||||||
_modes.Remove(3);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Program.config.ContainsModel("Strix") || Program.config.ContainsModel("Scar"))
|
|
||||||
{
|
|
||||||
return _modesStrix;
|
|
||||||
}
|
|
||||||
|
|
||||||
return _modes;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static int Mode
|
|
||||||
{
|
|
||||||
get { return mode; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (GetModes().ContainsKey(value))
|
|
||||||
mode = value;
|
|
||||||
else
|
|
||||||
mode = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool HasSecondColor()
|
|
||||||
{
|
|
||||||
return (mode == 1 && !Program.config.ContainsModel("TUF"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int Speed
|
|
||||||
{
|
|
||||||
get { return speed; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (GetSpeeds().ContainsKey(value))
|
|
||||||
speed = value;
|
|
||||||
else
|
|
||||||
speed = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void SetColor(int colorCode)
|
|
||||||
{
|
|
||||||
Color1 = Color.FromArgb(colorCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void SetColor2(int colorCode)
|
|
||||||
{
|
|
||||||
Color2 = Color.FromArgb(colorCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static byte[] AuraMessage(int mode, Color color, Color color2, int speed)
|
|
||||||
{
|
|
||||||
|
|
||||||
byte[] msg = new byte[17];
|
|
||||||
msg[0] = 0x5d;
|
|
||||||
msg[1] = 0xb3;
|
|
||||||
msg[2] = 0x00; // Zone
|
|
||||||
msg[3] = (byte)mode; // Aura Mode
|
|
||||||
msg[4] = (byte)(color.R); // R
|
|
||||||
msg[5] = (byte)(color.G); // G
|
|
||||||
msg[6] = (byte)(color.B); // B
|
|
||||||
msg[7] = (byte)speed; // aura.speed as u8;
|
|
||||||
msg[8] = 0; // aura.direction as u8;
|
|
||||||
msg[10] = (byte)(color2.R); // R
|
|
||||||
msg[11] = (byte)(color2.G); // G
|
|
||||||
msg[12] = (byte)(color2.B); // B
|
|
||||||
return msg;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
|
|
||||||
Logger.WriteLine("USB-KB = " + BitConverter.ToString(msg));
|
|
||||||
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
|
|
||||||
Logger.WriteLine("USB-KB = " + BitConverter.ToString(msg));
|
|
||||||
|
|
||||||
if (Program.config.ContainsModel("TUF"))
|
|
||||||
Program.wmi.TUFKeyboardPower(awake, boot, sleep, shutdown);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void ApplyAura()
|
|
||||||
{
|
|
||||||
|
|
||||||
HidDevice[] HidDeviceList = HidDevices.Enumerate(0x0b05, deviceIds).ToArray();
|
|
||||||
|
|
||||||
int _speed;
|
|
||||||
|
|
||||||
switch (Speed)
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
_speed = 0xeb;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
_speed = 0xf5;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
_speed = 0xe1;
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Program.config.ContainsModel("TUF"))
|
|
||||||
Program.wmi.TUFKeyboardRGB(Mode, Color1, _speed);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -92,7 +92,7 @@ public static class ControlHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
var chk = control as CheckBox;
|
var chk = control as CheckBox;
|
||||||
if (chk != null && chk.Padding.Left > 5)
|
if (chk != null && chk.Padding.Right > 5)
|
||||||
{
|
{
|
||||||
chk.BackColor = RForm.buttonSecond;
|
chk.BackColor = RForm.buttonSecond;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,11 +30,6 @@ namespace CustomControls
|
|||||||
|
|
||||||
public bool darkTheme = false;
|
public bool darkTheme = false;
|
||||||
|
|
||||||
public RForm()
|
|
||||||
{
|
|
||||||
DoubleBuffered = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void InitColors(bool darkTheme)
|
public static void InitColors(bool darkTheme)
|
||||||
{
|
{
|
||||||
if (darkTheme)
|
if (darkTheme)
|
||||||
|
|||||||
773
app/Extra.Designer.cs
generated
773
app/Extra.Designer.cs
generated
@@ -32,194 +32,357 @@ namespace GHelper
|
|||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
groupBindings = new GroupBox();
|
groupBindings = new GroupBox();
|
||||||
pictureHelp = new PictureBox();
|
tableKeys = new TableLayoutPanel();
|
||||||
textFNF4 = new TextBox();
|
textM2 = new TextBox();
|
||||||
comboFNF4 = new RComboBox();
|
textM1 = new TextBox();
|
||||||
|
comboM1 = new RComboBox();
|
||||||
|
labelM1 = new Label();
|
||||||
labelFNF4 = new Label();
|
labelFNF4 = new Label();
|
||||||
|
comboFNF4 = new RComboBox();
|
||||||
|
comboM4 = new RComboBox();
|
||||||
|
comboM3 = new RComboBox();
|
||||||
|
textFNF4 = new TextBox();
|
||||||
textM4 = new TextBox();
|
textM4 = new TextBox();
|
||||||
textM3 = new TextBox();
|
textM3 = new TextBox();
|
||||||
comboM4 = new RComboBox();
|
|
||||||
labelM4 = new Label();
|
labelM4 = new Label();
|
||||||
comboM3 = new RComboBox();
|
|
||||||
labelM3 = new Label();
|
labelM3 = new Label();
|
||||||
|
labelM2 = new Label();
|
||||||
|
comboM2 = new RComboBox();
|
||||||
|
pictureHelp = new PictureBox();
|
||||||
groupLight = new GroupBox();
|
groupLight = new GroupBox();
|
||||||
|
panelBacklightExtra = new Panel();
|
||||||
|
numericBacklightPluggedTime = new NumericUpDown();
|
||||||
|
labelBacklightTimeoutPlugged = new Label();
|
||||||
|
numericBacklightTime = new NumericUpDown();
|
||||||
|
labelBacklightTimeout = new Label();
|
||||||
labelBrightness = new Label();
|
labelBrightness = new Label();
|
||||||
trackBrightness = new TrackBar();
|
trackBrightness = new TrackBar();
|
||||||
labelSpeed = new Label();
|
labelSpeed = new Label();
|
||||||
comboKeyboardSpeed = new RComboBox();
|
comboKeyboardSpeed = new RComboBox();
|
||||||
checkShutdown = new CheckBox();
|
panelXMG = new Panel();
|
||||||
checkSleep = new CheckBox();
|
checkXMG = new CheckBox();
|
||||||
checkBoot = new CheckBox();
|
tableBacklight = new TableLayoutPanel();
|
||||||
|
labelBacklight = new Label();
|
||||||
checkAwake = new CheckBox();
|
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();
|
groupOther = new GroupBox();
|
||||||
|
checkGpuApps = new CheckBox();
|
||||||
|
checkAutoApplyWindowsPowerMode = new CheckBox();
|
||||||
|
checkKeyboardAuto = new CheckBox();
|
||||||
checkUSBC = new CheckBox();
|
checkUSBC = new CheckBox();
|
||||||
checkNoOverdrive = new CheckBox();
|
checkNoOverdrive = new CheckBox();
|
||||||
checkKeyboardAuto = new CheckBox();
|
|
||||||
checkTopmost = new CheckBox();
|
checkTopmost = new CheckBox();
|
||||||
groupBindings.SuspendLayout();
|
groupBindings.SuspendLayout();
|
||||||
|
tableKeys.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)pictureHelp).BeginInit();
|
((System.ComponentModel.ISupportInitialize)pictureHelp).BeginInit();
|
||||||
groupLight.SuspendLayout();
|
groupLight.SuspendLayout();
|
||||||
|
panelBacklightExtra.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericBacklightPluggedTime).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericBacklightTime).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)trackBrightness).BeginInit();
|
((System.ComponentModel.ISupportInitialize)trackBrightness).BeginInit();
|
||||||
|
panelXMG.SuspendLayout();
|
||||||
|
tableBacklight.SuspendLayout();
|
||||||
groupOther.SuspendLayout();
|
groupOther.SuspendLayout();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// groupBindings
|
// groupBindings
|
||||||
//
|
//
|
||||||
|
groupBindings.Controls.Add(tableKeys);
|
||||||
groupBindings.Controls.Add(pictureHelp);
|
groupBindings.Controls.Add(pictureHelp);
|
||||||
groupBindings.Controls.Add(textFNF4);
|
|
||||||
groupBindings.Controls.Add(comboFNF4);
|
|
||||||
groupBindings.Controls.Add(labelFNF4);
|
|
||||||
groupBindings.Controls.Add(textM4);
|
|
||||||
groupBindings.Controls.Add(textM3);
|
|
||||||
groupBindings.Controls.Add(comboM4);
|
|
||||||
groupBindings.Controls.Add(labelM4);
|
|
||||||
groupBindings.Controls.Add(comboM3);
|
|
||||||
groupBindings.Controls.Add(labelM3);
|
|
||||||
groupBindings.Dock = DockStyle.Top;
|
groupBindings.Dock = DockStyle.Top;
|
||||||
groupBindings.Location = new Point(10, 10);
|
groupBindings.Location = new Point(10, 10);
|
||||||
groupBindings.Name = "groupBindings";
|
groupBindings.Name = "groupBindings";
|
||||||
groupBindings.Size = new Size(844, 242);
|
groupBindings.Size = new Size(954, 324);
|
||||||
groupBindings.TabIndex = 0;
|
groupBindings.TabIndex = 0;
|
||||||
groupBindings.TabStop = false;
|
groupBindings.TabStop = false;
|
||||||
groupBindings.Text = "Key Bindings";
|
groupBindings.Text = "Key Bindings";
|
||||||
//
|
//
|
||||||
// pictureHelp
|
// tableKeys
|
||||||
//
|
//
|
||||||
pictureHelp.BackgroundImage = Resources.icons8_help_64;
|
tableKeys.ColumnCount = 3;
|
||||||
pictureHelp.BackgroundImageLayout = ImageLayout.Zoom;
|
tableKeys.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 20F));
|
||||||
pictureHelp.Cursor = Cursors.Hand;
|
tableKeys.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 40F));
|
||||||
pictureHelp.Location = new Point(744, 57);
|
tableKeys.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 40F));
|
||||||
pictureHelp.Name = "pictureHelp";
|
tableKeys.Controls.Add(textM2, 2, 1);
|
||||||
pictureHelp.Size = new Size(32, 32);
|
tableKeys.Controls.Add(textM1, 2, 0);
|
||||||
pictureHelp.TabIndex = 9;
|
tableKeys.Controls.Add(comboM1, 1, 0);
|
||||||
pictureHelp.TabStop = false;
|
tableKeys.Controls.Add(labelM1, 0, 0);
|
||||||
|
tableKeys.Controls.Add(labelFNF4, 0, 4);
|
||||||
|
tableKeys.Controls.Add(comboFNF4, 1, 4);
|
||||||
|
tableKeys.Controls.Add(comboM4, 1, 3);
|
||||||
|
tableKeys.Controls.Add(comboM3, 1, 2);
|
||||||
|
tableKeys.Controls.Add(textFNF4, 2, 4);
|
||||||
|
tableKeys.Controls.Add(textM4, 2, 3);
|
||||||
|
tableKeys.Controls.Add(textM3, 2, 2);
|
||||||
|
tableKeys.Controls.Add(labelM4, 0, 3);
|
||||||
|
tableKeys.Controls.Add(labelM3, 0, 2);
|
||||||
|
tableKeys.Controls.Add(labelM2, 0, 1);
|
||||||
|
tableKeys.Controls.Add(comboM2, 1, 1);
|
||||||
|
tableKeys.Location = new Point(13, 38);
|
||||||
|
tableKeys.Name = "tableKeys";
|
||||||
|
tableKeys.Padding = new Padding(10);
|
||||||
|
tableKeys.RowCount = 5;
|
||||||
|
tableKeys.RowStyles.Add(new RowStyle(SizeType.Absolute, 50F));
|
||||||
|
tableKeys.RowStyles.Add(new RowStyle(SizeType.Absolute, 50F));
|
||||||
|
tableKeys.RowStyles.Add(new RowStyle(SizeType.Absolute, 50F));
|
||||||
|
tableKeys.RowStyles.Add(new RowStyle(SizeType.Absolute, 50F));
|
||||||
|
tableKeys.RowStyles.Add(new RowStyle(SizeType.Absolute, 50F));
|
||||||
|
tableKeys.Size = new Size(897, 266);
|
||||||
|
tableKeys.TabIndex = 10;
|
||||||
//
|
//
|
||||||
// textFNF4
|
// textM2
|
||||||
//
|
//
|
||||||
textFNF4.Location = new Point(415, 176);
|
textM2.Location = new Point(538, 63);
|
||||||
textFNF4.Name = "textFNF4";
|
textM2.Name = "textM2";
|
||||||
textFNF4.PlaceholderText = "action";
|
textM2.PlaceholderText = "action";
|
||||||
textFNF4.Size = new Size(320, 39);
|
textM2.Size = new Size(346, 39);
|
||||||
textFNF4.TabIndex = 8;
|
textM2.TabIndex = 14;
|
||||||
|
//
|
||||||
|
// textM1
|
||||||
|
//
|
||||||
|
textM1.Location = new Point(538, 13);
|
||||||
|
textM1.Name = "textM1";
|
||||||
|
textM1.PlaceholderText = "action";
|
||||||
|
textM1.Size = new Size(346, 39);
|
||||||
|
textM1.TabIndex = 13;
|
||||||
|
//
|
||||||
|
// comboM1
|
||||||
|
//
|
||||||
|
comboM1.BorderColor = Color.White;
|
||||||
|
comboM1.ButtonColor = Color.FromArgb(255, 255, 255);
|
||||||
|
comboM1.FormattingEnabled = true;
|
||||||
|
comboM1.Items.AddRange(new object[] { Strings.Default, Strings.VolumeMute, Strings.PlayPause, Strings.PrintScreen, Strings.ToggleAura, Strings.Custom });
|
||||||
|
comboM1.Location = new Point(188, 13);
|
||||||
|
comboM1.Name = "comboM1";
|
||||||
|
comboM1.Size = new Size(312, 40);
|
||||||
|
comboM1.TabIndex = 11;
|
||||||
|
//
|
||||||
|
// labelM1
|
||||||
|
//
|
||||||
|
labelM1.AutoSize = true;
|
||||||
|
labelM1.Location = new Point(13, 10);
|
||||||
|
labelM1.Name = "labelM1";
|
||||||
|
labelM1.Size = new Size(54, 32);
|
||||||
|
labelM1.TabIndex = 9;
|
||||||
|
labelM1.Text = "M1:";
|
||||||
|
//
|
||||||
|
// labelFNF4
|
||||||
|
//
|
||||||
|
labelFNF4.AutoSize = true;
|
||||||
|
labelFNF4.Location = new Point(13, 210);
|
||||||
|
labelFNF4.Name = "labelFNF4";
|
||||||
|
labelFNF4.Size = new Size(90, 32);
|
||||||
|
labelFNF4.TabIndex = 6;
|
||||||
|
labelFNF4.Text = "FN+F4:";
|
||||||
//
|
//
|
||||||
// comboFNF4
|
// comboFNF4
|
||||||
//
|
//
|
||||||
comboFNF4.BorderColor = Color.White;
|
comboFNF4.BorderColor = Color.White;
|
||||||
comboFNF4.ButtonColor = Color.FromArgb(255, 255, 255);
|
comboFNF4.ButtonColor = Color.FromArgb(255, 255, 255);
|
||||||
comboFNF4.FormattingEnabled = true;
|
comboFNF4.FormattingEnabled = true;
|
||||||
comboFNF4.Location = new Point(93, 175);
|
comboFNF4.Location = new Point(188, 213);
|
||||||
comboFNF4.Name = "comboFNF4";
|
comboFNF4.Name = "comboFNF4";
|
||||||
comboFNF4.Size = new Size(312, 40);
|
comboFNF4.Size = new Size(312, 40);
|
||||||
comboFNF4.TabIndex = 7;
|
comboFNF4.TabIndex = 7;
|
||||||
//
|
//
|
||||||
// labelFNF4
|
|
||||||
//
|
|
||||||
labelFNF4.AutoSize = true;
|
|
||||||
labelFNF4.Location = new Point(2, 178);
|
|
||||||
labelFNF4.Name = "labelFNF4";
|
|
||||||
labelFNF4.Size = new Size(90, 32);
|
|
||||||
labelFNF4.TabIndex = 6;
|
|
||||||
labelFNF4.Text = "FN+F4:";
|
|
||||||
//
|
|
||||||
// textM4
|
|
||||||
//
|
|
||||||
textM4.Location = new Point(415, 113);
|
|
||||||
textM4.Name = "textM4";
|
|
||||||
textM4.PlaceholderText = "action";
|
|
||||||
textM4.Size = new Size(320, 39);
|
|
||||||
textM4.TabIndex = 5;
|
|
||||||
//
|
|
||||||
// textM3
|
|
||||||
//
|
|
||||||
textM3.Location = new Point(415, 54);
|
|
||||||
textM3.Name = "textM3";
|
|
||||||
textM3.PlaceholderText = "notepad /p \"file.txt\"";
|
|
||||||
textM3.Size = new Size(320, 39);
|
|
||||||
textM3.TabIndex = 4;
|
|
||||||
//
|
|
||||||
// comboM4
|
// comboM4
|
||||||
//
|
//
|
||||||
comboM4.BorderColor = Color.White;
|
comboM4.BorderColor = Color.White;
|
||||||
comboM4.ButtonColor = Color.FromArgb(255, 255, 255);
|
comboM4.ButtonColor = Color.FromArgb(255, 255, 255);
|
||||||
comboM4.FormattingEnabled = true;
|
comboM4.FormattingEnabled = true;
|
||||||
comboM4.Items.AddRange(new object[] { Strings.PerformanceMode, Strings.OpenGHelper, Strings.Custom });
|
comboM4.Items.AddRange(new object[] { Strings.PerformanceMode, Strings.OpenGHelper, Strings.Custom });
|
||||||
comboM4.Location = new Point(93, 112);
|
comboM4.Location = new Point(188, 163);
|
||||||
comboM4.Name = "comboM4";
|
comboM4.Name = "comboM4";
|
||||||
comboM4.Size = new Size(312, 40);
|
comboM4.Size = new Size(312, 40);
|
||||||
comboM4.TabIndex = 3;
|
comboM4.TabIndex = 3;
|
||||||
//
|
//
|
||||||
// labelM4
|
|
||||||
//
|
|
||||||
labelM4.AutoSize = true;
|
|
||||||
labelM4.Location = new Point(25, 116);
|
|
||||||
labelM4.Name = "labelM4";
|
|
||||||
labelM4.Size = new Size(54, 32);
|
|
||||||
labelM4.TabIndex = 2;
|
|
||||||
labelM4.Text = "M4:";
|
|
||||||
//
|
|
||||||
// comboM3
|
// comboM3
|
||||||
//
|
//
|
||||||
comboM3.BorderColor = Color.White;
|
comboM3.BorderColor = Color.White;
|
||||||
comboM3.ButtonColor = Color.FromArgb(255, 255, 255);
|
comboM3.ButtonColor = Color.FromArgb(255, 255, 255);
|
||||||
comboM3.FormattingEnabled = true;
|
comboM3.FormattingEnabled = true;
|
||||||
comboM3.Items.AddRange(new object[] { Strings.Default, Strings.VolumeMute, Strings.PlayPause, Strings.PrintScreen, Strings.ToggleAura, Strings.Custom });
|
comboM3.Items.AddRange(new object[] { Strings.Default, Strings.VolumeMute, Strings.PlayPause, Strings.PrintScreen, Strings.ToggleAura, Strings.Custom });
|
||||||
comboM3.Location = new Point(93, 54);
|
comboM3.Location = new Point(188, 113);
|
||||||
comboM3.Name = "comboM3";
|
comboM3.Name = "comboM3";
|
||||||
comboM3.Size = new Size(312, 40);
|
comboM3.Size = new Size(312, 40);
|
||||||
comboM3.TabIndex = 1;
|
comboM3.TabIndex = 1;
|
||||||
//
|
//
|
||||||
|
// textFNF4
|
||||||
|
//
|
||||||
|
textFNF4.Location = new Point(538, 213);
|
||||||
|
textFNF4.Name = "textFNF4";
|
||||||
|
textFNF4.PlaceholderText = "action";
|
||||||
|
textFNF4.Size = new Size(346, 39);
|
||||||
|
textFNF4.TabIndex = 8;
|
||||||
|
//
|
||||||
|
// textM4
|
||||||
|
//
|
||||||
|
textM4.Location = new Point(538, 163);
|
||||||
|
textM4.Name = "textM4";
|
||||||
|
textM4.PlaceholderText = "action";
|
||||||
|
textM4.Size = new Size(346, 39);
|
||||||
|
textM4.TabIndex = 5;
|
||||||
|
//
|
||||||
|
// textM3
|
||||||
|
//
|
||||||
|
textM3.Location = new Point(538, 113);
|
||||||
|
textM3.Name = "textM3";
|
||||||
|
textM3.PlaceholderText = "action";
|
||||||
|
textM3.Size = new Size(346, 39);
|
||||||
|
textM3.TabIndex = 4;
|
||||||
|
//
|
||||||
|
// labelM4
|
||||||
|
//
|
||||||
|
labelM4.AutoSize = true;
|
||||||
|
labelM4.Location = new Point(13, 160);
|
||||||
|
labelM4.Name = "labelM4";
|
||||||
|
labelM4.Size = new Size(54, 32);
|
||||||
|
labelM4.TabIndex = 2;
|
||||||
|
labelM4.Text = "M4:";
|
||||||
|
//
|
||||||
// labelM3
|
// labelM3
|
||||||
//
|
//
|
||||||
labelM3.AutoSize = true;
|
labelM3.AutoSize = true;
|
||||||
labelM3.Location = new Point(25, 58);
|
labelM3.Location = new Point(13, 110);
|
||||||
labelM3.Name = "labelM3";
|
labelM3.Name = "labelM3";
|
||||||
labelM3.Size = new Size(54, 32);
|
labelM3.Size = new Size(54, 32);
|
||||||
labelM3.TabIndex = 0;
|
labelM3.TabIndex = 0;
|
||||||
labelM3.Text = "M3:";
|
labelM3.Text = "M3:";
|
||||||
//
|
//
|
||||||
|
// labelM2
|
||||||
|
//
|
||||||
|
labelM2.AutoSize = true;
|
||||||
|
labelM2.Location = new Point(13, 60);
|
||||||
|
labelM2.Name = "labelM2";
|
||||||
|
labelM2.Size = new Size(54, 32);
|
||||||
|
labelM2.TabIndex = 10;
|
||||||
|
labelM2.Text = "M2:";
|
||||||
|
//
|
||||||
|
// comboM2
|
||||||
|
//
|
||||||
|
comboM2.BorderColor = Color.White;
|
||||||
|
comboM2.ButtonColor = Color.FromArgb(255, 255, 255);
|
||||||
|
comboM2.FormattingEnabled = true;
|
||||||
|
comboM2.Items.AddRange(new object[] { Strings.Default, Strings.VolumeMute, Strings.PlayPause, Strings.PrintScreen, Strings.ToggleAura, Strings.Custom });
|
||||||
|
comboM2.Location = new Point(188, 63);
|
||||||
|
comboM2.Name = "comboM2";
|
||||||
|
comboM2.Size = new Size(312, 40);
|
||||||
|
comboM2.TabIndex = 12;
|
||||||
|
//
|
||||||
|
// pictureHelp
|
||||||
|
//
|
||||||
|
pictureHelp.BackgroundImage = Resources.icons8_help_64;
|
||||||
|
pictureHelp.BackgroundImageLayout = ImageLayout.Zoom;
|
||||||
|
pictureHelp.Cursor = Cursors.Hand;
|
||||||
|
pictureHelp.Location = new Point(906, 51);
|
||||||
|
pictureHelp.Name = "pictureHelp";
|
||||||
|
pictureHelp.Size = new Size(32, 32);
|
||||||
|
pictureHelp.TabIndex = 9;
|
||||||
|
pictureHelp.TabStop = false;
|
||||||
|
//
|
||||||
// groupLight
|
// groupLight
|
||||||
//
|
//
|
||||||
groupLight.Controls.Add(labelBrightness);
|
groupLight.AutoSize = true;
|
||||||
groupLight.Controls.Add(trackBrightness);
|
groupLight.Controls.Add(panelBacklightExtra);
|
||||||
groupLight.Controls.Add(labelSpeed);
|
groupLight.Controls.Add(panelXMG);
|
||||||
groupLight.Controls.Add(comboKeyboardSpeed);
|
groupLight.Controls.Add(tableBacklight);
|
||||||
groupLight.Controls.Add(checkShutdown);
|
|
||||||
groupLight.Controls.Add(checkSleep);
|
|
||||||
groupLight.Controls.Add(checkBoot);
|
|
||||||
groupLight.Controls.Add(checkAwake);
|
|
||||||
groupLight.Dock = DockStyle.Top;
|
groupLight.Dock = DockStyle.Top;
|
||||||
groupLight.Location = new Point(10, 252);
|
groupLight.Location = new Point(10, 334);
|
||||||
groupLight.Name = "groupLight";
|
groupLight.Name = "groupLight";
|
||||||
groupLight.Size = new Size(844, 395);
|
groupLight.Size = new Size(954, 563);
|
||||||
groupLight.TabIndex = 1;
|
groupLight.TabIndex = 1;
|
||||||
groupLight.TabStop = false;
|
groupLight.TabStop = false;
|
||||||
groupLight.Text = "Keyboard Backlight";
|
groupLight.Text = "Keyboard Backlight";
|
||||||
//
|
//
|
||||||
|
// panelBacklightExtra
|
||||||
|
//
|
||||||
|
panelBacklightExtra.Controls.Add(numericBacklightPluggedTime);
|
||||||
|
panelBacklightExtra.Controls.Add(labelBacklightTimeoutPlugged);
|
||||||
|
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, 241);
|
||||||
|
panelBacklightExtra.TabIndex = 43;
|
||||||
|
//
|
||||||
|
// numericBacklightPluggedTime
|
||||||
|
//
|
||||||
|
numericBacklightPluggedTime.Location = new Point(655, 181);
|
||||||
|
numericBacklightPluggedTime.Maximum = new decimal(new int[] { 3600, 0, 0, 0 });
|
||||||
|
numericBacklightPluggedTime.Name = "numericBacklightPluggedTime";
|
||||||
|
numericBacklightPluggedTime.Size = new Size(240, 39);
|
||||||
|
numericBacklightPluggedTime.TabIndex = 49;
|
||||||
|
//
|
||||||
|
// labelBacklightTimeoutPlugged
|
||||||
|
//
|
||||||
|
labelBacklightTimeoutPlugged.Location = new Point(13, 183);
|
||||||
|
labelBacklightTimeoutPlugged.Name = "labelBacklightTimeoutPlugged";
|
||||||
|
labelBacklightTimeoutPlugged.Size = new Size(636, 45);
|
||||||
|
labelBacklightTimeoutPlugged.TabIndex = 48;
|
||||||
|
labelBacklightTimeoutPlugged.Text = "Seconds to turn off backlight when plugged";
|
||||||
|
//
|
||||||
|
// 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
|
||||||
//
|
//
|
||||||
labelBrightness.Location = new Point(25, 304);
|
labelBrightness.Location = new Point(13, 75);
|
||||||
labelBrightness.Name = "labelBrightness";
|
labelBrightness.Name = "labelBrightness";
|
||||||
labelBrightness.Size = new Size(197, 49);
|
labelBrightness.Size = new Size(336, 43);
|
||||||
labelBrightness.TabIndex = 0;
|
labelBrightness.TabIndex = 41;
|
||||||
labelBrightness.Text = "Brightness";
|
labelBrightness.Text = "Brightness";
|
||||||
//
|
//
|
||||||
// trackBrightness
|
// trackBrightness
|
||||||
//
|
//
|
||||||
trackBrightness.Location = new Point(228, 294);
|
trackBrightness.LargeChange = 1;
|
||||||
|
trackBrightness.Location = new Point(355, 60);
|
||||||
trackBrightness.Maximum = 3;
|
trackBrightness.Maximum = 3;
|
||||||
trackBrightness.Name = "trackBrightness";
|
trackBrightness.Name = "trackBrightness";
|
||||||
trackBrightness.Size = new Size(600, 90);
|
trackBrightness.Size = new Size(558, 90);
|
||||||
trackBrightness.TabIndex = 1;
|
trackBrightness.TabIndex = 42;
|
||||||
trackBrightness.TickStyle = TickStyle.TopLeft;
|
trackBrightness.TickStyle = TickStyle.TopLeft;
|
||||||
//
|
//
|
||||||
// labelSpeed
|
// labelSpeed
|
||||||
//
|
//
|
||||||
labelSpeed.AutoSize = true;
|
labelSpeed.Location = new Point(13, 15);
|
||||||
labelSpeed.Location = new Point(25, 235);
|
|
||||||
labelSpeed.MaximumSize = new Size(200, 0);
|
|
||||||
labelSpeed.Name = "labelSpeed";
|
labelSpeed.Name = "labelSpeed";
|
||||||
labelSpeed.Size = new Size(198, 32);
|
labelSpeed.Size = new Size(538, 40);
|
||||||
labelSpeed.TabIndex = 40;
|
labelSpeed.TabIndex = 44;
|
||||||
labelSpeed.Text = "Animation Speed";
|
labelSpeed.Text = "Animation Speed";
|
||||||
//
|
//
|
||||||
// comboKeyboardSpeed
|
// comboKeyboardSpeed
|
||||||
@@ -231,71 +394,345 @@ namespace GHelper
|
|||||||
comboKeyboardSpeed.FormattingEnabled = true;
|
comboKeyboardSpeed.FormattingEnabled = true;
|
||||||
comboKeyboardSpeed.ItemHeight = 32;
|
comboKeyboardSpeed.ItemHeight = 32;
|
||||||
comboKeyboardSpeed.Items.AddRange(new object[] { "Slow", "Normal", "Fast" });
|
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.Margin = new Padding(4, 10, 4, 8);
|
||||||
comboKeyboardSpeed.Name = "comboKeyboardSpeed";
|
comboKeyboardSpeed.Name = "comboKeyboardSpeed";
|
||||||
comboKeyboardSpeed.Size = new Size(291, 40);
|
comboKeyboardSpeed.Size = new Size(291, 40);
|
||||||
comboKeyboardSpeed.TabIndex = 39;
|
comboKeyboardSpeed.TabIndex = 43;
|
||||||
comboKeyboardSpeed.TabStop = false;
|
comboKeyboardSpeed.TabStop = false;
|
||||||
//
|
//
|
||||||
// checkShutdown
|
// panelXMG
|
||||||
//
|
//
|
||||||
checkShutdown.AutoSize = true;
|
panelXMG.Controls.Add(checkXMG);
|
||||||
checkShutdown.Location = new Point(25, 185);
|
panelXMG.Dock = DockStyle.Top;
|
||||||
checkShutdown.Name = "checkShutdown";
|
panelXMG.Location = new Point(3, 261);
|
||||||
checkShutdown.Size = new Size(154, 36);
|
panelXMG.Name = "panelXMG";
|
||||||
checkShutdown.TabIndex = 3;
|
panelXMG.Size = new Size(948, 58);
|
||||||
checkShutdown.Text = Strings.Shutdown;
|
panelXMG.TabIndex = 42;
|
||||||
checkShutdown.UseVisualStyleBackColor = true;
|
|
||||||
//
|
//
|
||||||
// checkSleep
|
// checkXMG
|
||||||
//
|
//
|
||||||
checkSleep.AutoSize = true;
|
checkXMG.AutoSize = true;
|
||||||
checkSleep.Location = new Point(25, 143);
|
checkXMG.Location = new Point(3, 10);
|
||||||
checkSleep.Name = "checkSleep";
|
checkXMG.Name = "checkXMG";
|
||||||
checkSleep.Size = new Size(105, 36);
|
checkXMG.Padding = new Padding(15, 2, 5, 2);
|
||||||
checkSleep.TabIndex = 2;
|
checkXMG.Size = new Size(178, 40);
|
||||||
checkSleep.Text = Strings.Sleep;
|
checkXMG.TabIndex = 2;
|
||||||
checkSleep.UseVisualStyleBackColor = true;
|
checkXMG.Text = "XG Mobile";
|
||||||
|
checkXMG.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
// checkBoot
|
// tableBacklight
|
||||||
//
|
//
|
||||||
checkBoot.AutoSize = true;
|
tableBacklight.AutoSize = true;
|
||||||
checkBoot.Location = new Point(25, 101);
|
tableBacklight.ColumnCount = 4;
|
||||||
checkBoot.Name = "checkBoot";
|
tableBacklight.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
||||||
checkBoot.Size = new Size(96, 36);
|
tableBacklight.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
||||||
checkBoot.TabIndex = 1;
|
tableBacklight.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
||||||
checkBoot.Text = Strings.Boot;
|
tableBacklight.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
||||||
checkBoot.UseVisualStyleBackColor = true;
|
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
|
||||||
//
|
//
|
||||||
checkAwake.AutoSize = true;
|
checkAwake.Dock = DockStyle.Fill;
|
||||||
checkAwake.Location = new Point(25, 59);
|
checkAwake.Location = new Point(3, 45);
|
||||||
checkAwake.Name = "checkAwake";
|
checkAwake.Name = "checkAwake";
|
||||||
checkAwake.Size = new Size(115, 36);
|
checkAwake.Padding = new Padding(15, 2, 5, 2);
|
||||||
checkAwake.TabIndex = 0;
|
checkAwake.Size = new Size(231, 40);
|
||||||
|
checkAwake.TabIndex = 1;
|
||||||
checkAwake.Text = Strings.Awake;
|
checkAwake.Text = Strings.Awake;
|
||||||
checkAwake.UseVisualStyleBackColor = true;
|
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
|
||||||
//
|
//
|
||||||
|
groupOther.Controls.Add(checkGpuApps);
|
||||||
|
groupOther.Controls.Add(checkAutoApplyWindowsPowerMode);
|
||||||
|
groupOther.Controls.Add(checkKeyboardAuto);
|
||||||
groupOther.Controls.Add(checkUSBC);
|
groupOther.Controls.Add(checkUSBC);
|
||||||
groupOther.Controls.Add(checkNoOverdrive);
|
groupOther.Controls.Add(checkNoOverdrive);
|
||||||
groupOther.Controls.Add(checkKeyboardAuto);
|
|
||||||
groupOther.Controls.Add(checkTopmost);
|
groupOther.Controls.Add(checkTopmost);
|
||||||
groupOther.Dock = DockStyle.Top;
|
groupOther.Dock = DockStyle.Top;
|
||||||
groupOther.Location = new Point(10, 647);
|
groupOther.Location = new Point(10, 897);
|
||||||
groupOther.Name = "groupOther";
|
groupOther.Name = "groupOther";
|
||||||
groupOther.Size = new Size(844, 293);
|
groupOther.Size = new Size(954, 310);
|
||||||
groupOther.TabIndex = 2;
|
groupOther.TabIndex = 2;
|
||||||
groupOther.TabStop = false;
|
groupOther.TabStop = false;
|
||||||
groupOther.Text = "Other";
|
groupOther.Text = "Other";
|
||||||
//
|
//
|
||||||
|
// checkGpuApps
|
||||||
|
//
|
||||||
|
checkGpuApps.AutoSize = true;
|
||||||
|
checkGpuApps.Location = new Point(25, 220);
|
||||||
|
checkGpuApps.Name = "checkGpuApps";
|
||||||
|
checkGpuApps.Size = new Size(544, 36);
|
||||||
|
checkGpuApps.TabIndex = 48;
|
||||||
|
checkGpuApps.Text = "Stop all apps using GPU when switching to Eco";
|
||||||
|
checkGpuApps.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// checkAutoApplyWindowsPowerMode
|
||||||
|
//
|
||||||
|
checkAutoApplyWindowsPowerMode.AutoSize = true;
|
||||||
|
checkAutoApplyWindowsPowerMode.Location = new Point(25, 268);
|
||||||
|
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
|
||||||
//
|
//
|
||||||
checkUSBC.AutoSize = true;
|
checkUSBC.AutoSize = true;
|
||||||
checkUSBC.Location = new Point(25, 210);
|
checkUSBC.Location = new Point(25, 85);
|
||||||
checkUSBC.Name = "checkUSBC";
|
checkUSBC.Name = "checkUSBC";
|
||||||
checkUSBC.Size = new Size(659, 36);
|
checkUSBC.Size = new Size(659, 36);
|
||||||
checkUSBC.TabIndex = 4;
|
checkUSBC.TabIndex = 4;
|
||||||
@@ -305,28 +742,17 @@ namespace GHelper
|
|||||||
// checkNoOverdrive
|
// checkNoOverdrive
|
||||||
//
|
//
|
||||||
checkNoOverdrive.AutoSize = true;
|
checkNoOverdrive.AutoSize = true;
|
||||||
checkNoOverdrive.Location = new Point(25, 156);
|
checkNoOverdrive.Location = new Point(25, 130);
|
||||||
checkNoOverdrive.Name = "checkNoOverdrive";
|
checkNoOverdrive.Name = "checkNoOverdrive";
|
||||||
checkNoOverdrive.Size = new Size(307, 36);
|
checkNoOverdrive.Size = new Size(307, 36);
|
||||||
checkNoOverdrive.TabIndex = 3;
|
checkNoOverdrive.TabIndex = 3;
|
||||||
checkNoOverdrive.Text = Strings.DisableOverdrive;
|
checkNoOverdrive.Text = Strings.DisableOverdrive;
|
||||||
checkNoOverdrive.UseVisualStyleBackColor = true;
|
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
|
||||||
//
|
//
|
||||||
checkTopmost.AutoSize = true;
|
checkTopmost.AutoSize = true;
|
||||||
checkTopmost.Location = new Point(25, 104);
|
checkTopmost.Location = new Point(25, 175);
|
||||||
checkTopmost.Name = "checkTopmost";
|
checkTopmost.Name = "checkTopmost";
|
||||||
checkTopmost.Size = new Size(390, 36);
|
checkTopmost.Size = new Size(390, 36);
|
||||||
checkTopmost.TabIndex = 1;
|
checkTopmost.TabIndex = 1;
|
||||||
@@ -337,7 +763,9 @@ namespace GHelper
|
|||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(13F, 32F);
|
AutoScaleDimensions = new SizeF(13F, 32F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
ClientSize = new Size(864, 953);
|
AutoSize = true;
|
||||||
|
AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||||
|
ClientSize = new Size(974, 1220);
|
||||||
Controls.Add(groupOther);
|
Controls.Add(groupOther);
|
||||||
Controls.Add(groupLight);
|
Controls.Add(groupLight);
|
||||||
Controls.Add(groupBindings);
|
Controls.Add(groupBindings);
|
||||||
@@ -345,20 +773,30 @@ namespace GHelper
|
|||||||
MaximizeBox = false;
|
MaximizeBox = false;
|
||||||
MdiChildrenMinimizedAnchorBottom = false;
|
MdiChildrenMinimizedAnchorBottom = false;
|
||||||
MinimizeBox = false;
|
MinimizeBox = false;
|
||||||
|
MinimumSize = new Size(1000, 0);
|
||||||
Name = "Extra";
|
Name = "Extra";
|
||||||
Padding = new Padding(10);
|
Padding = new Padding(10);
|
||||||
ShowIcon = false;
|
ShowIcon = false;
|
||||||
ShowInTaskbar = false;
|
ShowInTaskbar = false;
|
||||||
Text = "Extra Settings";
|
Text = "Extra Settings";
|
||||||
groupBindings.ResumeLayout(false);
|
groupBindings.ResumeLayout(false);
|
||||||
groupBindings.PerformLayout();
|
tableKeys.ResumeLayout(false);
|
||||||
|
tableKeys.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)pictureHelp).EndInit();
|
((System.ComponentModel.ISupportInitialize)pictureHelp).EndInit();
|
||||||
groupLight.ResumeLayout(false);
|
groupLight.ResumeLayout(false);
|
||||||
groupLight.PerformLayout();
|
groupLight.PerformLayout();
|
||||||
|
panelBacklightExtra.ResumeLayout(false);
|
||||||
|
panelBacklightExtra.PerformLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericBacklightPluggedTime).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericBacklightTime).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)trackBrightness).EndInit();
|
((System.ComponentModel.ISupportInitialize)trackBrightness).EndInit();
|
||||||
|
panelXMG.ResumeLayout(false);
|
||||||
|
panelXMG.PerformLayout();
|
||||||
|
tableBacklight.ResumeLayout(false);
|
||||||
groupOther.ResumeLayout(false);
|
groupOther.ResumeLayout(false);
|
||||||
groupOther.PerformLayout();
|
groupOther.PerformLayout();
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@@ -374,19 +812,52 @@ namespace GHelper
|
|||||||
private RComboBox comboFNF4;
|
private RComboBox comboFNF4;
|
||||||
private Label labelFNF4;
|
private Label labelFNF4;
|
||||||
private GroupBox groupLight;
|
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 GroupBox groupOther;
|
||||||
private CheckBox checkTopmost;
|
private CheckBox checkTopmost;
|
||||||
private CheckBox checkKeyboardAuto;
|
|
||||||
private CheckBox checkNoOverdrive;
|
private CheckBox checkNoOverdrive;
|
||||||
private PictureBox pictureHelp;
|
private PictureBox pictureHelp;
|
||||||
private TrackBar trackBrightness;
|
|
||||||
private Label labelBrightness;
|
|
||||||
private CheckBox checkUSBC;
|
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;
|
||||||
|
private TableLayoutPanel tableKeys;
|
||||||
|
private Label labelM1;
|
||||||
|
private Label labelM2;
|
||||||
|
private RComboBox comboM1;
|
||||||
|
private RComboBox comboM2;
|
||||||
|
private TextBox textM2;
|
||||||
|
private TextBox textM1;
|
||||||
|
private NumericUpDown numericBacklightPluggedTime;
|
||||||
|
private Label labelBacklightTimeoutPlugged;
|
||||||
|
private CheckBox checkGpuApps;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
240
app/Extra.cs
240
app/Extra.cs
@@ -21,13 +21,25 @@ namespace GHelper
|
|||||||
|
|
||||||
private void SetKeyCombo(ComboBox combo, TextBox txbox, string name)
|
private void SetKeyCombo(ComboBox combo, TextBox txbox, string name)
|
||||||
{
|
{
|
||||||
if (name == "m4")
|
|
||||||
customActions[""] = Properties.Strings.OpenGHelper;
|
|
||||||
|
|
||||||
if (name == "fnf4")
|
switch (name)
|
||||||
{
|
{
|
||||||
customActions[""] = Properties.Strings.ToggleAura;
|
case "m1":
|
||||||
customActions.Remove("aura");
|
customActions[""] = Properties.Strings.VolumeDown;
|
||||||
|
break;
|
||||||
|
case "m2":
|
||||||
|
customActions[""] = Properties.Strings.VolumeUp;
|
||||||
|
break;
|
||||||
|
case "m3":
|
||||||
|
customActions[""] = Properties.Strings.MuteMic;
|
||||||
|
break;
|
||||||
|
case "m4":
|
||||||
|
customActions[""] = Properties.Strings.OpenGHelper;
|
||||||
|
break;
|
||||||
|
case "fnf4":
|
||||||
|
customActions[""] = Properties.Strings.ToggleAura;
|
||||||
|
customActions.Remove("aura");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
combo.DropDownStyle = ComboBoxStyle.DropDownList;
|
combo.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
@@ -35,7 +47,7 @@ namespace GHelper
|
|||||||
combo.DisplayMember = "Value";
|
combo.DisplayMember = "Value";
|
||||||
combo.ValueMember = "Key";
|
combo.ValueMember = "Key";
|
||||||
|
|
||||||
string action = Program.config.getConfigString(name);
|
string action = AppConfig.getConfigString(name);
|
||||||
|
|
||||||
combo.SelectedValue = (action is not null) ? action : "";
|
combo.SelectedValue = (action is not null) ? action : "";
|
||||||
if (combo.SelectedValue is null) combo.SelectedValue = "";
|
if (combo.SelectedValue is null) combo.SelectedValue = "";
|
||||||
@@ -43,13 +55,17 @@ namespace GHelper
|
|||||||
combo.SelectedValueChanged += delegate
|
combo.SelectedValueChanged += delegate
|
||||||
{
|
{
|
||||||
if (combo.SelectedValue is not null)
|
if (combo.SelectedValue is not null)
|
||||||
Program.config.setConfig(name, combo.SelectedValue.ToString());
|
AppConfig.setConfig(name, combo.SelectedValue.ToString());
|
||||||
|
|
||||||
|
if (name == "m1" || name == "m2")
|
||||||
|
Program.inputDispatcher.RegisterKeys();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
txbox.Text = Program.config.getConfigString(name + "_custom");
|
txbox.Text = AppConfig.getConfigString(name + "_custom");
|
||||||
txbox.TextChanged += delegate
|
txbox.TextChanged += delegate
|
||||||
{
|
{
|
||||||
Program.config.setConfig(name + "_custom", txbox.Text);
|
AppConfig.setConfig(name + "_custom", txbox.Text);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +74,7 @@ namespace GHelper
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
groupBindings.Text = Properties.Strings.KeyBindings;
|
groupBindings.Text = Properties.Strings.KeyBindings;
|
||||||
groupLight.Text = Properties.Strings.KeyboardBacklight;
|
groupLight.Text = " " + Properties.Strings.LaptopBacklight;
|
||||||
groupOther.Text = Properties.Strings.Other;
|
groupOther.Text = Properties.Strings.Other;
|
||||||
|
|
||||||
checkAwake.Text = Properties.Strings.Awake;
|
checkAwake.Text = Properties.Strings.Awake;
|
||||||
@@ -69,15 +85,28 @@ namespace GHelper
|
|||||||
labelSpeed.Text = Properties.Strings.AnimationSpeed;
|
labelSpeed.Text = Properties.Strings.AnimationSpeed;
|
||||||
labelBrightness.Text = Properties.Strings.Brightness;
|
labelBrightness.Text = Properties.Strings.Brightness;
|
||||||
|
|
||||||
|
labelBacklightTimeout.Text = Properties.Strings.BacklightTimeout;
|
||||||
|
labelBacklightTimeoutPlugged.Text = Properties.Strings.BacklightTimeoutPlugged;
|
||||||
|
|
||||||
checkKeyboardAuto.Text = Properties.Strings.KeyboardAuto;
|
checkKeyboardAuto.Text = Properties.Strings.KeyboardAuto;
|
||||||
checkNoOverdrive.Text = Properties.Strings.DisableOverdrive;
|
checkNoOverdrive.Text = Properties.Strings.DisableOverdrive;
|
||||||
checkTopmost.Text = Properties.Strings.WindowTop;
|
checkTopmost.Text = Properties.Strings.WindowTop;
|
||||||
checkUSBC.Text = Properties.Strings.OptimizedUSBC;
|
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;
|
||||||
|
|
||||||
|
checkGpuApps.Text = Properties.Strings.KillGpuApps;
|
||||||
|
|
||||||
Text = Properties.Strings.ExtraSettings;
|
Text = Properties.Strings.ExtraSettings;
|
||||||
|
|
||||||
InitTheme();
|
InitTheme();
|
||||||
|
|
||||||
|
SetKeyCombo(comboM1, textM1, "m1");
|
||||||
|
SetKeyCombo(comboM2, textM2, "m2");
|
||||||
SetKeyCombo(comboM3, textM3, "m3");
|
SetKeyCombo(comboM3, textM3, "m3");
|
||||||
SetKeyCombo(comboM4, textM4, "m4");
|
SetKeyCombo(comboM4, textM4, "m4");
|
||||||
SetKeyCombo(comboFNF4, textFNF4, "fnf4");
|
SetKeyCombo(comboFNF4, textFNF4, "fnf4");
|
||||||
@@ -85,51 +114,143 @@ namespace GHelper
|
|||||||
Shown += Keyboard_Shown;
|
Shown += Keyboard_Shown;
|
||||||
|
|
||||||
comboKeyboardSpeed.DropDownStyle = ComboBoxStyle.DropDownList;
|
comboKeyboardSpeed.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
comboKeyboardSpeed.DataSource = new BindingSource(Aura.GetSpeeds(), null);
|
comboKeyboardSpeed.DataSource = new BindingSource(AsusUSB.GetSpeeds(), null);
|
||||||
comboKeyboardSpeed.DisplayMember = "Value";
|
comboKeyboardSpeed.DisplayMember = "Value";
|
||||||
comboKeyboardSpeed.ValueMember = "Key";
|
comboKeyboardSpeed.ValueMember = "Key";
|
||||||
comboKeyboardSpeed.SelectedValue = Aura.Speed;
|
comboKeyboardSpeed.SelectedValue = AsusUSB.Speed;
|
||||||
comboKeyboardSpeed.SelectedValueChanged += ComboKeyboardSpeed_SelectedValueChanged;
|
comboKeyboardSpeed.SelectedValueChanged += ComboKeyboardSpeed_SelectedValueChanged;
|
||||||
|
|
||||||
checkAwake.Checked = !(Program.config.getConfig("keyboard_awake") == 0);
|
// Keyboard
|
||||||
checkBoot.Checked = !(Program.config.getConfig("keyboard_boot") == 0);
|
checkAwake.Checked = !(AppConfig.getConfig("keyboard_awake") == 0);
|
||||||
checkSleep.Checked = !(Program.config.getConfig("keyboard_sleep") == 0);
|
checkBoot.Checked = !(AppConfig.getConfig("keyboard_boot") == 0);
|
||||||
checkShutdown.Checked = !(Program.config.getConfig("keyboard_shutdown") == 0);
|
checkSleep.Checked = !(AppConfig.getConfig("keyboard_sleep") == 0);
|
||||||
|
checkShutdown.Checked = !(AppConfig.getConfig("keyboard_shutdown") == 0);
|
||||||
|
|
||||||
|
// Lightbar
|
||||||
|
checkAwakeBar.Checked = !(AppConfig.getConfig("keyboard_awake_bar") == 0);
|
||||||
|
checkBootBar.Checked = !(AppConfig.getConfig("keyboard_boot_bar") == 0);
|
||||||
|
checkSleepBar.Checked = !(AppConfig.getConfig("keyboard_sleep_bar") == 0);
|
||||||
|
checkShutdownBar.Checked = !(AppConfig.getConfig("keyboard_shutdown_bar") == 0);
|
||||||
|
|
||||||
|
// Lid
|
||||||
|
checkAwakeLid.Checked = !(AppConfig.getConfig("keyboard_awake_lid") == 0);
|
||||||
|
checkBootLid.Checked = !(AppConfig.getConfig("keyboard_boot_lid") == 0);
|
||||||
|
checkSleepLid.Checked = !(AppConfig.getConfig("keyboard_sleep_lid") == 0);
|
||||||
|
checkShutdownLid.Checked = !(AppConfig.getConfig("keyboard_shutdown_lid") == 0);
|
||||||
|
|
||||||
|
// Logo
|
||||||
|
checkAwakeLogo.Checked = !(AppConfig.getConfig("keyboard_awake_logo") == 0);
|
||||||
|
checkBootLogo.Checked = !(AppConfig.getConfig("keyboard_boot_logo") == 0);
|
||||||
|
checkSleepLogo.Checked = !(AppConfig.getConfig("keyboard_sleep_logo") == 0);
|
||||||
|
checkShutdownLogo.Checked = !(AppConfig.getConfig("keyboard_shutdown_logo") == 0);
|
||||||
|
|
||||||
checkAwake.CheckedChanged += CheckPower_CheckedChanged;
|
checkAwake.CheckedChanged += CheckPower_CheckedChanged;
|
||||||
checkBoot.CheckedChanged += CheckPower_CheckedChanged;
|
checkBoot.CheckedChanged += CheckPower_CheckedChanged;
|
||||||
checkSleep.CheckedChanged += CheckPower_CheckedChanged;
|
checkSleep.CheckedChanged += CheckPower_CheckedChanged;
|
||||||
checkShutdown.CheckedChanged += CheckPower_CheckedChanged;
|
checkShutdown.CheckedChanged += CheckPower_CheckedChanged;
|
||||||
|
|
||||||
checkTopmost.Checked = (Program.config.getConfig("topmost") == 1);
|
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 (!AppConfig.ContainsModel("Strix"))
|
||||||
|
{
|
||||||
|
labelBacklightBar.Visible = false;
|
||||||
|
checkAwakeBar.Visible = false;
|
||||||
|
checkBootBar.Visible = false;
|
||||||
|
checkSleepBar.Visible = false;
|
||||||
|
checkShutdownBar.Visible = false;
|
||||||
|
|
||||||
|
if (!AppConfig.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 = (AppConfig.getConfig("topmost") == 1);
|
||||||
checkTopmost.CheckedChanged += CheckTopmost_CheckedChanged; ;
|
checkTopmost.CheckedChanged += CheckTopmost_CheckedChanged; ;
|
||||||
|
|
||||||
checkKeyboardAuto.Checked = (Program.config.getConfig("keyboard_auto") == 1);
|
checkKeyboardAuto.Checked = (AppConfig.getConfig("keyboard_auto") == 1);
|
||||||
checkKeyboardAuto.CheckedChanged += CheckKeyboardAuto_CheckedChanged;
|
checkKeyboardAuto.CheckedChanged += CheckKeyboardAuto_CheckedChanged;
|
||||||
|
|
||||||
checkNoOverdrive.Checked = (Program.config.getConfig("no_overdrive") == 1);
|
checkNoOverdrive.Checked = (AppConfig.getConfig("no_overdrive") == 1);
|
||||||
checkNoOverdrive.CheckedChanged += CheckNoOverdrive_CheckedChanged;
|
checkNoOverdrive.CheckedChanged += CheckNoOverdrive_CheckedChanged;
|
||||||
|
|
||||||
checkUSBC.Checked = (Program.config.getConfig("optimized_usbc") == 1);
|
checkUSBC.Checked = (AppConfig.getConfig("optimized_usbc") == 1);
|
||||||
checkUSBC.CheckedChanged += CheckUSBC_CheckedChanged;
|
checkUSBC.CheckedChanged += CheckUSBC_CheckedChanged;
|
||||||
|
|
||||||
int kb_brightness = Program.config.getConfig("keyboard_brightness");
|
checkAutoApplyWindowsPowerMode.Checked = (AppConfig.getConfig("auto_apply_power_plan") != 0);
|
||||||
|
checkAutoApplyWindowsPowerMode.CheckedChanged += checkAutoApplyWindowsPowerMode_CheckedChanged;
|
||||||
|
|
||||||
|
int kb_brightness = AppConfig.getConfig("keyboard_brightness");
|
||||||
trackBrightness.Value = (kb_brightness >= 0 && kb_brightness <= 3) ? kb_brightness : 3;
|
trackBrightness.Value = (kb_brightness >= 0 && kb_brightness <= 3) ? kb_brightness : 3;
|
||||||
|
|
||||||
pictureHelp.Click += PictureHelp_Click;
|
pictureHelp.Click += PictureHelp_Click;
|
||||||
trackBrightness.Scroll += TrackBrightness_Scroll;
|
trackBrightness.Scroll += TrackBrightness_Scroll;
|
||||||
|
|
||||||
|
panelXMG.Visible = (Program.acpi.DeviceGet(AsusACPI.GPUXGConnected) == 1);
|
||||||
|
checkXMG.Checked = !(AppConfig.getConfig("xmg_light") == 0);
|
||||||
|
checkXMG.CheckedChanged += CheckXMG_CheckedChanged;
|
||||||
|
|
||||||
|
numericBacklightTime.Value = AppConfig.getConfig("keyboard_timeout", 60);
|
||||||
|
numericBacklightPluggedTime.Value = AppConfig.getConfig("keyboard_ac_timeout", 0);
|
||||||
|
|
||||||
|
numericBacklightTime.ValueChanged += NumericBacklightTime_ValueChanged;
|
||||||
|
numericBacklightPluggedTime.ValueChanged += NumericBacklightTime_ValueChanged;
|
||||||
|
|
||||||
|
checkGpuApps.Checked = AppConfig.isConfig("kill_gpu_apps");
|
||||||
|
checkGpuApps.CheckedChanged += CheckGpuApps_CheckedChanged;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CheckGpuApps_CheckedChanged(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
AppConfig.setConfig("kill_gpu_apps", (checkGpuApps.Checked ? 1 : 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void NumericBacklightTime_ValueChanged(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
AppConfig.setConfig("keyboard_timeout", (int)numericBacklightTime.Value);
|
||||||
|
AppConfig.setConfig("keyboard_ac_timeout", (int)numericBacklightPluggedTime.Value);
|
||||||
|
Program.inputDispatcher.InitBacklightTimer();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CheckXMG_CheckedChanged(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
AppConfig.setConfig("xmg_light", (checkXMG.Checked ? 1 : 0));
|
||||||
|
AsusUSB.ApplyXGMLight(checkXMG.Checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckUSBC_CheckedChanged(object? sender, EventArgs e)
|
private void CheckUSBC_CheckedChanged(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("optimized_usbc", (checkUSBC.Checked ? 1 : 0));
|
AppConfig.setConfig("optimized_usbc", (checkUSBC.Checked ? 1 : 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TrackBrightness_Scroll(object? sender, EventArgs e)
|
private void TrackBrightness_Scroll(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("keyboard_brightness", trackBrightness.Value);
|
AppConfig.setConfig("keyboard_brightness", trackBrightness.Value);
|
||||||
Aura.ApplyBrightness(trackBrightness.Value);
|
AsusUSB.ApplyBrightness(trackBrightness.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PictureHelp_Click(object? sender, EventArgs e)
|
private void PictureHelp_Click(object? sender, EventArgs e)
|
||||||
@@ -139,42 +260,93 @@ namespace GHelper
|
|||||||
|
|
||||||
private void CheckNoOverdrive_CheckedChanged(object? sender, EventArgs e)
|
private void CheckNoOverdrive_CheckedChanged(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("no_overdrive", (checkNoOverdrive.Checked ? 1 : 0));
|
AppConfig.setConfig("no_overdrive", (checkNoOverdrive.Checked ? 1 : 0));
|
||||||
Program.settingsForm.AutoScreen(true);
|
Program.settingsForm.AutoScreen(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckKeyboardAuto_CheckedChanged(object? sender, EventArgs e)
|
private void CheckKeyboardAuto_CheckedChanged(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("keyboard_auto", (checkKeyboardAuto.Checked ? 1 : 0));
|
AppConfig.setConfig("keyboard_auto", (checkKeyboardAuto.Checked ? 1 : 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckTopmost_CheckedChanged(object? sender, EventArgs e)
|
private void CheckTopmost_CheckedChanged(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("topmost", (checkTopmost.Checked ? 1 : 0));
|
AppConfig.setConfig("topmost", (checkTopmost.Checked ? 1 : 0));
|
||||||
Program.settingsForm.TopMost = checkTopmost.Checked;
|
Program.settingsForm.TopMost = checkTopmost.Checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckPower_CheckedChanged(object? sender, EventArgs e)
|
private void CheckPower_CheckedChanged(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("keyboard_awake", (checkAwake.Checked ? 1 : 0));
|
AppConfig.setConfig("keyboard_awake", (checkAwake.Checked ? 1 : 0));
|
||||||
Program.config.setConfig("keyboard_boot", (checkBoot.Checked ? 1 : 0));
|
AppConfig.setConfig("keyboard_boot", (checkBoot.Checked ? 1 : 0));
|
||||||
Program.config.setConfig("keyboard_sleep", (checkSleep.Checked ? 1 : 0));
|
AppConfig.setConfig("keyboard_sleep", (checkSleep.Checked ? 1 : 0));
|
||||||
Program.config.setConfig("keyboard_shutdown", (checkShutdown.Checked ? 1 : 0));
|
AppConfig.setConfig("keyboard_shutdown", (checkShutdown.Checked ? 1 : 0));
|
||||||
|
|
||||||
|
AppConfig.setConfig("keyboard_awake_bar", (checkAwakeBar.Checked ? 1 : 0));
|
||||||
|
AppConfig.setConfig("keyboard_boot_bar", (checkBootBar.Checked ? 1 : 0));
|
||||||
|
AppConfig.setConfig("keyboard_sleep_bar", (checkSleepBar.Checked ? 1 : 0));
|
||||||
|
AppConfig.setConfig("keyboard_shutdown_bar", (checkShutdownBar.Checked ? 1 : 0));
|
||||||
|
|
||||||
|
AppConfig.setConfig("keyboard_awake_lid", (checkAwakeLid.Checked ? 1 : 0));
|
||||||
|
AppConfig.setConfig("keyboard_boot_lid", (checkBootLid.Checked ? 1 : 0));
|
||||||
|
AppConfig.setConfig("keyboard_sleep_lid", (checkSleepLid.Checked ? 1 : 0));
|
||||||
|
AppConfig.setConfig("keyboard_shutdown_lid", (checkShutdownLid.Checked ? 1 : 0));
|
||||||
|
|
||||||
|
AppConfig.setConfig("keyboard_awake_logo", (checkAwakeLogo.Checked ? 1 : 0));
|
||||||
|
AppConfig.setConfig("keyboard_boot_logo", (checkBootLogo.Checked ? 1 : 0));
|
||||||
|
AppConfig.setConfig("keyboard_sleep_logo", (checkSleepLogo.Checked ? 1 : 0));
|
||||||
|
AppConfig.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);
|
||||||
|
|
||||||
|
AsusUSB.ApplyAuraPower(flags);
|
||||||
|
|
||||||
Aura.ApplyAuraPower(checkAwake.Checked, checkBoot.Checked, checkSleep.Checked, checkShutdown.Checked);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ComboKeyboardSpeed_SelectedValueChanged(object? sender, EventArgs e)
|
private void ComboKeyboardSpeed_SelectedValueChanged(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("aura_speed", (int)comboKeyboardSpeed.SelectedValue);
|
AppConfig.setConfig("aura_speed", (int)comboKeyboardSpeed.SelectedValue);
|
||||||
Program.settingsForm.SetAura();
|
Program.settingsForm.SetAura();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void Keyboard_Shown(object? sender, EventArgs e)
|
private void Keyboard_Shown(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Top = Program.settingsForm.Top;
|
if (Height > Program.settingsForm.Height)
|
||||||
|
{
|
||||||
|
Top = Program.settingsForm.Top + Program.settingsForm.Height - Height;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Top = Program.settingsForm.Top;
|
||||||
|
}
|
||||||
|
|
||||||
Left = Program.settingsForm.Left - Width - 5;
|
Left = Program.settingsForm.Left - Width - 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void checkAutoApplyWindowsPowerMode_CheckedChanged(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
AppConfig.setConfig("auto_apply_power_plan", checkAutoApplyWindowsPowerMode.Checked ? 1 : 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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: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:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
|||||||
558
app/Fans.Designer.cs
generated
558
app/Fans.Designer.cs
generated
@@ -31,23 +31,28 @@ namespace GHelper
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
ChartArea chartArea13 = new ChartArea();
|
ChartArea chartArea9 = new ChartArea();
|
||||||
Title title13 = new Title();
|
Title title9 = new Title();
|
||||||
ChartArea chartArea14 = new ChartArea();
|
ChartArea chartArea10 = new ChartArea();
|
||||||
Title title14 = new Title();
|
Title title10 = new Title();
|
||||||
ChartArea chartArea15 = new ChartArea();
|
ChartArea chartArea11 = new ChartArea();
|
||||||
Title title15 = new Title();
|
Title title11 = new Title();
|
||||||
|
ChartArea chartArea12 = new ChartArea();
|
||||||
|
Title title12 = new Title();
|
||||||
panelFans = new Panel();
|
panelFans = new Panel();
|
||||||
labelFansResult = new Label();
|
|
||||||
labelTip = new Label();
|
labelTip = new Label();
|
||||||
labelBoost = new Label();
|
|
||||||
comboBoost = new RComboBox();
|
|
||||||
picturePerf = new PictureBox();
|
|
||||||
tableFanCharts = new TableLayoutPanel();
|
tableFanCharts = new TableLayoutPanel();
|
||||||
chartGPU = new Chart();
|
chartGPU = new Chart();
|
||||||
chartCPU = new Chart();
|
chartCPU = new Chart();
|
||||||
|
chartXGM = new Chart();
|
||||||
chartMid = new Chart();
|
chartMid = new Chart();
|
||||||
|
panelTitleFans = new Panel();
|
||||||
|
labelBoost = new Label();
|
||||||
|
comboBoost = new RComboBox();
|
||||||
|
picturePerf = new PictureBox();
|
||||||
labelFans = new Label();
|
labelFans = new Label();
|
||||||
|
panelApplyFans = new Panel();
|
||||||
|
labelFansResult = new Label();
|
||||||
checkApplyFans = new RCheckBox();
|
checkApplyFans = new RCheckBox();
|
||||||
buttonReset = new RButton();
|
buttonReset = new RButton();
|
||||||
panelSliders = new Panel();
|
panelSliders = new Panel();
|
||||||
@@ -67,6 +72,14 @@ namespace GHelper
|
|||||||
pictureBox1 = new PictureBox();
|
pictureBox1 = new PictureBox();
|
||||||
labelPowerLimits = new Label();
|
labelPowerLimits = new Label();
|
||||||
panelGPU = new Panel();
|
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();
|
panelGPUMemory = new Panel();
|
||||||
labelGPUMemory = new Label();
|
labelGPUMemory = new Label();
|
||||||
labelGPUMemoryTitle = new Label();
|
labelGPUMemoryTitle = new Label();
|
||||||
@@ -78,20 +91,15 @@ namespace GHelper
|
|||||||
panelTitleGPU = new Panel();
|
panelTitleGPU = new Panel();
|
||||||
pictureGPU = new PictureBox();
|
pictureGPU = new PictureBox();
|
||||||
labelGPU = new Label();
|
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();
|
panelFans.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)picturePerf).BeginInit();
|
|
||||||
tableFanCharts.SuspendLayout();
|
tableFanCharts.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)chartGPU).BeginInit();
|
((System.ComponentModel.ISupportInitialize)chartGPU).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)chartCPU).BeginInit();
|
((System.ComponentModel.ISupportInitialize)chartCPU).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)chartXGM).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)chartMid).BeginInit();
|
((System.ComponentModel.ISupportInitialize)chartMid).BeginInit();
|
||||||
|
panelTitleFans.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)picturePerf).BeginInit();
|
||||||
|
panelApplyFans.SuspendLayout();
|
||||||
panelSliders.SuspendLayout();
|
panelSliders.SuspendLayout();
|
||||||
panelPower.SuspendLayout();
|
panelPower.SuspendLayout();
|
||||||
panelApplyPower.SuspendLayout();
|
panelApplyPower.SuspendLayout();
|
||||||
@@ -102,67 +110,146 @@ namespace GHelper
|
|||||||
panelTitleCPU.SuspendLayout();
|
panelTitleCPU.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
|
((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
|
||||||
panelGPU.SuspendLayout();
|
panelGPU.SuspendLayout();
|
||||||
|
panelGPUTemp.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)trackGPUTemp).BeginInit();
|
||||||
|
panelGPUBoost.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)trackGPUBoost).BeginInit();
|
||||||
panelGPUMemory.SuspendLayout();
|
panelGPUMemory.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)trackGPUMemory).BeginInit();
|
((System.ComponentModel.ISupportInitialize)trackGPUMemory).BeginInit();
|
||||||
panelGPUCore.SuspendLayout();
|
panelGPUCore.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)trackGPUCore).BeginInit();
|
((System.ComponentModel.ISupportInitialize)trackGPUCore).BeginInit();
|
||||||
panelTitleGPU.SuspendLayout();
|
panelTitleGPU.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)pictureGPU).BeginInit();
|
((System.ComponentModel.ISupportInitialize)pictureGPU).BeginInit();
|
||||||
panelGPUBoost.SuspendLayout();
|
|
||||||
((System.ComponentModel.ISupportInitialize)trackGPUBoost).BeginInit();
|
|
||||||
panelGPUTemp.SuspendLayout();
|
|
||||||
((System.ComponentModel.ISupportInitialize)trackGPUTemp).BeginInit();
|
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// panelFans
|
// panelFans
|
||||||
//
|
//
|
||||||
panelFans.Controls.Add(labelFansResult);
|
panelFans.AutoSize = true;
|
||||||
|
panelFans.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||||
panelFans.Controls.Add(labelTip);
|
panelFans.Controls.Add(labelTip);
|
||||||
panelFans.Controls.Add(labelBoost);
|
|
||||||
panelFans.Controls.Add(comboBoost);
|
|
||||||
panelFans.Controls.Add(picturePerf);
|
|
||||||
panelFans.Controls.Add(tableFanCharts);
|
panelFans.Controls.Add(tableFanCharts);
|
||||||
panelFans.Controls.Add(labelFans);
|
panelFans.Controls.Add(panelTitleFans);
|
||||||
panelFans.Controls.Add(checkApplyFans);
|
panelFans.Controls.Add(panelApplyFans);
|
||||||
panelFans.Controls.Add(buttonReset);
|
|
||||||
panelFans.Dock = DockStyle.Left;
|
panelFans.Dock = DockStyle.Left;
|
||||||
panelFans.Location = new Point(533, 0);
|
panelFans.Location = new Point(533, 0);
|
||||||
panelFans.Margin = new Padding(0);
|
panelFans.Margin = new Padding(0);
|
||||||
|
panelFans.MaximumSize = new Size(815, 0);
|
||||||
|
panelFans.MinimumSize = new Size(815, 0);
|
||||||
panelFans.Name = "panelFans";
|
panelFans.Name = "panelFans";
|
||||||
panelFans.Padding = new Padding(10);
|
panelFans.Padding = new Padding(0, 0, 10, 0);
|
||||||
panelFans.Size = new Size(824, 1189);
|
panelFans.Size = new Size(815, 1189);
|
||||||
panelFans.TabIndex = 12;
|
panelFans.TabIndex = 12;
|
||||||
//
|
//
|
||||||
// labelFansResult
|
|
||||||
//
|
|
||||||
labelFansResult.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
|
||||||
labelFansResult.ForeColor = Color.Red;
|
|
||||||
labelFansResult.Location = new Point(30, 1073);
|
|
||||||
labelFansResult.Name = "labelFansResult";
|
|
||||||
labelFansResult.Size = new Size(760, 32);
|
|
||||||
labelFansResult.TabIndex = 41;
|
|
||||||
labelFansResult.TextAlign = ContentAlignment.TopRight;
|
|
||||||
labelFansResult.Visible = false;
|
|
||||||
//
|
|
||||||
// labelTip
|
// labelTip
|
||||||
//
|
//
|
||||||
labelTip.AutoSize = true;
|
labelTip.AutoSize = true;
|
||||||
labelTip.BackColor = SystemColors.ControlLightLight;
|
labelTip.BackColor = SystemColors.ControlLightLight;
|
||||||
labelTip.Location = new Point(155, 9);
|
labelTip.Location = new Point(684, 91);
|
||||||
labelTip.Name = "labelTip";
|
labelTip.Name = "labelTip";
|
||||||
labelTip.Padding = new Padding(5);
|
labelTip.Padding = new Padding(5);
|
||||||
labelTip.Size = new Size(107, 42);
|
labelTip.Size = new Size(107, 42);
|
||||||
labelTip.TabIndex = 40;
|
labelTip.TabIndex = 40;
|
||||||
labelTip.Text = "500,300";
|
labelTip.Text = "500,300";
|
||||||
//
|
//
|
||||||
|
// tableFanCharts
|
||||||
|
//
|
||||||
|
tableFanCharts.AutoSize = true;
|
||||||
|
tableFanCharts.ColumnCount = 1;
|
||||||
|
tableFanCharts.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
|
||||||
|
tableFanCharts.Controls.Add(chartGPU, 0, 1);
|
||||||
|
tableFanCharts.Controls.Add(chartCPU, 0, 0);
|
||||||
|
tableFanCharts.Controls.Add(chartXGM, 0, 2);
|
||||||
|
tableFanCharts.Controls.Add(chartMid, 0, 2);
|
||||||
|
tableFanCharts.Dock = DockStyle.Fill;
|
||||||
|
tableFanCharts.Location = new Point(0, 66);
|
||||||
|
tableFanCharts.Margin = new Padding(4);
|
||||||
|
tableFanCharts.Name = "tableFanCharts";
|
||||||
|
tableFanCharts.Padding = new Padding(10, 0, 10, 10);
|
||||||
|
tableFanCharts.RowCount = 2;
|
||||||
|
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
|
||||||
|
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
|
||||||
|
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
|
||||||
|
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
|
||||||
|
tableFanCharts.Size = new Size(805, 1007);
|
||||||
|
tableFanCharts.TabIndex = 36;
|
||||||
|
//
|
||||||
|
// chartGPU
|
||||||
|
//
|
||||||
|
chartArea9.Name = "ChartArea1";
|
||||||
|
chartGPU.ChartAreas.Add(chartArea9);
|
||||||
|
chartGPU.Dock = DockStyle.Fill;
|
||||||
|
chartGPU.Location = new Point(12, 259);
|
||||||
|
chartGPU.Margin = new Padding(2, 10, 2, 10);
|
||||||
|
chartGPU.Name = "chartGPU";
|
||||||
|
chartGPU.Size = new Size(781, 229);
|
||||||
|
chartGPU.TabIndex = 17;
|
||||||
|
chartGPU.Text = "chartGPU";
|
||||||
|
title9.Name = "Title1";
|
||||||
|
chartGPU.Titles.Add(title9);
|
||||||
|
//
|
||||||
|
// chartCPU
|
||||||
|
//
|
||||||
|
chartArea10.Name = "ChartArea1";
|
||||||
|
chartCPU.ChartAreas.Add(chartArea10);
|
||||||
|
chartCPU.Dock = DockStyle.Fill;
|
||||||
|
chartCPU.Location = new Point(12, 10);
|
||||||
|
chartCPU.Margin = new Padding(2, 10, 2, 10);
|
||||||
|
chartCPU.Name = "chartCPU";
|
||||||
|
chartCPU.Size = new Size(781, 229);
|
||||||
|
chartCPU.TabIndex = 14;
|
||||||
|
chartCPU.Text = "chartCPU";
|
||||||
|
title10.Name = "Title1";
|
||||||
|
chartCPU.Titles.Add(title10);
|
||||||
|
//
|
||||||
|
// chartXGM
|
||||||
|
//
|
||||||
|
chartArea11.Name = "ChartAreaXGM";
|
||||||
|
chartXGM.ChartAreas.Add(chartArea11);
|
||||||
|
chartXGM.Dock = DockStyle.Fill;
|
||||||
|
chartXGM.Location = new Point(12, 757);
|
||||||
|
chartXGM.Margin = new Padding(2, 10, 2, 10);
|
||||||
|
chartXGM.Name = "chartXGM";
|
||||||
|
chartXGM.Size = new Size(781, 230);
|
||||||
|
chartXGM.TabIndex = 14;
|
||||||
|
chartXGM.Text = "chartXGM";
|
||||||
|
title11.Name = "Title4";
|
||||||
|
chartXGM.Titles.Add(title11);
|
||||||
|
chartXGM.Visible = false;
|
||||||
|
//
|
||||||
|
// chartMid
|
||||||
|
//
|
||||||
|
chartArea12.Name = "ChartArea3";
|
||||||
|
chartMid.ChartAreas.Add(chartArea12);
|
||||||
|
chartMid.Dock = DockStyle.Fill;
|
||||||
|
chartMid.Location = new Point(12, 508);
|
||||||
|
chartMid.Margin = new Padding(2, 10, 2, 10);
|
||||||
|
chartMid.Name = "chartMid";
|
||||||
|
chartMid.Size = new Size(781, 229);
|
||||||
|
chartMid.TabIndex = 14;
|
||||||
|
chartMid.Text = "chartMid";
|
||||||
|
title12.Name = "Title3";
|
||||||
|
chartMid.Titles.Add(title12);
|
||||||
|
chartMid.Visible = false;
|
||||||
|
//
|
||||||
|
// panelTitleFans
|
||||||
|
//
|
||||||
|
panelTitleFans.Controls.Add(labelBoost);
|
||||||
|
panelTitleFans.Controls.Add(comboBoost);
|
||||||
|
panelTitleFans.Controls.Add(picturePerf);
|
||||||
|
panelTitleFans.Controls.Add(labelFans);
|
||||||
|
panelTitleFans.Dock = DockStyle.Top;
|
||||||
|
panelTitleFans.Location = new Point(0, 0);
|
||||||
|
panelTitleFans.Name = "panelTitleFans";
|
||||||
|
panelTitleFans.Size = new Size(805, 66);
|
||||||
|
panelTitleFans.TabIndex = 42;
|
||||||
|
//
|
||||||
// labelBoost
|
// labelBoost
|
||||||
//
|
//
|
||||||
labelBoost.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
labelBoost.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
labelBoost.AutoSize = true;
|
labelBoost.Location = new Point(356, 20);
|
||||||
labelBoost.Location = new Point(375, 17);
|
|
||||||
labelBoost.Name = "labelBoost";
|
labelBoost.Name = "labelBoost";
|
||||||
labelBoost.Size = new Size(125, 32);
|
labelBoost.Size = new Size(140, 32);
|
||||||
labelBoost.TabIndex = 39;
|
labelBoost.TabIndex = 43;
|
||||||
labelBoost.Text = "CPU Boost";
|
labelBoost.Text = "CPU Boost";
|
||||||
labelBoost.TextAlign = ContentAlignment.MiddleRight;
|
labelBoost.TextAlign = ContentAlignment.MiddleRight;
|
||||||
//
|
//
|
||||||
@@ -174,106 +261,67 @@ namespace GHelper
|
|||||||
comboBoost.DropDownStyle = ComboBoxStyle.DropDownList;
|
comboBoost.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
comboBoost.FormattingEnabled = true;
|
comboBoost.FormattingEnabled = true;
|
||||||
comboBoost.Items.AddRange(new object[] { "Disabled", "Enabled", "Aggressive", "Efficient Enabled", "Efficient Aggressive" });
|
comboBoost.Items.AddRange(new object[] { "Disabled", "Enabled", "Aggressive", "Efficient Enabled", "Efficient Aggressive" });
|
||||||
comboBoost.Location = new Point(526, 15);
|
comboBoost.Location = new Point(506, 16);
|
||||||
comboBoost.Name = "comboBoost";
|
comboBoost.Name = "comboBoost";
|
||||||
comboBoost.Size = new Size(266, 40);
|
comboBoost.Size = new Size(287, 40);
|
||||||
comboBoost.TabIndex = 38;
|
comboBoost.TabIndex = 42;
|
||||||
//
|
//
|
||||||
// picturePerf
|
// picturePerf
|
||||||
//
|
//
|
||||||
picturePerf.BackgroundImage = Properties.Resources.icons8_fan_head_96;
|
picturePerf.BackgroundImage = Properties.Resources.icons8_fan_head_96;
|
||||||
picturePerf.BackgroundImageLayout = ImageLayout.Zoom;
|
picturePerf.BackgroundImageLayout = ImageLayout.Zoom;
|
||||||
picturePerf.InitialImage = null;
|
picturePerf.InitialImage = null;
|
||||||
picturePerf.Location = new Point(30, 18);
|
picturePerf.Location = new Point(20, 18);
|
||||||
picturePerf.Margin = new Padding(4, 2, 4, 2);
|
picturePerf.Margin = new Padding(4, 2, 4, 2);
|
||||||
picturePerf.Name = "picturePerf";
|
picturePerf.Name = "picturePerf";
|
||||||
picturePerf.Size = new Size(36, 38);
|
picturePerf.Size = new Size(36, 38);
|
||||||
picturePerf.TabIndex = 37;
|
picturePerf.TabIndex = 41;
|
||||||
picturePerf.TabStop = false;
|
picturePerf.TabStop = false;
|
||||||
//
|
//
|
||||||
// tableFanCharts
|
|
||||||
//
|
|
||||||
tableFanCharts.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
|
||||||
tableFanCharts.ColumnCount = 1;
|
|
||||||
tableFanCharts.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
|
|
||||||
tableFanCharts.Controls.Add(chartGPU, 0, 1);
|
|
||||||
tableFanCharts.Controls.Add(chartCPU, 0, 0);
|
|
||||||
tableFanCharts.Controls.Add(chartMid, 0, 2);
|
|
||||||
tableFanCharts.Location = new Point(28, 64);
|
|
||||||
tableFanCharts.Margin = new Padding(4);
|
|
||||||
tableFanCharts.Name = "tableFanCharts";
|
|
||||||
tableFanCharts.RowCount = 2;
|
|
||||||
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 33F));
|
|
||||||
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 33F));
|
|
||||||
tableFanCharts.RowStyles.Add(new RowStyle(SizeType.Percent, 33F));
|
|
||||||
tableFanCharts.Size = new Size(764, 1022);
|
|
||||||
tableFanCharts.TabIndex = 36;
|
|
||||||
//
|
|
||||||
// chartGPU
|
|
||||||
//
|
|
||||||
chartArea13.Name = "ChartArea1";
|
|
||||||
chartGPU.ChartAreas.Add(chartArea13);
|
|
||||||
chartGPU.Dock = DockStyle.Fill;
|
|
||||||
chartGPU.Location = new Point(2, 350);
|
|
||||||
chartGPU.Margin = new Padding(2, 10, 2, 10);
|
|
||||||
chartGPU.Name = "chartGPU";
|
|
||||||
chartGPU.Size = new Size(760, 320);
|
|
||||||
chartGPU.TabIndex = 17;
|
|
||||||
chartGPU.Text = "chartGPU";
|
|
||||||
title13.Name = "Title1";
|
|
||||||
chartGPU.Titles.Add(title13);
|
|
||||||
//
|
|
||||||
// chartCPU
|
|
||||||
//
|
|
||||||
chartArea14.Name = "ChartArea1";
|
|
||||||
chartCPU.ChartAreas.Add(chartArea14);
|
|
||||||
chartCPU.Dock = DockStyle.Fill;
|
|
||||||
chartCPU.Location = new Point(2, 10);
|
|
||||||
chartCPU.Margin = new Padding(2, 10, 2, 10);
|
|
||||||
chartCPU.Name = "chartCPU";
|
|
||||||
chartCPU.Size = new Size(760, 320);
|
|
||||||
chartCPU.TabIndex = 14;
|
|
||||||
chartCPU.Text = "chartCPU";
|
|
||||||
title14.Name = "Title1";
|
|
||||||
chartCPU.Titles.Add(title14);
|
|
||||||
//
|
|
||||||
// chartMid
|
|
||||||
//
|
|
||||||
chartArea15.Name = "ChartArea3";
|
|
||||||
chartMid.ChartAreas.Add(chartArea15);
|
|
||||||
chartMid.Dock = DockStyle.Fill;
|
|
||||||
chartMid.Location = new Point(2, 690);
|
|
||||||
chartMid.Margin = new Padding(2, 10, 2, 10);
|
|
||||||
chartMid.Name = "chartMid";
|
|
||||||
chartMid.Size = new Size(760, 322);
|
|
||||||
chartMid.TabIndex = 14;
|
|
||||||
chartMid.Text = "chartMid";
|
|
||||||
title15.Name = "Title3";
|
|
||||||
chartMid.Titles.Add(title15);
|
|
||||||
chartMid.Visible = false;
|
|
||||||
//
|
|
||||||
// labelFans
|
// labelFans
|
||||||
//
|
//
|
||||||
labelFans.AutoSize = true;
|
labelFans.AutoSize = true;
|
||||||
labelFans.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
labelFans.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
||||||
labelFans.Location = new Point(66, 20);
|
labelFans.Location = new Point(62, 20);
|
||||||
labelFans.Margin = new Padding(4, 0, 4, 0);
|
labelFans.Margin = new Padding(4, 0, 4, 0);
|
||||||
labelFans.Name = "labelFans";
|
labelFans.Name = "labelFans";
|
||||||
labelFans.Size = new Size(138, 32);
|
labelFans.Size = new Size(138, 32);
|
||||||
labelFans.TabIndex = 28;
|
labelFans.TabIndex = 40;
|
||||||
labelFans.Text = "Fan Curves";
|
labelFans.Text = "Fan Curves";
|
||||||
//
|
//
|
||||||
|
// panelApplyFans
|
||||||
|
//
|
||||||
|
panelApplyFans.Controls.Add(labelFansResult);
|
||||||
|
panelApplyFans.Controls.Add(checkApplyFans);
|
||||||
|
panelApplyFans.Controls.Add(buttonReset);
|
||||||
|
panelApplyFans.Dock = DockStyle.Bottom;
|
||||||
|
panelApplyFans.Location = new Point(0, 1073);
|
||||||
|
panelApplyFans.Name = "panelApplyFans";
|
||||||
|
panelApplyFans.Size = new Size(805, 116);
|
||||||
|
panelApplyFans.TabIndex = 43;
|
||||||
|
//
|
||||||
|
// labelFansResult
|
||||||
|
//
|
||||||
|
labelFansResult.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
|
labelFansResult.ForeColor = Color.Red;
|
||||||
|
labelFansResult.Location = new Point(25, 3);
|
||||||
|
labelFansResult.Name = "labelFansResult";
|
||||||
|
labelFansResult.Size = new Size(760, 32);
|
||||||
|
labelFansResult.TabIndex = 42;
|
||||||
|
labelFansResult.TextAlign = ContentAlignment.TopRight;
|
||||||
|
labelFansResult.Visible = false;
|
||||||
|
//
|
||||||
// checkApplyFans
|
// checkApplyFans
|
||||||
//
|
//
|
||||||
checkApplyFans.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
checkApplyFans.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||||
checkApplyFans.AutoSize = true;
|
checkApplyFans.AutoSize = true;
|
||||||
checkApplyFans.BackColor = SystemColors.ControlLight;
|
checkApplyFans.BackColor = SystemColors.ControlLight;
|
||||||
checkApplyFans.Location = new Point(449, 1118);
|
checkApplyFans.Location = new Point(453, 45);
|
||||||
checkApplyFans.Margin = new Padding(4, 2, 4, 2);
|
checkApplyFans.Margin = new Padding(4, 2, 4, 2);
|
||||||
checkApplyFans.Name = "checkApplyFans";
|
checkApplyFans.Name = "checkApplyFans";
|
||||||
checkApplyFans.Padding = new Padding(15, 5, 15, 5);
|
checkApplyFans.Padding = new Padding(15, 5, 15, 5);
|
||||||
checkApplyFans.Size = new Size(339, 46);
|
checkApplyFans.Size = new Size(339, 46);
|
||||||
checkApplyFans.TabIndex = 17;
|
checkApplyFans.TabIndex = 19;
|
||||||
checkApplyFans.Text = Properties.Strings.ApplyFanCurve;
|
checkApplyFans.Text = Properties.Strings.ApplyFanCurve;
|
||||||
checkApplyFans.UseVisualStyleBackColor = false;
|
checkApplyFans.UseVisualStyleBackColor = false;
|
||||||
//
|
//
|
||||||
@@ -285,12 +333,12 @@ namespace GHelper
|
|||||||
buttonReset.BorderColor = Color.Transparent;
|
buttonReset.BorderColor = Color.Transparent;
|
||||||
buttonReset.BorderRadius = 2;
|
buttonReset.BorderRadius = 2;
|
||||||
buttonReset.FlatStyle = FlatStyle.Flat;
|
buttonReset.FlatStyle = FlatStyle.Flat;
|
||||||
buttonReset.Location = new Point(30, 1112);
|
buttonReset.Location = new Point(12, 38);
|
||||||
buttonReset.Margin = new Padding(4, 2, 4, 2);
|
buttonReset.Margin = new Padding(4, 2, 4, 2);
|
||||||
buttonReset.Name = "buttonReset";
|
buttonReset.Name = "buttonReset";
|
||||||
buttonReset.Secondary = true;
|
buttonReset.Secondary = true;
|
||||||
buttonReset.Size = new Size(232, 54);
|
buttonReset.Size = new Size(232, 54);
|
||||||
buttonReset.TabIndex = 15;
|
buttonReset.TabIndex = 18;
|
||||||
buttonReset.Text = Properties.Strings.FactoryDefaults;
|
buttonReset.Text = Properties.Strings.FactoryDefaults;
|
||||||
buttonReset.UseVisualStyleBackColor = false;
|
buttonReset.UseVisualStyleBackColor = false;
|
||||||
//
|
//
|
||||||
@@ -316,19 +364,19 @@ namespace GHelper
|
|||||||
panelPower.Controls.Add(panelTotal);
|
panelPower.Controls.Add(panelTotal);
|
||||||
panelPower.Controls.Add(panelTitleCPU);
|
panelPower.Controls.Add(panelTitleCPU);
|
||||||
panelPower.Dock = DockStyle.Fill;
|
panelPower.Dock = DockStyle.Fill;
|
||||||
panelPower.Location = new Point(10, 634);
|
panelPower.Location = new Point(10, 652);
|
||||||
panelPower.Name = "panelPower";
|
panelPower.Name = "panelPower";
|
||||||
panelPower.Size = new Size(523, 555);
|
panelPower.Size = new Size(523, 537);
|
||||||
panelPower.TabIndex = 43;
|
panelPower.TabIndex = 43;
|
||||||
//
|
//
|
||||||
// panelApplyPower
|
// panelApplyPower
|
||||||
//
|
//
|
||||||
panelApplyPower.Controls.Add(checkApplyPower);
|
panelApplyPower.Controls.Add(checkApplyPower);
|
||||||
panelApplyPower.Dock = DockStyle.Bottom;
|
panelApplyPower.Dock = DockStyle.Bottom;
|
||||||
panelApplyPower.Location = new Point(0, 463);
|
panelApplyPower.Location = new Point(0, 447);
|
||||||
panelApplyPower.Name = "panelApplyPower";
|
panelApplyPower.Name = "panelApplyPower";
|
||||||
panelApplyPower.Padding = new Padding(10);
|
panelApplyPower.Padding = new Padding(10);
|
||||||
panelApplyPower.Size = new Size(523, 92);
|
panelApplyPower.Size = new Size(523, 90);
|
||||||
panelApplyPower.TabIndex = 44;
|
panelApplyPower.TabIndex = 44;
|
||||||
//
|
//
|
||||||
// checkApplyPower
|
// checkApplyPower
|
||||||
@@ -336,7 +384,7 @@ namespace GHelper
|
|||||||
checkApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
checkApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||||
checkApplyPower.AutoSize = true;
|
checkApplyPower.AutoSize = true;
|
||||||
checkApplyPower.BackColor = SystemColors.ControlLight;
|
checkApplyPower.BackColor = SystemColors.ControlLight;
|
||||||
checkApplyPower.Location = new Point(18, 22);
|
checkApplyPower.Location = new Point(18, 20);
|
||||||
checkApplyPower.Margin = new Padding(10);
|
checkApplyPower.Margin = new Padding(10);
|
||||||
checkApplyPower.Name = "checkApplyPower";
|
checkApplyPower.Name = "checkApplyPower";
|
||||||
checkApplyPower.Padding = new Padding(15, 5, 15, 5);
|
checkApplyPower.Padding = new Padding(15, 5, 15, 5);
|
||||||
@@ -348,11 +396,11 @@ namespace GHelper
|
|||||||
// labelInfo
|
// labelInfo
|
||||||
//
|
//
|
||||||
labelInfo.Dock = DockStyle.Top;
|
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.Margin = new Padding(4, 0, 4, 0);
|
||||||
labelInfo.Name = "labelInfo";
|
labelInfo.Name = "labelInfo";
|
||||||
labelInfo.Padding = new Padding(5);
|
labelInfo.Padding = new Padding(5);
|
||||||
labelInfo.Size = new Size(523, 92);
|
labelInfo.Size = new Size(523, 149);
|
||||||
labelInfo.TabIndex = 43;
|
labelInfo.TabIndex = 43;
|
||||||
labelInfo.Text = "Experimental Feature";
|
labelInfo.Text = "Experimental Feature";
|
||||||
//
|
//
|
||||||
@@ -364,7 +412,7 @@ namespace GHelper
|
|||||||
panelCPU.Controls.Add(label2);
|
panelCPU.Controls.Add(label2);
|
||||||
panelCPU.Controls.Add(trackCPU);
|
panelCPU.Controls.Add(trackCPU);
|
||||||
panelCPU.Dock = DockStyle.Top;
|
panelCPU.Dock = DockStyle.Top;
|
||||||
panelCPU.Location = new Point(0, 232);
|
panelCPU.Location = new Point(0, 206);
|
||||||
panelCPU.Margin = new Padding(4);
|
panelCPU.Margin = new Padding(4);
|
||||||
panelCPU.Name = "panelCPU";
|
panelCPU.Name = "panelCPU";
|
||||||
panelCPU.Size = new Size(523, 136);
|
panelCPU.Size = new Size(523, 136);
|
||||||
@@ -414,7 +462,7 @@ namespace GHelper
|
|||||||
panelTotal.Controls.Add(labelPlatform);
|
panelTotal.Controls.Add(labelPlatform);
|
||||||
panelTotal.Controls.Add(trackTotal);
|
panelTotal.Controls.Add(trackTotal);
|
||||||
panelTotal.Dock = DockStyle.Top;
|
panelTotal.Dock = DockStyle.Top;
|
||||||
panelTotal.Location = new Point(0, 92);
|
panelTotal.Location = new Point(0, 66);
|
||||||
panelTotal.Margin = new Padding(4);
|
panelTotal.Margin = new Padding(4);
|
||||||
panelTotal.Name = "panelTotal";
|
panelTotal.Name = "panelTotal";
|
||||||
panelTotal.Size = new Size(523, 140);
|
panelTotal.Size = new Size(523, 140);
|
||||||
@@ -465,7 +513,7 @@ namespace GHelper
|
|||||||
panelTitleCPU.Dock = DockStyle.Top;
|
panelTitleCPU.Dock = DockStyle.Top;
|
||||||
panelTitleCPU.Location = new Point(0, 0);
|
panelTitleCPU.Location = new Point(0, 0);
|
||||||
panelTitleCPU.Name = "panelTitleCPU";
|
panelTitleCPU.Name = "panelTitleCPU";
|
||||||
panelTitleCPU.Size = new Size(523, 92);
|
panelTitleCPU.Size = new Size(523, 66);
|
||||||
panelTitleCPU.TabIndex = 42;
|
panelTitleCPU.TabIndex = 42;
|
||||||
//
|
//
|
||||||
// pictureBox1
|
// pictureBox1
|
||||||
@@ -473,7 +521,7 @@ namespace GHelper
|
|||||||
pictureBox1.BackgroundImage = Properties.Resources.icons8_processor_96;
|
pictureBox1.BackgroundImage = Properties.Resources.icons8_processor_96;
|
||||||
pictureBox1.BackgroundImageLayout = ImageLayout.Zoom;
|
pictureBox1.BackgroundImageLayout = ImageLayout.Zoom;
|
||||||
pictureBox1.InitialImage = null;
|
pictureBox1.InitialImage = null;
|
||||||
pictureBox1.Location = new Point(10, 44);
|
pictureBox1.Location = new Point(18, 18);
|
||||||
pictureBox1.Margin = new Padding(4, 2, 4, 10);
|
pictureBox1.Margin = new Padding(4, 2, 4, 10);
|
||||||
pictureBox1.Name = "pictureBox1";
|
pictureBox1.Name = "pictureBox1";
|
||||||
pictureBox1.Size = new Size(36, 38);
|
pictureBox1.Size = new Size(36, 38);
|
||||||
@@ -484,7 +532,7 @@ namespace GHelper
|
|||||||
//
|
//
|
||||||
labelPowerLimits.AutoSize = true;
|
labelPowerLimits.AutoSize = true;
|
||||||
labelPowerLimits.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
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.Margin = new Padding(4, 0, 4, 0);
|
||||||
labelPowerLimits.Name = "labelPowerLimits";
|
labelPowerLimits.Name = "labelPowerLimits";
|
||||||
labelPowerLimits.Size = new Size(229, 32);
|
labelPowerLimits.Size = new Size(229, 32);
|
||||||
@@ -502,9 +550,104 @@ namespace GHelper
|
|||||||
panelGPU.Dock = DockStyle.Top;
|
panelGPU.Dock = DockStyle.Top;
|
||||||
panelGPU.Location = new Point(10, 0);
|
panelGPU.Location = new Point(10, 0);
|
||||||
panelGPU.Name = "panelGPU";
|
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;
|
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
|
||||||
//
|
//
|
||||||
panelGPUMemory.AutoSize = true;
|
panelGPUMemory.AutoSize = true;
|
||||||
@@ -534,9 +677,9 @@ namespace GHelper
|
|||||||
labelGPUMemoryTitle.AutoSize = true;
|
labelGPUMemoryTitle.AutoSize = true;
|
||||||
labelGPUMemoryTitle.Location = new Point(10, 14);
|
labelGPUMemoryTitle.Location = new Point(10, 14);
|
||||||
labelGPUMemoryTitle.Name = "labelGPUMemoryTitle";
|
labelGPUMemoryTitle.Name = "labelGPUMemoryTitle";
|
||||||
labelGPUMemoryTitle.Size = new Size(169, 32);
|
labelGPUMemoryTitle.Size = new Size(241, 32);
|
||||||
labelGPUMemoryTitle.TabIndex = 43;
|
labelGPUMemoryTitle.TabIndex = 43;
|
||||||
labelGPUMemoryTitle.Text = "Memory Clock";
|
labelGPUMemoryTitle.Text = "Memory Clock Offset";
|
||||||
//
|
//
|
||||||
// trackGPUMemory
|
// trackGPUMemory
|
||||||
//
|
//
|
||||||
@@ -629,133 +772,44 @@ namespace GHelper
|
|||||||
//
|
//
|
||||||
labelGPU.AutoSize = true;
|
labelGPU.AutoSize = true;
|
||||||
labelGPU.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
labelGPU.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
|
||||||
labelGPU.Location = new Point(62, 21);
|
labelGPU.Location = new Point(62, 20);
|
||||||
labelGPU.Margin = new Padding(4, 0, 4, 0);
|
labelGPU.Margin = new Padding(4, 0, 4, 0);
|
||||||
labelGPU.Name = "labelGPU";
|
labelGPU.Name = "labelGPU";
|
||||||
labelGPU.Size = new Size(162, 32);
|
labelGPU.Size = new Size(162, 32);
|
||||||
labelGPU.TabIndex = 40;
|
labelGPU.TabIndex = 40;
|
||||||
labelGPU.Text = "GPU Settings";
|
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
|
// Fans
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(192F, 192F);
|
AutoScaleDimensions = new SizeF(192F, 192F);
|
||||||
AutoScaleMode = AutoScaleMode.Dpi;
|
AutoScaleMode = AutoScaleMode.Dpi;
|
||||||
AutoSize = true;
|
AutoSize = true;
|
||||||
AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||||
ClientSize = new Size(1361, 1189);
|
ClientSize = new Size(1340, 1189);
|
||||||
Controls.Add(panelFans);
|
Controls.Add(panelFans);
|
||||||
Controls.Add(panelSliders);
|
Controls.Add(panelSliders);
|
||||||
Margin = new Padding(4, 2, 4, 2);
|
Margin = new Padding(4, 2, 4, 2);
|
||||||
MaximizeBox = false;
|
MaximizeBox = false;
|
||||||
MdiChildrenMinimizedAnchorBottom = false;
|
MdiChildrenMinimizedAnchorBottom = false;
|
||||||
MinimizeBox = false;
|
MinimizeBox = false;
|
||||||
MinimumSize = new Size(26, 1260);
|
MinimumSize = new Size(0, 1200);
|
||||||
Name = "Fans";
|
Name = "Fans";
|
||||||
ShowIcon = false;
|
ShowIcon = false;
|
||||||
ShowInTaskbar = false;
|
ShowInTaskbar = false;
|
||||||
StartPosition = FormStartPosition.CenterScreen;
|
StartPosition = FormStartPosition.Manual;
|
||||||
Text = "Fans and Power";
|
Text = "Fans and Power";
|
||||||
panelFans.ResumeLayout(false);
|
panelFans.ResumeLayout(false);
|
||||||
panelFans.PerformLayout();
|
panelFans.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)picturePerf).EndInit();
|
|
||||||
tableFanCharts.ResumeLayout(false);
|
tableFanCharts.ResumeLayout(false);
|
||||||
((System.ComponentModel.ISupportInitialize)chartGPU).EndInit();
|
((System.ComponentModel.ISupportInitialize)chartGPU).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)chartCPU).EndInit();
|
((System.ComponentModel.ISupportInitialize)chartCPU).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)chartXGM).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)chartMid).EndInit();
|
((System.ComponentModel.ISupportInitialize)chartMid).EndInit();
|
||||||
|
panelTitleFans.ResumeLayout(false);
|
||||||
|
panelTitleFans.PerformLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)picturePerf).EndInit();
|
||||||
|
panelApplyFans.ResumeLayout(false);
|
||||||
|
panelApplyFans.PerformLayout();
|
||||||
panelSliders.ResumeLayout(false);
|
panelSliders.ResumeLayout(false);
|
||||||
panelSliders.PerformLayout();
|
panelSliders.PerformLayout();
|
||||||
panelPower.ResumeLayout(false);
|
panelPower.ResumeLayout(false);
|
||||||
@@ -773,6 +827,12 @@ namespace GHelper
|
|||||||
((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
|
((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
|
||||||
panelGPU.ResumeLayout(false);
|
panelGPU.ResumeLayout(false);
|
||||||
panelGPU.PerformLayout();
|
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.ResumeLayout(false);
|
||||||
panelGPUMemory.PerformLayout();
|
panelGPUMemory.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)trackGPUMemory).EndInit();
|
((System.ComponentModel.ISupportInitialize)trackGPUMemory).EndInit();
|
||||||
@@ -782,30 +842,19 @@ namespace GHelper
|
|||||||
panelTitleGPU.ResumeLayout(false);
|
panelTitleGPU.ResumeLayout(false);
|
||||||
panelTitleGPU.PerformLayout();
|
panelTitleGPU.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)pictureGPU).EndInit();
|
((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);
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
private Panel panelFans;
|
private Panel panelFans;
|
||||||
private RCheckBox checkApplyFans;
|
|
||||||
private RButton buttonReset;
|
|
||||||
private Panel panelSliders;
|
private Panel panelSliders;
|
||||||
private TableLayoutPanel tableFanCharts;
|
private TableLayoutPanel tableFanCharts;
|
||||||
private System.Windows.Forms.DataVisualization.Charting.Chart chartGPU;
|
private Chart chartGPU;
|
||||||
private System.Windows.Forms.DataVisualization.Charting.Chart chartCPU;
|
private Chart chartCPU;
|
||||||
private System.Windows.Forms.DataVisualization.Charting.Chart chartMid;
|
private Chart chartMid;
|
||||||
private Label labelFans;
|
private Chart chartXGM;
|
||||||
private PictureBox picturePerf;
|
|
||||||
private RComboBox comboBoost;
|
|
||||||
private Label labelBoost;
|
|
||||||
private Label labelTip;
|
private Label labelTip;
|
||||||
private Label labelFansResult;
|
|
||||||
private Panel panelPower;
|
private Panel panelPower;
|
||||||
private Label labelInfo;
|
private Label labelInfo;
|
||||||
private Panel panelCPU;
|
private Panel panelCPU;
|
||||||
@@ -841,5 +890,14 @@ namespace GHelper
|
|||||||
private Label labelGPUTemp;
|
private Label labelGPUTemp;
|
||||||
private Label labelGPUTempTitle;
|
private Label labelGPUTempTitle;
|
||||||
private TrackBar trackGPUTemp;
|
private TrackBar trackGPUTemp;
|
||||||
|
private Panel panelTitleFans;
|
||||||
|
private Panel panelApplyFans;
|
||||||
|
private Label labelFansResult;
|
||||||
|
private RCheckBox checkApplyFans;
|
||||||
|
private RButton buttonReset;
|
||||||
|
private Label labelBoost;
|
||||||
|
private RComboBox comboBoost;
|
||||||
|
private PictureBox picturePerf;
|
||||||
|
private Label labelFans;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
349
app/Fans.cs
349
app/Fans.cs
@@ -12,9 +12,16 @@ namespace GHelper
|
|||||||
Series seriesCPU;
|
Series seriesCPU;
|
||||||
Series seriesGPU;
|
Series seriesGPU;
|
||||||
Series seriesMid;
|
Series seriesMid;
|
||||||
|
Series seriesXGM;
|
||||||
|
|
||||||
static int MinRPM, MaxRPM;
|
static int MinRPM, MaxRPM;
|
||||||
|
|
||||||
|
static bool powerVisible = true, gpuVisible = true;
|
||||||
|
|
||||||
|
const int fansMax = 100;
|
||||||
|
|
||||||
|
NvidiaGpuControl? nvControl = null;
|
||||||
|
|
||||||
public Fans()
|
public Fans()
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -30,10 +37,17 @@ namespace GHelper
|
|||||||
buttonReset.Text = Properties.Strings.FactoryDefaults;
|
buttonReset.Text = Properties.Strings.FactoryDefaults;
|
||||||
checkApplyFans.Text = Properties.Strings.ApplyFanCurve;
|
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();
|
InitTheme();
|
||||||
|
|
||||||
MinRPM = 18;
|
MinRPM = 18;
|
||||||
MaxRPM = HardwareMonitor.GetFanMax();
|
MaxRPM = HardwareControl.GetFanMax();
|
||||||
labelTip.Visible = false;
|
labelTip.Visible = false;
|
||||||
labelTip.BackColor = Color.Transparent;
|
labelTip.BackColor = Color.Transparent;
|
||||||
|
|
||||||
@@ -42,10 +56,12 @@ namespace GHelper
|
|||||||
seriesCPU = chartCPU.Series.Add("CPU");
|
seriesCPU = chartCPU.Series.Add("CPU");
|
||||||
seriesGPU = chartGPU.Series.Add("GPU");
|
seriesGPU = chartGPU.Series.Add("GPU");
|
||||||
seriesMid = chartMid.Series.Add("Mid");
|
seriesMid = chartMid.Series.Add("Mid");
|
||||||
|
seriesXGM = chartXGM.Series.Add("XGM");
|
||||||
|
|
||||||
seriesCPU.Color = colorStandard;
|
seriesCPU.Color = colorStandard;
|
||||||
seriesGPU.Color = colorTurbo;
|
seriesGPU.Color = colorTurbo;
|
||||||
seriesMid.Color = colorEco;
|
seriesMid.Color = colorEco;
|
||||||
|
seriesXGM.Color = Color.Orange;
|
||||||
|
|
||||||
chartCPU.MouseMove += ChartCPU_MouseMove;
|
chartCPU.MouseMove += ChartCPU_MouseMove;
|
||||||
chartCPU.MouseUp += ChartCPU_MouseUp;
|
chartCPU.MouseUp += ChartCPU_MouseUp;
|
||||||
@@ -56,13 +72,16 @@ namespace GHelper
|
|||||||
chartMid.MouseMove += ChartCPU_MouseMove;
|
chartMid.MouseMove += ChartCPU_MouseMove;
|
||||||
chartMid.MouseUp += ChartCPU_MouseUp;
|
chartMid.MouseUp += ChartCPU_MouseUp;
|
||||||
|
|
||||||
|
chartXGM.MouseMove += ChartCPU_MouseMove;
|
||||||
|
chartXGM.MouseUp += ChartCPU_MouseUp;
|
||||||
|
|
||||||
buttonReset.Click += ButtonReset_Click;
|
buttonReset.Click += ButtonReset_Click;
|
||||||
|
|
||||||
trackTotal.Maximum = ASUSWmi.MaxTotal;
|
trackTotal.Maximum = AsusACPI.MaxTotal;
|
||||||
trackTotal.Minimum = ASUSWmi.MinTotal;
|
trackTotal.Minimum = AsusACPI.MinTotal;
|
||||||
|
|
||||||
trackCPU.Maximum = ASUSWmi.MaxCPU;
|
trackCPU.Maximum = AsusACPI.MaxCPU;
|
||||||
trackCPU.Minimum = ASUSWmi.MinCPU;
|
trackCPU.Minimum = AsusACPI.MinCPU;
|
||||||
|
|
||||||
trackCPU.Scroll += TrackPower_Scroll;
|
trackCPU.Scroll += TrackPower_Scroll;
|
||||||
trackTotal.Scroll += TrackPower_Scroll;
|
trackTotal.Scroll += TrackPower_Scroll;
|
||||||
@@ -79,22 +98,22 @@ namespace GHelper
|
|||||||
trackGPUMemory.Minimum = NvidiaGpuControl.MinMemoryOffset;
|
trackGPUMemory.Minimum = NvidiaGpuControl.MinMemoryOffset;
|
||||||
trackGPUMemory.Maximum = NvidiaGpuControl.MaxMemoryOffset;
|
trackGPUMemory.Maximum = NvidiaGpuControl.MaxMemoryOffset;
|
||||||
|
|
||||||
trackGPUBoost.Minimum = ASUSWmi.MinGPUBoost;
|
trackGPUBoost.Minimum = AsusACPI.MinGPUBoost;
|
||||||
trackGPUBoost.Maximum = ASUSWmi.MaxGPUBoost;
|
trackGPUBoost.Maximum = AsusACPI.MaxGPUBoost;
|
||||||
|
|
||||||
trackGPUTemp.Minimum = ASUSWmi.MinGPUTemp;
|
trackGPUTemp.Minimum = AsusACPI.MinGPUTemp;
|
||||||
trackGPUTemp.Maximum = ASUSWmi.MaxGPUTemp;
|
trackGPUTemp.Maximum = AsusACPI.MaxGPUTemp;
|
||||||
|
|
||||||
trackGPUCore.Scroll += trackGPU_Scroll;
|
trackGPUCore.Scroll += trackGPU_Scroll;
|
||||||
trackGPUMemory.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;
|
trackGPUCore.MouseUp += TrackGPU_MouseUp;
|
||||||
trackGPUMemory.MouseUp += TrackGPU_MouseUp;
|
trackGPUMemory.MouseUp += TrackGPU_MouseUp;
|
||||||
|
trackGPUBoost.MouseUp += TrackGPU_MouseUp;
|
||||||
trackGPUBoost.MouseUp += TrackGPUBoost_MouseUp;
|
trackGPUTemp.MouseUp += TrackGPU_MouseUp;
|
||||||
trackGPUTemp.MouseUp += TrackGPUBoost_MouseUp;
|
|
||||||
|
|
||||||
//labelInfo.MaximumSize = new Size(280, 0);
|
//labelInfo.MaximumSize = new Size(280, 0);
|
||||||
labelInfo.Text = Properties.Strings.PPTExperimental;
|
labelInfo.Text = Properties.Strings.PPTExperimental;
|
||||||
@@ -103,64 +122,77 @@ namespace GHelper
|
|||||||
InitFans();
|
InitFans();
|
||||||
InitPower();
|
InitPower();
|
||||||
InitBoost();
|
InitBoost();
|
||||||
|
InitGPU(true);
|
||||||
|
|
||||||
comboBoost.SelectedValueChanged += ComboBoost_Changed;
|
comboBoost.SelectedValueChanged += ComboBoost_Changed;
|
||||||
|
|
||||||
Shown += Fans_Shown;
|
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)
|
private void TrackGPU_MouseUp(object? sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
try
|
Program.settingsForm.SetGPUPower();
|
||||||
{
|
Program.settingsForm.SetGPUClocks(true);
|
||||||
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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
||||||
{
|
{
|
||||||
panelGPU.Visible = false;
|
nvControl = (NvidiaGpuControl)HardwareControl.GpuControl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gpuVisible = panelGPU.Visible = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
panelGPU.Visible = true;
|
gpuVisible = panelGPU.Visible = true;
|
||||||
|
|
||||||
|
int gpu_boost = AppConfig.getConfigPerf("gpu_boost");
|
||||||
|
int gpu_temp = AppConfig.getConfigPerf("gpu_temp");
|
||||||
|
int core = AppConfig.getConfigPerf("gpu_core");
|
||||||
|
int memory = AppConfig.getConfigPerf("gpu_memory");
|
||||||
|
|
||||||
|
if (gpu_boost < 0) gpu_boost = AsusACPI.MaxGPUBoost;
|
||||||
|
if (gpu_temp < 0) gpu_temp = AsusACPI.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
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//}
|
||||||
|
|
||||||
Program.nvControl.GetClocks(out int core, out int memory);
|
|
||||||
trackGPUCore.Value = Math.Max(Math.Min(core, NvidiaGpuControl.MaxCoreOffset), NvidiaGpuControl.MinCoreOffset);
|
trackGPUCore.Value = Math.Max(Math.Min(core, NvidiaGpuControl.MaxCoreOffset), NvidiaGpuControl.MinCoreOffset);
|
||||||
trackGPUMemory.Value = Math.Max(Math.Min(memory, NvidiaGpuControl.MaxMemoryOffset), NvidiaGpuControl.MinMemoryOffset);
|
trackGPUMemory.Value = Math.Max(Math.Min(memory, NvidiaGpuControl.MaxMemoryOffset), NvidiaGpuControl.MinMemoryOffset);
|
||||||
|
|
||||||
int gpu_boost = Program.config.getConfig("gpu_boost");
|
trackGPUBoost.Value = Math.Max(Math.Min(gpu_boost, AsusACPI.MaxGPUBoost), AsusACPI.MinGPUBoost);
|
||||||
int gpu_temp = Program.config.getConfig("gpu_temp");
|
trackGPUTemp.Value = Math.Max(Math.Min(gpu_temp, AsusACPI.MaxGPUTemp), AsusACPI.MinGPUTemp);
|
||||||
|
|
||||||
if (gpu_boost < 0) gpu_boost = ASUSWmi.MaxGPUBoost;
|
panelGPUBoost.Visible = (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC0) >= 0);
|
||||||
if (gpu_temp < 0) gpu_temp = ASUSWmi.MaxGPUTemp;
|
panelGPUTemp.Visible = (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC2) >= 0);
|
||||||
|
|
||||||
trackGPUBoost.Value = Math.Max(Math.Min(gpu_boost, ASUSWmi.MaxGPUBoost), ASUSWmi.MinGPUBoost);
|
|
||||||
trackGPUTemp.Value = Math.Max(Math.Min(gpu_temp, ASUSWmi.MaxGPUTemp), ASUSWmi.MinGPUTemp);
|
|
||||||
|
|
||||||
VisualiseGPUSettings();
|
VisualiseGPUSettings();
|
||||||
|
|
||||||
@@ -168,7 +200,7 @@ namespace GHelper
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.WriteLine(ex.ToString());
|
Logger.WriteLine(ex.ToString());
|
||||||
panelGPU.Visible = false;
|
gpuVisible = panelGPU.Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -183,6 +215,22 @@ namespace GHelper
|
|||||||
|
|
||||||
private void trackGPU_Scroll(object? sender, EventArgs e)
|
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;
|
||||||
|
|
||||||
|
AppConfig.setConfigPerf("gpu_core", trackGPUCore.Value);
|
||||||
|
AppConfig.setConfigPerf("gpu_memory", trackGPUMemory.Value);
|
||||||
|
|
||||||
|
VisualiseGPUSettings();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void trackGPUPower_Scroll(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
AppConfig.setConfigPerf("gpu_boost", trackGPUBoost.Value);
|
||||||
|
AppConfig.setConfigPerf("gpu_temp", trackGPUTemp.Value);
|
||||||
|
|
||||||
VisualiseGPUSettings();
|
VisualiseGPUSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,17 +241,26 @@ namespace GHelper
|
|||||||
return (200 * Math.Round((float)(MinRPM * 100 + (MaxRPM - MinRPM) * percentage) / 200)).ToString() + unit;
|
return (200 * Math.Round((float)(MinRPM * 100 + (MaxRPM - MinRPM) * percentage) / 200)).ToString() + unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetChart(Chart chart, int device)
|
void SetChart(Chart chart, AsusFan device)
|
||||||
{
|
{
|
||||||
|
|
||||||
string title;
|
string title = "";
|
||||||
|
|
||||||
if (device == 1)
|
switch (device)
|
||||||
title = Properties.Strings.FanProfileGPU;
|
{
|
||||||
else if (device == 2)
|
case AsusFan.CPU:
|
||||||
title = Properties.Strings.FanProfileMid;
|
title = Properties.Strings.FanProfileCPU;
|
||||||
else
|
break;
|
||||||
title = Properties.Strings.FanProfileCPU;
|
case AsusFan.GPU:
|
||||||
|
title = Properties.Strings.FanProfileGPU;
|
||||||
|
break;
|
||||||
|
case AsusFan.Mid:
|
||||||
|
title = Properties.Strings.FanProfileMid;
|
||||||
|
break;
|
||||||
|
case AsusFan.XGM:
|
||||||
|
title = "XG Mobile";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (Program.settingsForm.perfName.Length > 0)
|
if (Program.settingsForm.perfName.Length > 0)
|
||||||
labelFans.Text = Properties.Strings.FanProfiles + ": " + Program.settingsForm.perfName;
|
labelFans.Text = Properties.Strings.FanProfiles + ": " + Program.settingsForm.perfName;
|
||||||
@@ -215,7 +272,7 @@ namespace GHelper
|
|||||||
chart.ChartAreas[0].AxisX.Interval = 10;
|
chart.ChartAreas[0].AxisX.Interval = 10;
|
||||||
|
|
||||||
chart.ChartAreas[0].AxisY.Minimum = 0;
|
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);
|
chart.ChartAreas[0].AxisY.LabelStyle.Font = new Font("Arial", 7F);
|
||||||
|
|
||||||
@@ -224,10 +281,10 @@ namespace GHelper
|
|||||||
chart.ChartAreas[0].AxisX.LineColor = chartGrid;
|
chart.ChartAreas[0].AxisX.LineColor = chartGrid;
|
||||||
chart.ChartAreas[0].AxisY.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(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;
|
chart.ChartAreas[0].AxisY.Interval = 10;
|
||||||
|
|
||||||
@@ -236,23 +293,29 @@ namespace GHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Fans_Shown(object? sender, EventArgs e)
|
public void FormPosition()
|
||||||
{
|
{
|
||||||
|
panelSliders.Visible = gpuVisible || powerVisible;
|
||||||
|
|
||||||
if (Height > Program.settingsForm.Height)
|
if (Height > Program.settingsForm.Height)
|
||||||
{
|
{
|
||||||
Top = Program.settingsForm.Top + Program.settingsForm.Height - Height;
|
Top = Program.settingsForm.Top + Program.settingsForm.Height - Height;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MinimumSize = new Size(0, Program.settingsForm.Height);
|
Size = MinimumSize = new Size(0, Program.settingsForm.Height);
|
||||||
Height = Program.settingsForm.Height;
|
Height = Program.settingsForm.Height;
|
||||||
Top = Program.settingsForm.Top;
|
Top = Program.settingsForm.Top;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Left = Program.settingsForm.Left - Width - 5;
|
Left = Program.settingsForm.Left - Width - 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Fans_Shown(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
FormPosition();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void TrackPower_MouseUp(object? sender, MouseEventArgs e)
|
private void TrackPower_MouseUp(object? sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
@@ -269,10 +332,10 @@ namespace GHelper
|
|||||||
|
|
||||||
private void ComboBoost_Changed(object? sender, EventArgs e)
|
private void ComboBoost_Changed(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (Program.config.getConfigPerf("auto_boost") != comboBoost.SelectedIndex)
|
if (AppConfig.getConfigPerf("auto_boost") != comboBoost.SelectedIndex)
|
||||||
{
|
{
|
||||||
NativeMethods.SetCPUBoost(comboBoost.SelectedIndex);
|
NativeMethods.SetCPUBoost(comboBoost.SelectedIndex);
|
||||||
Program.config.setConfigPerf("auto_boost", comboBoost.SelectedIndex);
|
AppConfig.setConfigPerf("auto_boost", comboBoost.SelectedIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -280,7 +343,7 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
if (sender is null) return;
|
if (sender is null) return;
|
||||||
CheckBox chk = (CheckBox)sender;
|
CheckBox chk = (CheckBox)sender;
|
||||||
Program.config.setConfigPerf("auto_apply_power", chk.Checked ? 1 : 0);
|
AppConfig.setConfigPerf("auto_apply_power", chk.Checked ? 1 : 0);
|
||||||
|
|
||||||
if (chk.Checked)
|
if (chk.Checked)
|
||||||
{
|
{
|
||||||
@@ -288,7 +351,7 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
|
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AppConfig.getConfig("performance_mode"), "PerfMode");
|
||||||
Program.settingsForm.AutoFans();
|
Program.settingsForm.AutoFans();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -299,7 +362,7 @@ namespace GHelper
|
|||||||
if (sender is null) return;
|
if (sender is null) return;
|
||||||
CheckBox chk = (CheckBox)sender;
|
CheckBox chk = (CheckBox)sender;
|
||||||
|
|
||||||
Program.config.setConfigPerf("auto_apply", chk.Checked ? 1 : 0);
|
AppConfig.setConfigPerf("auto_apply", chk.Checked ? 1 : 0);
|
||||||
|
|
||||||
if (chk.Checked)
|
if (chk.Checked)
|
||||||
{
|
{
|
||||||
@@ -307,7 +370,7 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
|
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AppConfig.getConfig("performance_mode"), "PerfMode");
|
||||||
Program.settingsForm.AutoPower();
|
Program.settingsForm.AutoPower();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -334,21 +397,21 @@ namespace GHelper
|
|||||||
public void InitPower(bool changed = false)
|
public void InitPower(bool changed = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
bool cpuBmode = (Program.wmi.DeviceGet(ASUSWmi.PPT_CPUB0) >= 0); // 2022 model +
|
bool cpuBmode = (Program.acpi.DeviceGet(AsusACPI.PPT_CPUB0) >= 0); // 2022 model +
|
||||||
bool cpuAmode = (Program.wmi.DeviceGet(ASUSWmi.PPT_TotalA0) >= 0); // 2021 model +
|
bool cpuAmode = (Program.acpi.DeviceGet(AsusACPI.PPT_TotalA0) >= 0); // 2021 model +
|
||||||
|
|
||||||
panelSliders.Visible = cpuAmode;
|
powerVisible = panelPower.Visible = cpuAmode;
|
||||||
panelCPU.Visible = cpuBmode;
|
panelCPU.Visible = cpuBmode;
|
||||||
|
|
||||||
// Yes, that's stupid, but Total slider on 2021 model actually adjusts CPU PPT
|
// Yes, that's stupid, but Total slider on 2021 model actually adjusts CPU PPT
|
||||||
if (!cpuBmode)
|
if (!cpuBmode)
|
||||||
{
|
{
|
||||||
labelPlatform.Text = "CPU SPPT";
|
labelPlatform.Text = "CPU PPT";
|
||||||
}
|
}
|
||||||
|
|
||||||
int limit_total;
|
int limit_total;
|
||||||
int limit_cpu;
|
int limit_cpu;
|
||||||
bool apply = Program.config.getConfigPerf("auto_apply_power") == 1;
|
bool apply = AppConfig.getConfigPerf("auto_apply_power") == 1;
|
||||||
|
|
||||||
if (changed)
|
if (changed)
|
||||||
{
|
{
|
||||||
@@ -357,17 +420,17 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
limit_total = Program.config.getConfigPerf("limit_total");
|
limit_total = AppConfig.getConfigPerf("limit_total");
|
||||||
limit_cpu = Program.config.getConfigPerf("limit_cpu");
|
limit_cpu = AppConfig.getConfigPerf("limit_cpu");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (limit_total < 0) limit_total = ASUSWmi.DefaultTotal;
|
if (limit_total < 0) limit_total = AsusACPI.DefaultTotal;
|
||||||
if (limit_total > ASUSWmi.MaxTotal) limit_total = ASUSWmi.MaxTotal;
|
if (limit_total > AsusACPI.MaxTotal) limit_total = AsusACPI.MaxTotal;
|
||||||
if (limit_total < ASUSWmi.MinTotal) limit_total = ASUSWmi.MinTotal;
|
if (limit_total < AsusACPI.MinTotal) limit_total = AsusACPI.MinTotal;
|
||||||
|
|
||||||
if (limit_cpu < 0) limit_cpu = ASUSWmi.DefaultCPU;
|
if (limit_cpu < 0) limit_cpu = AsusACPI.DefaultCPU;
|
||||||
if (limit_cpu > ASUSWmi.MaxCPU) limit_cpu = ASUSWmi.MaxCPU;
|
if (limit_cpu > AsusACPI.MaxCPU) limit_cpu = AsusACPI.MaxCPU;
|
||||||
if (limit_cpu < ASUSWmi.MinCPU) limit_cpu = ASUSWmi.MinCPU;
|
if (limit_cpu < AsusACPI.MinCPU) limit_cpu = AsusACPI.MinCPU;
|
||||||
if (limit_cpu > limit_total) limit_cpu = limit_total;
|
if (limit_cpu > limit_total) limit_cpu = limit_total;
|
||||||
|
|
||||||
trackTotal.Value = limit_total;
|
trackTotal.Value = limit_total;
|
||||||
@@ -377,8 +440,8 @@ namespace GHelper
|
|||||||
labelTotal.Text = trackTotal.Value.ToString() + "W";
|
labelTotal.Text = trackTotal.Value.ToString() + "W";
|
||||||
labelCPU.Text = trackCPU.Value.ToString() + "W";
|
labelCPU.Text = trackCPU.Value.ToString() + "W";
|
||||||
|
|
||||||
Program.config.setConfigPerf("limit_total", limit_total);
|
AppConfig.setConfigPerf("limit_total", limit_total);
|
||||||
Program.config.setConfigPerf("limit_cpu", limit_cpu);
|
AppConfig.setConfigPerf("limit_cpu", limit_cpu);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -393,36 +456,60 @@ namespace GHelper
|
|||||||
public void InitFans()
|
public void InitFans()
|
||||||
{
|
{
|
||||||
|
|
||||||
byte[] curve = Program.wmi.GetFanCurve(2);
|
int chartCount = 2;
|
||||||
|
|
||||||
if (curve.All(singleByte => singleByte == 0))
|
// Middle / system fan check
|
||||||
|
if (!AsusACPI.IsEmptyCurve(Program.acpi.GetFanCurve(AsusFan.Mid)))
|
||||||
{
|
{
|
||||||
Program.config.setConfig("mid_fan", 0);
|
AppConfig.setConfig("mid_fan", 1);
|
||||||
|
chartCount++;
|
||||||
|
chartMid.Visible = true;
|
||||||
|
SetChart(chartMid, AsusFan.Mid);
|
||||||
|
LoadProfile(seriesMid, AsusFan.Mid);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Program.config.setConfig("mid_fan", 1);
|
AppConfig.setConfig("mid_fan", 0);
|
||||||
chartMid.Visible = true;
|
}
|
||||||
SetChart(chartMid, 2);
|
|
||||||
LoadProfile(seriesMid, 2);
|
// XG Mobile Fan check
|
||||||
|
if (Program.acpi.IsXGConnected())
|
||||||
|
{
|
||||||
|
AppConfig.setConfig("xgm_fan", 1);
|
||||||
|
chartCount++;
|
||||||
|
chartXGM.Visible = true;
|
||||||
|
SetChart(chartXGM, AsusFan.XGM);
|
||||||
|
LoadProfile(seriesXGM, AsusFan.XGM);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AppConfig.setConfig("xgm_fan", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (chartCount > 2)
|
||||||
|
Size = MinimumSize = new Size(0, (int)(ControlHelper.GetDpiScale(this).Value * (chartCount * 200 + 100)));
|
||||||
|
} catch (Exception ex)
|
||||||
|
{
|
||||||
|
Debug.WriteLine(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SetChart(chartCPU, 0);
|
SetChart(chartCPU, AsusFan.CPU);
|
||||||
SetChart(chartGPU, 1);
|
SetChart(chartGPU, AsusFan.GPU);
|
||||||
|
|
||||||
LoadProfile(seriesCPU, 0);
|
LoadProfile(seriesCPU, AsusFan.CPU);
|
||||||
LoadProfile(seriesGPU, 1);
|
LoadProfile(seriesGPU, AsusFan.GPU);
|
||||||
|
|
||||||
int auto_apply = Program.config.getConfigPerf("auto_apply");
|
int auto_apply = AppConfig.getConfigPerf("auto_apply");
|
||||||
|
|
||||||
checkApplyFans.Checked = (auto_apply == 1);
|
checkApplyFans.Checked = (auto_apply == 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LoadProfile(Series series, int device, int def = 0)
|
void LoadProfile(Series series, AsusFan device, bool reset = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
series.ChartType = SeriesChartType.Line;
|
series.ChartType = SeriesChartType.Line;
|
||||||
@@ -431,14 +518,19 @@ namespace GHelper
|
|||||||
|
|
||||||
series.Points.Clear();
|
series.Points.Clear();
|
||||||
|
|
||||||
int mode = Program.config.getConfig("performance_mode");
|
int mode = AppConfig.getConfig("performance_mode");
|
||||||
byte[] curve = Program.config.getFanConfig(device);
|
byte[] curve = AppConfig.getFanConfig(device);
|
||||||
|
|
||||||
if (def == 1 || curve.Length != 16)
|
if (reset || AsusACPI.IsInvalidCurve(curve))
|
||||||
curve = Program.wmi.GetFanCurve(device, mode);
|
{
|
||||||
|
curve = Program.acpi.GetFanCurve(device, mode);
|
||||||
|
|
||||||
if (curve.Length != 16 || curve.All(singleByte => singleByte == 0))
|
if (AsusACPI.IsInvalidCurve(curve))
|
||||||
curve = Program.config.getDefaultCurve(device);
|
curve = AppConfig.getDefaultCurve(device);
|
||||||
|
|
||||||
|
curve = AsusACPI.FixFanCurve(curve);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//Debug.WriteLine(BitConverter.ToString(curve));
|
//Debug.WriteLine(BitConverter.ToString(curve));
|
||||||
|
|
||||||
@@ -454,7 +546,7 @@ namespace GHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SaveProfile(Series series, int device)
|
void SaveProfile(Series series, AsusFan device)
|
||||||
{
|
{
|
||||||
byte[] curve = new byte[16];
|
byte[] curve = new byte[16];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@@ -465,7 +557,7 @@ namespace GHelper
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
Program.config.setFanConfig(device, curve);
|
AppConfig.setFanConfig(device, curve);
|
||||||
//Program.wmi.SetFanCurve(device, curve);
|
//Program.wmi.SetFanCurve(device, curve);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -474,18 +566,37 @@ namespace GHelper
|
|||||||
private void ButtonReset_Click(object? sender, EventArgs e)
|
private void ButtonReset_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
LoadProfile(seriesCPU, 0, 1);
|
LoadProfile(seriesCPU, AsusFan.CPU, true);
|
||||||
LoadProfile(seriesGPU, 1, 1);
|
LoadProfile(seriesGPU, AsusFan.GPU, true);
|
||||||
if (Program.config.getConfig("mid_fan") == 1)
|
|
||||||
LoadProfile(seriesMid, 2, 1);
|
if (AppConfig.isConfig("mid_fan"))
|
||||||
|
LoadProfile(seriesMid, AsusFan.Mid, true);
|
||||||
|
|
||||||
|
if (AppConfig.isConfig("xgm_fan"))
|
||||||
|
LoadProfile(seriesXGM, AsusFan.XGM, true);
|
||||||
|
|
||||||
checkApplyFans.Checked = false;
|
checkApplyFans.Checked = false;
|
||||||
checkApplyPower.Checked = false;
|
checkApplyPower.Checked = false;
|
||||||
|
|
||||||
Program.config.setConfigPerf("auto_apply", 0);
|
AppConfig.setConfigPerf("auto_apply", 0);
|
||||||
Program.config.setConfigPerf("auto_apply_power", 0);
|
AppConfig.setConfigPerf("auto_apply_power", 0);
|
||||||
|
|
||||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
|
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AppConfig.getConfig("performance_mode"), "PerfMode");
|
||||||
|
if (Program.acpi.IsXGConnected()) AsusUSB.ResetXGM();
|
||||||
|
|
||||||
|
trackGPUCore.Value = 0;
|
||||||
|
trackGPUMemory.Value = 0;
|
||||||
|
trackGPUBoost.Value = AsusACPI.MaxGPUBoost;
|
||||||
|
trackGPUTemp.Value = AsusACPI.MaxGPUTemp;
|
||||||
|
|
||||||
|
AppConfig.setConfigPerf("gpu_boost", trackGPUBoost.Value);
|
||||||
|
AppConfig.setConfigPerf("gpu_temp", trackGPUTemp.Value);
|
||||||
|
AppConfig.setConfigPerf("gpu_core", trackGPUCore.Value);
|
||||||
|
AppConfig.setConfigPerf("gpu_memory", trackGPUMemory.Value);
|
||||||
|
VisualiseGPUSettings();
|
||||||
|
|
||||||
|
Program.settingsForm.SetGPUClocks(true);
|
||||||
|
Program.settingsForm.SetGPUPower();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ChartCPU_MouseUp(object? sender, MouseEventArgs e)
|
private void ChartCPU_MouseUp(object? sender, MouseEventArgs e)
|
||||||
@@ -493,10 +604,14 @@ namespace GHelper
|
|||||||
curPoint = null;
|
curPoint = null;
|
||||||
labelTip.Visible = false;
|
labelTip.Visible = false;
|
||||||
|
|
||||||
SaveProfile(seriesCPU, 0);
|
SaveProfile(seriesCPU, AsusFan.CPU);
|
||||||
SaveProfile(seriesGPU, 1);
|
SaveProfile(seriesGPU, AsusFan.GPU);
|
||||||
if (Program.config.getConfig("mid_fan") == 1)
|
|
||||||
SaveProfile(seriesMid, 2);
|
if (AppConfig.isConfig("mid_fan"))
|
||||||
|
SaveProfile(seriesMid, AsusFan.Mid);
|
||||||
|
|
||||||
|
if (AppConfig.isConfig("xgm_fan"))
|
||||||
|
SaveProfile(seriesXGM, AsusFan.XGM);
|
||||||
|
|
||||||
Program.settingsForm.AutoFans();
|
Program.settingsForm.AutoFans();
|
||||||
|
|
||||||
@@ -537,7 +652,7 @@ namespace GHelper
|
|||||||
if (dx > 100) dx = 100;
|
if (dx > 100) dx = 100;
|
||||||
|
|
||||||
if (dy < 0) dy = 0;
|
if (dy < 0) dy = 0;
|
||||||
if (dy > 100) dy = 100;
|
if (dy > fansMax) dy = fansMax;
|
||||||
|
|
||||||
dymin = (dx - 65) * 1.2;
|
dymin = (dx - 65) * 1.2;
|
||||||
|
|
||||||
|
|||||||
@@ -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: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:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||||
<AssemblyVersion>0.58</AssemblyVersion>
|
<AssemblyVersion>0.71</AssemblyVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
@@ -59,8 +59,10 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="FftSharp" Version="2.0.0" />
|
||||||
<PackageReference Include="hidlibrary" Version="3.3.40" />
|
<PackageReference Include="hidlibrary" Version="3.3.40" />
|
||||||
<PackageReference Include="HidSharpCore" Version="1.2.1.1" />
|
<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="System.Management" Version="7.0.1" />
|
||||||
<PackageReference Include="TaskScheduler" Version="2.10.1" />
|
<PackageReference Include="TaskScheduler" Version="2.10.1" />
|
||||||
<PackageReference Include="WinForms.DataVisualization" Version="1.8.0" />
|
<PackageReference Include="WinForms.DataVisualization" Version="1.8.0" />
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ public class AmdGpuControl : IGpuControl {
|
|||||||
|
|
||||||
public bool IsNvidia => false;
|
public bool IsNvidia => false;
|
||||||
|
|
||||||
|
public string FullName => _internalDiscreteAdapter!.AdapterName;
|
||||||
public AmdGpuControl() {
|
public AmdGpuControl() {
|
||||||
if (!Adl2.Load())
|
if (!Adl2.Load())
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
namespace GHelper.Gpu;
|
namespace GHelper.Gpu;
|
||||||
|
|
||||||
public interface IGpuControl : IDisposable {
|
public interface IGpuControl : IDisposable {
|
||||||
bool IsNvidia { get; }
|
bool IsNvidia { get; }
|
||||||
bool IsValid { get; }
|
bool IsValid { get; }
|
||||||
|
public string FullName { get; }
|
||||||
int? GetCurrentTemperature();
|
int? GetCurrentTemperature();
|
||||||
int? GetGpuUse();
|
int? GetGpuUse();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
using NvAPIWrapper.GPU;
|
using NvAPIWrapper;
|
||||||
|
using NvAPIWrapper.GPU;
|
||||||
using NvAPIWrapper.Native;
|
using NvAPIWrapper.Native;
|
||||||
|
using NvAPIWrapper.Native.Delegates;
|
||||||
using NvAPIWrapper.Native.GPU;
|
using NvAPIWrapper.Native.GPU;
|
||||||
using NvAPIWrapper.Native.GPU.Structures;
|
using NvAPIWrapper.Native.GPU.Structures;
|
||||||
using NvAPIWrapper.Native.Interfaces.GPU;
|
using NvAPIWrapper.Native.Interfaces.GPU;
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Management;
|
||||||
using static NvAPIWrapper.Native.GPU.Structures.PerformanceStates20InfoV1;
|
using static NvAPIWrapper.Native.GPU.Structures.PerformanceStates20InfoV1;
|
||||||
|
|
||||||
namespace GHelper.Gpu;
|
namespace GHelper.Gpu;
|
||||||
@@ -16,7 +21,7 @@ public class NvidiaGpuControl : IGpuControl
|
|||||||
public const int MinCoreOffset = -250;
|
public const int MinCoreOffset = -250;
|
||||||
public const int MinMemoryOffset = -250;
|
public const int MinMemoryOffset = -250;
|
||||||
|
|
||||||
private readonly PhysicalGPU? _internalGpu;
|
private static PhysicalGPU? _internalGpu;
|
||||||
|
|
||||||
public NvidiaGpuControl()
|
public NvidiaGpuControl()
|
||||||
{
|
{
|
||||||
@@ -27,10 +32,11 @@ public class NvidiaGpuControl : IGpuControl
|
|||||||
|
|
||||||
public bool IsNvidia => IsValid;
|
public bool IsNvidia => IsValid;
|
||||||
|
|
||||||
|
public string FullName => _internalGpu!.FullName;
|
||||||
|
|
||||||
public int? GetCurrentTemperature()
|
public int? GetCurrentTemperature()
|
||||||
{
|
{
|
||||||
if (!IsValid)
|
if (!IsValid) return null;
|
||||||
return null;
|
|
||||||
|
|
||||||
PhysicalGPU internalGpu = _internalGpu!;
|
PhysicalGPU internalGpu = _internalGpu!;
|
||||||
IThermalSensor? gpuSensor =
|
IThermalSensor? gpuSensor =
|
||||||
@@ -44,26 +50,122 @@ public class NvidiaGpuControl : IGpuControl
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void KillGPUApps()
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!IsValid) return;
|
||||||
|
PhysicalGPU internalGpu = _internalGpu!;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Process[] processes = internalGpu.GetActiveApplications();
|
||||||
|
foreach (Process process in processes)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
process?.Kill();
|
||||||
|
Logger.WriteLine("Stopped: " + process.ProcessName);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.WriteLine(ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.WriteLine(ex.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void GetClocks(out int core, out int memory)
|
|
||||||
|
//NVIDIA.RestartDisplayDriver();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int GetClocks(out int core, out int memory)
|
||||||
{
|
{
|
||||||
PhysicalGPU internalGpu = _internalGpu!;
|
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;
|
} catch (Exception ex)
|
||||||
memory = states.Clocks[PerformanceStateId.P0_3DPerformance][1].FrequencyDeltaInkHz.DeltaValue / 1000;
|
{
|
||||||
|
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()
|
public int SetClocksFromConfig()
|
||||||
{
|
{
|
||||||
int core = Program.config.getConfig("gpu_core");
|
int core = AppConfig.getConfig("gpu_core");
|
||||||
int memory = Program.config.getConfig("gpu_memory");
|
int memory = AppConfig.getConfig("gpu_memory");
|
||||||
int status = SetClocks(core, memory);
|
int status = SetClocks(core, memory);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@@ -79,7 +181,7 @@ public class NvidiaGpuControl : IGpuControl
|
|||||||
var coreClock = new PerformanceStates20ClockEntryV1(PublicClockDomain.Graphics, new PerformanceStates20ParameterDelta(core * 1000));
|
var coreClock = new PerformanceStates20ClockEntryV1(PublicClockDomain.Graphics, new PerformanceStates20ParameterDelta(core * 1000));
|
||||||
var memoryClock = new PerformanceStates20ClockEntryV1(PublicClockDomain.Memory, new PerformanceStates20ParameterDelta(memory * 1000));
|
var memoryClock = new PerformanceStates20ClockEntryV1(PublicClockDomain.Memory, new PerformanceStates20ParameterDelta(memory * 1000));
|
||||||
|
|
||||||
PerformanceStates20ClockEntryV1[] clocks = { coreClock , memoryClock};
|
PerformanceStates20ClockEntryV1[] clocks = { coreClock, memoryClock };
|
||||||
PerformanceStates20BaseVoltageEntryV1[] voltages = { };
|
PerformanceStates20BaseVoltageEntryV1[] voltages = { };
|
||||||
|
|
||||||
PerformanceState20[] performanceStates = { new PerformanceState20(PerformanceStateId.P0_3DPerformance, clocks, voltages) };
|
PerformanceState20[] performanceStates = { new PerformanceState20(PerformanceStateId.P0_3DPerformance, clocks, voltages) };
|
||||||
@@ -88,11 +190,12 @@ public class NvidiaGpuControl : IGpuControl
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
Logger.WriteLine($"SET GPU CLOCKS: {core}, {memory}");
|
||||||
GPUApi.SetPerformanceStates20(internalGpu.Handle, overclock);
|
GPUApi.SetPerformanceStates20(internalGpu.Handle, overclock);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.WriteLine(ex.ToString());
|
Logger.WriteLine("SET GPU CLOCKS: "+ex.Message);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,7 +214,7 @@ public class NvidiaGpuControl : IGpuControl
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.WriteLine(ex.ToString());
|
Debug.WriteLine(ex.Message);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
using GHelper.Gpu;
|
using GHelper.Gpu;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
|
||||||
public static class HardwareMonitor
|
public static class HardwareControl
|
||||||
{
|
{
|
||||||
public static IGpuControl? GpuControl;
|
public static IGpuControl? GpuControl;
|
||||||
|
|
||||||
@@ -19,14 +19,14 @@ public static class HardwareMonitor
|
|||||||
public static int GetFanMax()
|
public static int GetFanMax()
|
||||||
{
|
{
|
||||||
int max = 58;
|
int max = 58;
|
||||||
if (Program.config.ContainsModel("401")) max = 72;
|
if (AppConfig.ContainsModel("401")) max = 72;
|
||||||
else if (Program.config.ContainsModel("503")) max = 68;
|
else if (AppConfig.ContainsModel("503")) max = 68;
|
||||||
return Math.Max(max, Program.config.getConfig("fan_max"));
|
return Math.Max(max, AppConfig.getConfig("fan_max"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetFanMax(int fan)
|
public static void SetFanMax(int fan)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("fan_max", fan);
|
AppConfig.setConfig("fan_max", fan);
|
||||||
}
|
}
|
||||||
private static string FormatFan(int fan)
|
private static string FormatFan(int fan)
|
||||||
{
|
{
|
||||||
@@ -38,12 +38,12 @@ public static class HardwareMonitor
|
|||||||
}
|
}
|
||||||
|
|
||||||
int fanMax = GetFanMax();
|
int fanMax = GetFanMax();
|
||||||
if (fan > fanMax) SetFanMax(fan);
|
if (fan > fanMax && fan < 110) SetFanMax(fan);
|
||||||
|
|
||||||
if (Program.config.getConfig("fan_rpm") == 1)
|
if (AppConfig.getConfig("fan_rpm") == 1)
|
||||||
return " Fan: " + (fan * 100).ToString() + "RPM";
|
return GHelper.Properties.Strings.FanSpeed + (fan * 100).ToString() + "RPM";
|
||||||
else
|
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()
|
private static int GetGpuUse()
|
||||||
@@ -51,6 +51,7 @@ public static class HardwareMonitor
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
int? gpuUse = GpuControl?.GetGpuUse();
|
int? gpuUse = GpuControl?.GetGpuUse();
|
||||||
|
Logger.WriteLine("GPU usage: " + GpuControl?.FullName + " " + gpuUse + "%");
|
||||||
if (gpuUse is not null) return (int)gpuUse;
|
if (gpuUse is not null) return (int)gpuUse;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -68,11 +69,11 @@ public static class HardwareMonitor
|
|||||||
gpuTemp = -1;
|
gpuTemp = -1;
|
||||||
gpuUse = -1;
|
gpuUse = -1;
|
||||||
|
|
||||||
cpuFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.CPU_Fan));
|
cpuFan = FormatFan(Program.acpi.DeviceGet(AsusACPI.CPU_Fan));
|
||||||
gpuFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.GPU_Fan));
|
gpuFan = FormatFan(Program.acpi.DeviceGet(AsusACPI.GPU_Fan));
|
||||||
midFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.Mid_Fan));
|
midFan = FormatFan(Program.acpi.DeviceGet(AsusACPI.Mid_Fan));
|
||||||
|
|
||||||
cpuTemp = Program.wmi.DeviceGet(ASUSWmi.Temp_CPU);
|
cpuTemp = Program.acpi.DeviceGet(AsusACPI.Temp_CPU);
|
||||||
|
|
||||||
if (cpuTemp < 0) try
|
if (cpuTemp < 0) try
|
||||||
{
|
{
|
||||||
@@ -81,9 +82,9 @@ public static class HardwareMonitor
|
|||||||
cpuTemp = ct.NextValue() - 273;
|
cpuTemp = ct.NextValue() - 273;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Debug.WriteLine("Failed reading CPU temp");
|
Debug.WriteLine("Failed reading CPU temp :" + ex.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -94,12 +95,11 @@ public static class HardwareMonitor
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
gpuTemp = -1;
|
gpuTemp = -1;
|
||||||
Debug.WriteLine("Failed reading GPU temp");
|
Debug.WriteLine("Failed reading GPU temp :" + ex.Message);
|
||||||
Debug.WriteLine(ex.ToString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gpuTemp is null || gpuTemp < 0)
|
if (gpuTemp is null || gpuTemp < 0)
|
||||||
gpuTemp = Program.wmi.DeviceGet(ASUSWmi.Temp_GPU);
|
gpuTemp = Program.acpi.DeviceGet(AsusACPI.Temp_GPU);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -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)
|
if (GetGpuUse() > threshold)
|
||||||
{
|
{
|
||||||
@@ -124,9 +124,17 @@ public static class HardwareMonitor
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static NvidiaGpuControl? GetNvidiaGpuControl()
|
||||||
|
{
|
||||||
|
if ((bool)GpuControl?.IsNvidia)
|
||||||
|
return (NvidiaGpuControl)GpuControl;
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public static void RecreateGpuControlWithDelay(int delay = 5)
|
public static void RecreateGpuControlWithDelay(int delay = 5)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Re-enabling the discrete GPU takes a bit of time,
|
// Re-enabling the discrete GPU takes a bit of time,
|
||||||
// so a simple workaround is to refresh again after that happens
|
// so a simple workaround is to refresh again after that happens
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
@@ -134,9 +142,6 @@ public static class HardwareMonitor
|
|||||||
await Task.Delay(TimeSpan.FromSeconds(delay));
|
await Task.Delay(TimeSpan.FromSeconds(delay));
|
||||||
RecreateGpuControl();
|
RecreateGpuControl();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RecreateGpuControl()
|
public static void RecreateGpuControl()
|
||||||
@@ -145,28 +150,29 @@ public static class HardwareMonitor
|
|||||||
{
|
{
|
||||||
GpuControl?.Dispose();
|
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();
|
IGpuControl _gpuControl = new NvidiaGpuControl();
|
||||||
|
|
||||||
if (_gpuControl.IsValid)
|
if (_gpuControl.IsValid)
|
||||||
{
|
{
|
||||||
GpuControl = _gpuControl;
|
GpuControl = _gpuControl;
|
||||||
|
Logger.WriteLine(GpuControl.FullName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_gpuControl.Dispose();
|
_gpuControl.Dispose();
|
||||||
|
|
||||||
/*
|
|
||||||
_gpuControl = new AmdGpuControl();
|
_gpuControl = new AmdGpuControl();
|
||||||
if (_gpuControl.IsValid)
|
if (_gpuControl.IsValid)
|
||||||
{
|
{
|
||||||
GpuControl = _gpuControl;
|
GpuControl = _gpuControl;
|
||||||
|
Logger.WriteLine(GpuControl.FullName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_gpuControl.Dispose();
|
_gpuControl.Dispose();
|
||||||
*/
|
|
||||||
|
|
||||||
GpuControl = null;
|
GpuControl = null;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
361
app/InputDispatcher.cs
Normal file
361
app/InputDispatcher.cs
Normal file
@@ -0,0 +1,361 @@
|
|||||||
|
using HidLibrary;
|
||||||
|
using Microsoft.Win32;
|
||||||
|
using NAudio.CoreAudioApi;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Management;
|
||||||
|
using Tools;
|
||||||
|
|
||||||
|
namespace GHelper
|
||||||
|
{
|
||||||
|
public class KeyboardListener
|
||||||
|
{
|
||||||
|
|
||||||
|
CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
|
||||||
|
|
||||||
|
public KeyboardListener(Action<int> KeyHandler)
|
||||||
|
{
|
||||||
|
HidDevice? input = AsusUSB.GetDevice();
|
||||||
|
if (input == null) return;
|
||||||
|
|
||||||
|
Logger.WriteLine($"Input: {input.DevicePath}");
|
||||||
|
|
||||||
|
var task = Task.Run(() =>
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
while (!cancellationTokenSource.Token.IsCancellationRequested)
|
||||||
|
{
|
||||||
|
var data = input.Read().Data;
|
||||||
|
if (data.Length > 1 && data[0] == AsusUSB.INPUT_HID_ID && data[1] > 0)
|
||||||
|
{
|
||||||
|
Logger.WriteLine($"Key: {data[1]}");
|
||||||
|
KeyHandler(data[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Logger.WriteLine("Listener stopped");
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.WriteLine(ex.ToString());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
cancellationTokenSource?.Cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class InputDispatcher
|
||||||
|
{
|
||||||
|
System.Timers.Timer timer = new System.Timers.Timer(1000);
|
||||||
|
public bool backlight = true;
|
||||||
|
|
||||||
|
private static nint windowHandle;
|
||||||
|
|
||||||
|
public static Keys keyProfile = Keys.F5;
|
||||||
|
public static Keys keyApp = Keys.F12;
|
||||||
|
|
||||||
|
KeyboardListener listener;
|
||||||
|
|
||||||
|
KeyHandler m1, m2, handlerProfile, handlerApp;
|
||||||
|
|
||||||
|
public InputDispatcher(nint handle)
|
||||||
|
{
|
||||||
|
|
||||||
|
windowHandle = handle;
|
||||||
|
|
||||||
|
byte[] result = Program.acpi.DeviceInit();
|
||||||
|
Debug.WriteLine($"Init: {BitConverter.ToString(result)}");
|
||||||
|
|
||||||
|
Program.acpi.SubscribeToEvents(WatcherEventArrived);
|
||||||
|
//Task.Run(Program.acpi.RunListener);
|
||||||
|
|
||||||
|
// CTRL + SHIFT + F5 to cycle profiles
|
||||||
|
if (AppConfig.getConfig("keybind_profile") != -1) keyProfile = (Keys)AppConfig.getConfig("keybind_profile");
|
||||||
|
|
||||||
|
handlerProfile = new KeyHandler(KeyHandler.SHIFT | KeyHandler.CTRL, keyProfile, windowHandle);
|
||||||
|
handlerApp = new KeyHandler(KeyHandler.SHIFT | KeyHandler.CTRL, keyApp, windowHandle);
|
||||||
|
|
||||||
|
m1 = new KeyHandler(KeyHandler.NOMOD, Keys.VolumeDown, windowHandle);
|
||||||
|
m2 = new KeyHandler(KeyHandler.NOMOD, Keys.VolumeUp, windowHandle);
|
||||||
|
|
||||||
|
RegisterKeys();
|
||||||
|
|
||||||
|
timer.Elapsed += Timer_Elapsed;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Timer_Elapsed(object? sender, System.Timers.ElapsedEventArgs e)
|
||||||
|
{
|
||||||
|
TimeSpan iddle = NativeMethods.GetIdleTime();
|
||||||
|
|
||||||
|
int kb_timeout;
|
||||||
|
|
||||||
|
if (SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online)
|
||||||
|
kb_timeout = AppConfig.getConfig("keyboard_ac_timeout", 0);
|
||||||
|
else
|
||||||
|
kb_timeout = AppConfig.getConfig("keyboard_timeout", 60);
|
||||||
|
|
||||||
|
if (kb_timeout == 0) return;
|
||||||
|
|
||||||
|
if (backlight && iddle.TotalSeconds > kb_timeout)
|
||||||
|
{
|
||||||
|
backlight = false;
|
||||||
|
AsusUSB.ApplyBrightness(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!backlight && iddle.TotalSeconds < kb_timeout)
|
||||||
|
{
|
||||||
|
backlight = true;
|
||||||
|
AsusUSB.ApplyBrightness(AppConfig.getConfig("keyboard_brightness"));
|
||||||
|
}
|
||||||
|
|
||||||
|
//Debug.WriteLine(iddle.TotalSeconds);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Init()
|
||||||
|
{
|
||||||
|
if (listener is not null) listener.Dispose();
|
||||||
|
|
||||||
|
Program.acpi.DeviceInit();
|
||||||
|
|
||||||
|
if (!OptimizationService.IsRunning())
|
||||||
|
listener = new KeyboardListener(HandleEvent);
|
||||||
|
|
||||||
|
InitBacklightTimer();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void InitBacklightTimer()
|
||||||
|
{
|
||||||
|
timer.Enabled = (AppConfig.getConfig("keyboard_timeout") > 0 && SystemInformation.PowerStatus.PowerLineStatus != PowerLineStatus.Online) ||
|
||||||
|
(AppConfig.getConfig("keyboard_ac_timeout") > 0 && SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void RegisterKeys()
|
||||||
|
{
|
||||||
|
|
||||||
|
string actionM1 = AppConfig.getConfigString("m1");
|
||||||
|
string actionM2 = AppConfig.getConfigString("m2");
|
||||||
|
|
||||||
|
handlerProfile.Unregiser();
|
||||||
|
m1.Unregiser();
|
||||||
|
m2.Unregiser();
|
||||||
|
|
||||||
|
if (keyProfile != Keys.None) handlerProfile.Register();
|
||||||
|
if (keyApp != Keys.None) handlerApp.Register();
|
||||||
|
|
||||||
|
if (actionM1 is not null && actionM1.Length > 0) m1.Register();
|
||||||
|
|
||||||
|
if (actionM2 is not null && actionM2.Length > 0) m2.Register();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static void CustomKey(string configKey = "m3")
|
||||||
|
{
|
||||||
|
string command = AppConfig.getConfigString(configKey + "_custom");
|
||||||
|
int intKey;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
intKey = Convert.ToInt32(command, 16);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
intKey = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (intKey > 0)
|
||||||
|
NativeMethods.KeyPress(intKey);
|
||||||
|
else
|
||||||
|
LaunchProcess(command);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void KeyProcess(string name = "m3")
|
||||||
|
{
|
||||||
|
string action = AppConfig.getConfigString(name);
|
||||||
|
|
||||||
|
if (action is null || action.Length <= 1)
|
||||||
|
{
|
||||||
|
if (name == "m4")
|
||||||
|
action = "ghelper";
|
||||||
|
if (name == "fnf4")
|
||||||
|
action = "aura";
|
||||||
|
if (name == "fnf5")
|
||||||
|
action = "performance";
|
||||||
|
if (name == "m3" && !OptimizationService.IsRunning())
|
||||||
|
action = "micmute";
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (action)
|
||||||
|
{
|
||||||
|
case "mute":
|
||||||
|
NativeMethods.KeyPress(NativeMethods.VK_VOLUME_MUTE);
|
||||||
|
break;
|
||||||
|
case "play":
|
||||||
|
NativeMethods.KeyPress(NativeMethods.VK_MEDIA_PLAY_PAUSE);
|
||||||
|
break;
|
||||||
|
case "screenshot":
|
||||||
|
NativeMethods.KeyPress(NativeMethods.VK_SNAPSHOT);
|
||||||
|
break;
|
||||||
|
case "screen":
|
||||||
|
NativeMethods.TurnOffScreen(Program.settingsForm.Handle);
|
||||||
|
break;
|
||||||
|
case "miniled":
|
||||||
|
Program.settingsForm.BeginInvoke(Program.settingsForm.ToogleMiniled);
|
||||||
|
break;
|
||||||
|
case "aura":
|
||||||
|
Program.settingsForm.BeginInvoke(Program.settingsForm.CycleAuraMode);
|
||||||
|
break;
|
||||||
|
case "performance":
|
||||||
|
Program.settingsForm.BeginInvoke(Program.settingsForm.CyclePerformanceMode);
|
||||||
|
break;
|
||||||
|
case "ghelper":
|
||||||
|
Program.settingsForm.BeginInvoke(delegate
|
||||||
|
{
|
||||||
|
Program.SettingsToggle();
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case "custom":
|
||||||
|
CustomKey(name);
|
||||||
|
break;
|
||||||
|
case "micmute":
|
||||||
|
using (var enumerator = new MMDeviceEnumerator())
|
||||||
|
{
|
||||||
|
var commDevice = enumerator.GetDefaultAudioEndpoint(DataFlow.Capture, Role.Communications);
|
||||||
|
bool muteStatus = !commDevice.AudioEndpointVolume.Mute;
|
||||||
|
commDevice.AudioEndpointVolume.Mute = muteStatus;
|
||||||
|
Program.settingsForm.BeginInvoke(Program.settingsForm.RunToast, muteStatus ? "Muted" : "Unmuted", muteStatus ? ToastIcon.MicrophoneMute : ToastIcon.Microphone);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool GetTouchpadState()
|
||||||
|
{
|
||||||
|
using (var key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\PrecisionTouchPad\Status", false))
|
||||||
|
{
|
||||||
|
return (key?.GetValue("Enabled")?.ToString() == "1");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void TabletMode()
|
||||||
|
{
|
||||||
|
bool touchpadState = GetTouchpadState();
|
||||||
|
bool tabletState = Program.acpi.DeviceGet(AsusACPI.TabletState) > 0;
|
||||||
|
|
||||||
|
Logger.WriteLine("Tablet: " + tabletState + " Touchpad: " + touchpadState);
|
||||||
|
|
||||||
|
if ((tabletState && touchpadState) || (!tabletState && !touchpadState)) AsusUSB.TouchpadToggle();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static void HandleEvent(int EventID)
|
||||||
|
{
|
||||||
|
switch (EventID)
|
||||||
|
{
|
||||||
|
case 124: // M3
|
||||||
|
KeyProcess("m3");
|
||||||
|
return;
|
||||||
|
case 56: // M4 / Rog button
|
||||||
|
KeyProcess("m4");
|
||||||
|
return;
|
||||||
|
case 174: // FN+F5
|
||||||
|
Program.settingsForm.BeginInvoke(Program.settingsForm.CyclePerformanceMode);
|
||||||
|
return;
|
||||||
|
case 179: // FN+F4
|
||||||
|
case 178: // FN+F4
|
||||||
|
KeyProcess("fnf4");
|
||||||
|
return;
|
||||||
|
case 189: // Tablet mode
|
||||||
|
TabletMode();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (OptimizationService.IsRunning()) return;
|
||||||
|
|
||||||
|
// Asus Optimization service Events
|
||||||
|
|
||||||
|
int backlight = AppConfig.getConfig("keyboard_brightness");
|
||||||
|
string[] backlightNames = new string[] { "Off", "Low", "Mid", "Max" };
|
||||||
|
|
||||||
|
switch (EventID)
|
||||||
|
{
|
||||||
|
case 197: // FN+F2
|
||||||
|
backlight = Math.Max(0, backlight - 1);
|
||||||
|
AppConfig.setConfig("keyboard_brightness", backlight);
|
||||||
|
AsusUSB.ApplyBrightness(backlight);
|
||||||
|
Program.settingsForm.BeginInvoke(Program.settingsForm.RunToast, backlightNames[backlight], ToastIcon.BacklightDown);
|
||||||
|
break;
|
||||||
|
case 196: // FN+F3
|
||||||
|
backlight = Math.Min(3, backlight + 1);
|
||||||
|
AppConfig.setConfig("keyboard_brightness", backlight);
|
||||||
|
AsusUSB.ApplyBrightness(backlight);
|
||||||
|
Program.settingsForm.BeginInvoke(Program.settingsForm.RunToast, backlightNames[backlight], ToastIcon.BacklightUp);
|
||||||
|
break;
|
||||||
|
case 199: // ON Z13 - FN+F11 - cycles backlight
|
||||||
|
if (++backlight > 3) backlight = 0;
|
||||||
|
AppConfig.setConfig("keyboard_brightness", backlight);
|
||||||
|
AsusUSB.ApplyBrightness(backlight);
|
||||||
|
Program.settingsForm.BeginInvoke(Program.settingsForm.RunToast, backlightNames[backlight], ToastIcon.BacklightUp);
|
||||||
|
break;
|
||||||
|
case 16: // FN+F7
|
||||||
|
Program.acpi.DeviceSet(AsusACPI.UniversalControl, 0x10, "Brightness");
|
||||||
|
break;
|
||||||
|
case 32: // FN+F8
|
||||||
|
Program.acpi.DeviceSet(AsusACPI.UniversalControl, 0x20, "Brightness");
|
||||||
|
break;
|
||||||
|
case 107: // FN+F10
|
||||||
|
bool touchpadState = GetTouchpadState();
|
||||||
|
AsusUSB.TouchpadToggle();
|
||||||
|
Program.settingsForm.BeginInvoke(Program.settingsForm.RunToast, touchpadState ? "Off" : "On", ToastIcon.Touchpad);
|
||||||
|
break;
|
||||||
|
case 108: // FN+F11
|
||||||
|
Program.acpi.DeviceSet(AsusACPI.UniversalControl, 0x6c, "Sleep");
|
||||||
|
//NativeMethods.SetSuspendState(false, true, true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void LaunchProcess(string command = "")
|
||||||
|
{
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string executable = command.Split(' ')[0];
|
||||||
|
string arguments = command.Substring(executable.Length).Trim();
|
||||||
|
Process proc = Process.Start(executable, arguments);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
Logger.WriteLine("Failed to run " + command);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void WatcherEventArrived(object sender, EventArrivedEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.NewEvent is null) return;
|
||||||
|
int EventID = int.Parse(e.NewEvent["EventID"].ToString());
|
||||||
|
Logger.WriteLine("WMI event " + EventID);
|
||||||
|
HandleEvent(EventID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TrackBar;
|
||||||
using static Tools.ScreenInterrogatory;
|
using static Tools.ScreenInterrogatory;
|
||||||
|
|
||||||
namespace Tools
|
namespace Tools
|
||||||
@@ -351,6 +352,25 @@ namespace Tools
|
|||||||
public class NativeMethods
|
public class NativeMethods
|
||||||
{
|
{
|
||||||
|
|
||||||
|
internal struct LASTINPUTINFO
|
||||||
|
{
|
||||||
|
public uint cbSize;
|
||||||
|
public uint dwTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
[DllImport("User32.dll")]
|
||||||
|
private static extern bool GetLastInputInfo(ref LASTINPUTINFO plii);
|
||||||
|
|
||||||
|
public static TimeSpan GetIdleTime()
|
||||||
|
{
|
||||||
|
LASTINPUTINFO lastInPut = new LASTINPUTINFO();
|
||||||
|
lastInPut.cbSize = (uint)Marshal.SizeOf(lastInPut);
|
||||||
|
GetLastInputInfo(ref lastInPut);
|
||||||
|
return TimeSpan.FromMilliseconds((uint)Environment.TickCount - lastInPut.dwTime);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private const int WM_SYSCOMMAND = 0x0112;
|
private const int WM_SYSCOMMAND = 0x0112;
|
||||||
private const int SC_MONITORPOWER = 0xF170;
|
private const int SC_MONITORPOWER = 0xF170;
|
||||||
private const int MONITOR_OFF = 2;
|
private const int MONITOR_OFF = 2;
|
||||||
@@ -435,6 +455,10 @@ public class NativeMethods
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[DllImport("Powrprof.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
|
||||||
|
public static extern bool SetSuspendState(bool hiberate, bool forceCritical, bool disableWakeEvent);
|
||||||
|
|
||||||
|
|
||||||
public const int KEYEVENTF_EXTENDEDKEY = 1;
|
public const int KEYEVENTF_EXTENDEDKEY = 1;
|
||||||
public const int KEYEVENTF_KEYUP = 2;
|
public const int KEYEVENTF_KEYUP = 2;
|
||||||
|
|
||||||
@@ -647,12 +671,14 @@ public class NativeMethods
|
|||||||
//Logger.WriteLine(screen.DeviceName);
|
//Logger.WriteLine(screen.DeviceName);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (displayNum > 0 && count == 0) laptopScreen = defaultDevice;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.WriteLine(ex.ToString());
|
Logger.WriteLine(ex.ToString());
|
||||||
Logger.WriteLine("Can't detect internal screen");
|
Logger.WriteLine("Can't detect internal screen");
|
||||||
//laptopScreen = Screen.PrimaryScreen.DeviceName;
|
laptopScreen = Screen.PrimaryScreen.DeviceName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -703,6 +729,7 @@ public class NativeMethods
|
|||||||
dm.dmDisplayFrequency = frequency;
|
dm.dmDisplayFrequency = frequency;
|
||||||
int iRet = NativeMethods.ChangeDisplaySettingsEx(laptopScreen, ref dm, IntPtr.Zero, DisplaySettingsFlags.CDS_UPDATEREGISTRY, IntPtr.Zero);
|
int iRet = NativeMethods.ChangeDisplaySettingsEx(laptopScreen, ref dm, IntPtr.Zero, DisplaySettingsFlags.CDS_UPDATEREGISTRY, IntPtr.Zero);
|
||||||
Logger.WriteLine("Screen = " + frequency.ToString() + "Hz : " + (iRet == 0 ? "OK" : iRet));
|
Logger.WriteLine("Screen = " + frequency.ToString() + "Hz : " + (iRet == 0 ? "OK" : iRet));
|
||||||
|
|
||||||
return iRet;
|
return iRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -761,6 +788,7 @@ public class NativeMethods
|
|||||||
{
|
{
|
||||||
PowerSetActiveScheme(IntPtr.Zero, new Guid(scheme));
|
PowerSetActiveScheme(IntPtr.Zero, new Guid(scheme));
|
||||||
PowerSetActiveOverlayScheme(new Guid(scheme));
|
PowerSetActiveOverlayScheme(new Guid(scheme));
|
||||||
|
Logger.WriteLine(scheme);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetPowerScheme(int mode)
|
public static void SetPowerScheme(int mode)
|
||||||
|
|||||||
@@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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]"}";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user