Compare commits

...

64 Commits
v0.61 ... v0.65

Author SHA1 Message Date
Serge
9794229f3f Extra icons for OSD 2023-05-20 22:59:17 +02:00
Serge
9f56959c67 Some OSD notifications 2023-05-20 21:51:02 +02:00
Serge
09e6676b7c Merge pull request #418 from marcelomijas/main
Update Spanish translation
2023-05-20 20:51:57 +02:00
Serge
6adb2e2fcf Keyboard Reading 2023-05-20 20:50:58 +02:00
Marcelo Moreno
08cc4409a9 Update Spanish translation 2023-05-20 20:37:54 +02:00
Serge
1ac0f2be08 Merge branch 'main' of https://github.com/seerge/g-helper 2023-05-20 14:28:08 +02:00
Serge
05e66d3b95 Tweaks 2023-05-20 14:28:05 +02:00
Serge
0f8f1e9ce5 Merge pull request #300 from tbateson/main
Add GitHub workflows
2023-05-20 11:51:42 +02:00
Thomas Bateson
d37b46c588 Add GitHub workflows 2023-05-19 13:32:31 -05:00
Serge
020a7d074f Some renamings 2023-05-19 19:14:07 +02:00
Serge
7eb7cc9f78 UI tweaks 2023-05-19 16:09:27 +02:00
Serge
38d60e88ea Fixed anime matrix crash 2023-05-19 13:46:49 +02:00
Serge
0cc16765b6 Update README.md 2023-05-19 11:27:24 +02:00
Serge
96f705806b Update README.md 2023-05-19 11:17:27 +02:00
Serge
d1cceda2ab UI Tweaks 2023-05-19 10:40:16 +02:00
Serge
381b4dd3e8 Merge pull request #409 from TomBonnot/main
Adding French and Português Version
2023-05-19 00:16:11 +02:00
Tom Bonnot
a99dcbf445 Last changes on portuguese-brazilian version + deleting .idea files 2023-05-18 18:12:44 -04:00
Tom Bonnot
4751383a3a Saving progress on pt-br translation 2023-05-18 15:50:32 -04:00
Serge
06320afcb3 Audio visualizer 2023-05-18 18:21:09 +02:00
Serge
0eb6209eda Matrix audio visualizer 2023-05-18 17:42:19 +02:00
Tom Bonnot
a342cab9a6 Final version for French translation 2023-05-18 11:40:02 -04:00
Tom Bonnot
12c6482f61 Adding pt-br and completion of fr version (might need some corrections) 2023-05-18 10:30:05 -04:00
Tom Bonnot
20933bfd8d First commit - French version 2023-05-18 09:51:30 -04:00
Serge
c66c8e9030 Custom keybinding for mode toggle 2023-05-17 20:33:41 +02:00
Serge
14b677514b Update README.md 2023-05-17 17:17:13 +02:00
Serge
ce266ffe07 Merge pull request #402 from IceStormNG/german-translation
German translation
2023-05-17 16:51:04 +02:00
Serge
f29410fa2a Merge branch 'main' of https://github.com/seerge/g-helper 2023-05-17 14:52:09 +02:00
Serge
7117b58746 ACPI events listener 2023-05-17 14:52:06 +02:00
Carsten Braun
0456fa013c Improbed a few translations and fixed typos. 2023-05-17 13:11:11 +02:00
Carsten Braun
6a4aa4e138 Localize fan speed labels in the main window 2023-05-17 10:47:41 +02:00
IceStormNG
d75067b40c Merge branch 'seerge:main' into german-translation 2023-05-17 10:39:02 +02:00
Carsten Braun
de45038911 Translated the App to German. Added a few additional resources for localization 2023-05-16 16:20:00 +02:00
Serge
e23c727e79 Update README.md 2023-05-16 15:44:30 +02:00
Serge
2f2c534278 Merge pull request #394 from lswlc33/main
Update Strings.zh-CN.resx
2023-05-16 15:21:34 +02:00
Serge
bdbec79aba UI tweaks 2023-05-16 15:19:53 +02:00
雪中明月
e3d0a04fa4 Update Strings.zh-CN.resx 2023-05-16 21:12:58 +08:00
Serge
4dd7d41cf4 Merge pull request #392 from IceStormNG/windows-power-plan-changes-optional
Windows power plan changes optional
2023-05-16 14:53:58 +02:00
Carsten Braun
8370217cef This is not a perf config but a regular config value. 2023-05-16 13:34:40 +02:00
Carsten Braun
63c1829edd We can reference the checkbox directly 2023-05-16 13:34:26 +02:00
Carsten Braun
69e5a0448e Accomodate for non-exitent settings value 2023-05-16 13:30:08 +02:00
Carsten Braun
b74b9ae257 Fix nullability 2023-05-16 13:29:48 +02:00
Carsten Braun
71e007d8ad Fixed UI that VS Forms Designer broke 2023-05-16 13:29:31 +02:00
Carsten Braun
6896166c3c Fixed French translation value 2023-05-16 12:36:26 +02:00
Carsten Braun
fd89d9c13a Changed string to "Power Mode" instead of "power plan" 2023-05-16 12:33:15 +02:00
Carsten Braun
8bec153da8 Fixed localization key for french 2023-05-16 12:30:57 +02:00
Carsten Braun
7d968f5f08 Do not set default value. 2023-05-16 12:24:06 +02:00
Carsten Braun
ac5fc3f96e Revert "Revert "Adjustment of Windows Power Overlay is now optional""
This reverts commit 8804d19567.
2023-05-16 12:21:28 +02:00
Serge
8590d0301a Merge pull request #391 from seerge/revert-385-windows-power-plan-changes-optional
Revert "Adjustment of Windows Power Overlay is now optional"
2023-05-16 11:39:41 +02:00
Serge
8804d19567 Revert "Adjustment of Windows Power Overlay is now optional" 2023-05-16 11:38:17 +02:00
Serge
57ce0631a3 Merge pull request #385 from IceStormNG/windows-power-plan-changes-optional
Adjustment of Windows Power Overlay is now optional
2023-05-16 11:30:41 +02:00
Carsten Braun
b796f9f9d4 Moved checkbox to 2023-05-16 10:41:02 +02:00
Serge
f39563fcdf Added touchpad toggle for tablet mode on x13/x16 2023-05-15 23:59:21 +02:00
Serge
853d0c231d Auto update 2023-05-15 22:23:16 +02:00
Serge
df3324d641 Auto update 2023-05-15 22:21:41 +02:00
Serge
75c90ee155 Merge branch 'main' of https://github.com/seerge/g-helper 2023-05-15 22:11:29 +02:00
Serge
4015e0a7f7 Added auto-update checker 2023-05-15 22:11:27 +02:00
Carsten Braun
2a82e41894 Adjustment of Windows Power Overlay is now optional 2023-05-15 13:23:20 +02:00
Serge
a5541dfe10 Update README.md 2023-05-14 19:52:02 +02:00
Serge
fd3a139c47 Aura tweaks 2023-05-14 10:28:48 +02:00
Serge
608b8571d4 Fix for turkish keyboard, tweak for default fan curves 2023-05-13 22:13:00 +02:00
Serge
82a39bcfa1 Merge pull request #375 from IceStormNG/animematrix-for-GU604
Supports AniMeMatrix for Zephyrus M16 2023 (GU604)
2023-05-13 18:24:37 +02:00
Carsten Braun
f9ccd92dc6 Supports AniMeMatrix for Zephyrus M16 2023 (GU604) 2023-05-13 18:10:18 +02:00
Serge
1fadc6c31e Hotfix for possible crash 2023-05-13 09:43:26 +02:00
Serge
0b7dd42a5d UI tweak 2023-05-12 17:21:04 +02:00
48 changed files with 2500 additions and 772 deletions

25
.github/workflows/build.yml vendored Normal file
View 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
View 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
View 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

View File

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

View File

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

View File

@@ -75,12 +75,16 @@ public class AppConfig
public int getConfig(string name, bool performance = false)
{
if (config.ContainsKey(name))
return int.Parse(config[name].ToString());
else return -1;
}
public bool isConfig(string name)
{
return getConfig(name) == 1;
}
public string getConfigString(string name)
{
if (config.ContainsKey(name))
@@ -115,22 +119,32 @@ public class AppConfig
}
}
public string getParamName(int device, string paramName = "fan_profile")
public string getParamName(AsusFan device, string paramName = "fan_profile")
{
int mode = getConfig("performance_mode");
string name;
if (device == 1)
name = "gpu";
else if (device == 2)
name = "mid";
else
name = "cpu";
switch (device)
{
case AsusFan.GPU:
name = "gpu";
break;
case AsusFan.Mid:
name = "mid";
break;
case AsusFan.XGM:
name = "xgm";
break;
default:
name = "cpu";
break;
}
return paramName + "_" + name + "_" + mode;
}
public byte[] getFanConfig(int device)
public byte[] getFanConfig(AsusFan device)
{
string curveString = getConfigString(getParamName(device));
byte[] curve = { };
@@ -141,7 +155,7 @@ public class AppConfig
return curve;
}
public void setFanConfig(int device, byte[] curve)
public void setFanConfig(AsusFan device, byte[] curve)
{
string bitCurve = BitConverter.ToString(curve);
setConfig(getParamName(device), bitCurve);
@@ -156,7 +170,7 @@ public class AppConfig
return array;
}
public byte[] getDefaultCurve(int device)
public byte[] getDefaultCurve(AsusFan device)
{
int mode = getConfig("performance_mode");
byte[] curve;
@@ -164,19 +178,19 @@ public class AppConfig
switch (mode)
{
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");
else
curve = StringToBytes("14-3F-44-48-4C-50-54-62-11-1A-22-29-34-43-51-5A");
break;
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");
else
curve = StringToBytes("3C-41-42-46-47-4B-4C-62-03-0C-0C-16-16-22-22-29");
break;
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");
else
curve = StringToBytes("3A-3D-40-44-48-4D-51-62-08-11-16-1A-22-29-30-45");

View File

@@ -1,8 +1,30 @@
using GHelper;
using System.Diagnostics;
using System.Management;
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";
@@ -14,6 +36,7 @@ public class ASUSWmi
public const uint UniversalControl = 0x00100021;
public const int KB_Light_Up = 0xc4;
public const int KB_Light_Down = 0xc5;
public const int Touchpad_Toggle = 0x6B;
public const int ChargerMode = 0x0012006C;
@@ -58,6 +81,13 @@ public class ASUSWmi
public const int TUF_KB = 0x00100056;
public const int TUF_KB_STATE = 0x00100057;
public const int TabletState = 0x00060077;
public const int Tablet_Notebook = 0;
public const int Tablet_Tablet = 1;
public const int Tablet_Tent = 2;
public const int Tablet_Rotated = 3;
public const int PerformanceBalanced = 0;
public const int PerformanceTurbo = 1;
public const int PerformanceSilent = 2;
@@ -117,7 +147,43 @@ public class ASUSWmi
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, "ATK Event");
byte[] outBuffer = new byte[16];
byte[] data = new byte[8];
bool result;
data[0] = BitConverter.GetBytes(eventHandle.ToInt32())[0];
data[1] = BitConverter.GetBytes(eventHandle.ToInt32())[1];
result = Control(0x222400, data, outBuffer);
Debug.WriteLine(result + ":" + BitConverter.ToString(data) + "|" + BitConverter.ToString(outBuffer));
while (true)
{
WaitForSingleObject(eventHandle, Timeout.Infinite);
Control(0x222408, new byte[0], outBuffer);
int code = BitConverter.ToInt32(outBuffer);
Logger.WriteLine("Code: " + code);
}
}
public AsusACPI()
{
handle = CreateFile(
FILE_NAME,
@@ -128,16 +194,18 @@ public class ASUSWmi
FILE_ATTRIBUTE_NORMAL,
IntPtr.Zero
);
if (handle == new IntPtr(-1))
{
throw new Exception("Can't connect to ACPI");
}
}
public void Control(uint dwIoControlCode, byte[] lpInBuffer, byte[] lpOutBuffer)
public bool Control(uint dwIoControlCode, byte[] lpInBuffer, byte[] lpOutBuffer)
{
uint lpBytesReturned = 0;
bool result = DeviceIoControl(
return DeviceIoControl(
handle,
dwIoControlCode,
lpInBuffer,
@@ -205,7 +273,7 @@ public class ASUSWmi
byte[] args = new byte[8];
BitConverter.GetBytes((uint)DeviceID).CopyTo(args, 0);
byte[] status = CallMethod(DSTS, args);
return BitConverter.ToInt32(status, 0) - 65536;
}
@@ -215,7 +283,7 @@ public class ASUSWmi
byte[] args = new byte[8];
BitConverter.GetBytes((uint)DeviceID).CopyTo(args, 0);
BitConverter.GetBytes((uint)Status).CopyTo(args, 4);
return CallMethod(DSTS, args);
}
@@ -234,7 +302,7 @@ public class ASUSWmi
}
public int SetFanCurve(int device, byte[] curve)
public int SetFanCurve(AsusFan device, byte[] curve)
{
if (curve.Length != 16) return -1;
@@ -243,16 +311,14 @@ public class ASUSWmi
int result;
for (int i = 8; i < curve.Length; i++)
{
curve[i] = Math.Max((byte)0, Math.Min((byte)99, curve[i])); // it seems to be a bug, when some old model's bios can go nuts if fan is set to 100%
}
switch (device)
{
case 1:
case AsusFan.GPU:
result = DeviceSet(DevsGPUFanCurve, curve, "FanGPU");
break;
case 2:
case AsusFan.Mid:
result = DeviceSet(DevsMidFanCurve, curve, "FanMid");
break;
default:
@@ -263,7 +329,7 @@ public class ASUSWmi
return result;
}
public byte[] GetFanCurve(int device, int mode = 0)
public byte[] GetFanCurve(AsusFan device, int mode = 0)
{
uint fan_mode;
@@ -277,9 +343,9 @@ public class ASUSWmi
switch (device)
{
case 1:
case AsusFan.GPU:
return DeviceGetBuffer(DevsGPUFanCurve, fan_mode);
case 2:
case AsusFan.Mid:
return DeviceGetBuffer(DevsMidFanCurve, fan_mode);
default:
return DeviceGetBuffer(DevsCPUFanCurve, fan_mode);
@@ -287,6 +353,53 @@ public class ASUSWmi
}
public static bool IsEmptyCurve(byte[] curve)
{
return curve.Length != 16 || curve.All(singleByte => singleByte == 0);
}
public static byte[] FixFanCurve(byte[] curve)
{
if (curve.Length != 16) throw new Exception("Incorrect curve");
var points = new Dictionary<byte, byte>();
for (int i = 0; i < 8; i++) points[curve[i]] = curve[i + 8];
var pointsFixed = new Dictionary<byte, byte>();
bool fix = false;
int count = 0;
foreach (var pair in points.OrderBy(x => x.Key))
{
if (count == 0 && pair.Key >= 40)
{
fix = true;
pointsFixed.Add(20, 0);
}
if (count != 3 || !fix)
pointsFixed.Add(pair.Key, pair.Value);
count++;
}
count = 0;
foreach (var pair in pointsFixed.OrderBy(x => x.Key))
{
curve[count] = pair.Key;
curve[count + 8] = pair.Value;
count++;
}
return curve;
}
public bool IsXGConnected()
{
return DeviceGet(GPUXGConnected) == 1;
}
public void TUFKeyboardBrightness(int brightness)
{
int param = 0x80 | (brightness & 0x7F);
@@ -336,7 +449,8 @@ public class ASUSWmi
watcher.Scope = new ManagementScope("root\\wmi");
watcher.Query = new WqlEventQuery("SELECT * FROM AsusAtkWmiEvent");
watcher.Start();
} catch
}
catch
{
Logger.WriteLine("Can't connect to ASUS WMI events");
}

View File

@@ -1,8 +1,6 @@
using HidLibrary;
using Microsoft.Win32;
using OSD;
using System.Diagnostics;
using System.Windows.Forms;
namespace GHelper
{
@@ -51,9 +49,11 @@ namespace GHelper
}
}
public static class Aura
public static class AsusUSB
{
public const byte HID_ID = 0x5a;
static byte[] MESSAGE_SET = { 0x5d, 0xb5, 0, 0, 0 };
static byte[] MESSAGE_APPLY = { 0x5d, 0xb4 };
@@ -163,14 +163,62 @@ namespace GHelper
Color2 = Color.FromArgb(colorCode);
}
private static IEnumerable<HidDevice> GetHidDevices(int[] deviceIds)
private static IEnumerable<HidDevice> GetHidDevices(int[] deviceIds, int minInput = 18)
{
HidDevice[] HidDeviceList = HidDevices.Enumerate(0x0b05, deviceIds).ToArray();
foreach (HidDevice device in HidDeviceList)
if (device.IsConnected && device.Description.ToLower().Contains("hid") && device.Capabilities.FeatureReportByteLength >= 64)
if (device.IsConnected
&& device.Capabilities.FeatureReportByteLength > 0
&& device.Capabilities.InputReportByteLength >= minInput) //
yield return device;
}
private static HidDevice? GetInputDevice()
{
HidDevice[] HidDeviceList = HidDevices.Enumerate(0x0b05, deviceIds).ToArray();
foreach (HidDevice device in HidDeviceList)
if (device.ReadFeatureData(out byte[] data, HID_ID))
return device;
return null;
}
public static void TouchpadToggle()
{
HidDevice? input = GetInputDevice();
if (input != null) input.WriteFeatureData(new byte[] { HID_ID,0xf4,0x6b});
}
public static void RunListener(Action<int> KeyHandler)
{
HidDevice? input = GetInputDevice();
if (input == null) return;
Logger.WriteLine("Input Events " + input.DevicePath);
Task.Run(() =>
{
try
{
while (true)
{
var data = input.Read().Data;
if (data.Length > 1 && data[0] == HID_ID && data[1] > 0)
{
Logger.WriteLine("Key:" + data[1]);
KeyHandler(data[1]);
}
}
}
catch (Exception ex)
{
Logger.WriteLine(ex.ToString());
}
});
}
public static byte[] AuraMessage(int mode, Color color, Color color2, int speed)
{
@@ -196,17 +244,18 @@ namespace GHelper
byte[] msg = { 0x5d, 0xba, 0xc5, 0xc4, (byte)brightness };
var devices = GetHidDevices(deviceIds);
if (devices.Count() > 0) Logger.WriteLine("USB-KB = " + BitConverter.ToString(msg));
//Logger.WriteLine("USB-KB = " + BitConverter.ToString(msg));
foreach (HidDevice device in devices)
{
device.OpenDevice();
device.Write(msg);
Logger.WriteLine("USB-KB " + device.Attributes.ProductHexId + ":" + BitConverter.ToString(msg));
device.CloseDevice();
}
if (Program.config.ContainsModel("TUF"))
Program.wmi.TUFKeyboardBrightness(brightness);
Program.acpi.TUFKeyboardBrightness(brightness);
}
@@ -217,38 +266,63 @@ namespace GHelper
var devices = GetHidDevices(deviceIds);
if (devices.Count() > 0) Logger.WriteLine("USB-KB = " + BitConverter.ToString(msg));
//Logger.WriteLine("USB-KB = " + BitConverter.ToString(msg));
foreach (HidDevice device in devices)
{
device.OpenDevice();
device.Write(msg);
Logger.WriteLine("USB-KB " + device.Attributes.ProductHexId + ":" + BitConverter.ToString(msg));
device.CloseDevice();
}
if (Program.config.ContainsModel("TUF"))
Program.wmi.TUFKeyboardPower(
flags.Contains(AuraDev19b6.AwakeKeyb),
flags.Contains(AuraDev19b6.BootKeyb),
flags.Contains(AuraDev19b6.SleepKeyb),
Program.acpi.TUFKeyboardPower(
flags.Contains(AuraDev19b6.AwakeKeyb),
flags.Contains(AuraDev19b6.BootKeyb),
flags.Contains(AuraDev19b6.SleepKeyb),
flags.Contains(AuraDev19b6.ShutdownKeyb));
}
public static void ApplyXGMLight(bool status)
public static int SetXGM(byte[] msg)
{
byte value = status? (byte)0x50:(byte)0;
var msg = new byte[] { 0x5e, 0xc5, value };
Debug.WriteLine("XGM Payload :" + BitConverter.ToString(msg));
foreach (HidDevice device in GetHidDevices(new int[] { 0x1970 }))
{
device.OpenDevice();
var message = new byte[300];
Array.Copy(msg, message, msg.Length);
Debug.WriteLine(BitConverter.ToString(message));
device.WriteFeatureData(message);
Debug.WriteLine("XGM " + device.Attributes.ProductHexId + ":" + BitConverter.ToString(msg));
device.WriteFeatureData(msg);
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.IsEmptyCurve(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);
}
@@ -273,7 +347,12 @@ namespace GHelper
byte[] msg = AuraMessage(Mode, Color1, Color2, _speed);
var devices = GetHidDevices(deviceIds);
if (devices.Count() > 0) Logger.WriteLine("USB-KB = " + BitConverter.ToString(msg));
if (devices.Count() == 0)
{
Logger.WriteLine("USB-KB : not found");
devices = GetHidDevices(deviceIds, 1);
}
foreach (HidDevice device in devices)
{
@@ -282,10 +361,11 @@ namespace GHelper
device.Write(MESSAGE_SET);
device.Write(MESSAGE_APPLY);
device.CloseDevice();
Logger.WriteLine("USB-KB " + device.Capabilities.FeatureReportByteLength + "|" + device.Capabilities.InputReportByteLength + device.Description + device.DevicePath + ":" + BitConverter.ToString(msg));
}
if (Program.config.ContainsModel("TUF"))
Program.wmi.TUFKeyboardRGB(Mode, Color1, _speed);
Program.acpi.TUFKeyboardRGB(Mode, Color1, _speed);
}
@@ -299,7 +379,8 @@ namespace GHelper
myKey.SetValue("TurnOffKeybdLight", value, RegistryValueKind.DWord);
myKey.Close();
}
} catch (Exception ex)
}
catch (Exception ex)
{
Logger.WriteLine(ex.Message);
}

41
app/Extra.Designer.cs generated
View File

@@ -74,6 +74,7 @@ namespace GHelper
checkSleepLid = new CheckBox();
checkShutdownLid = new CheckBox();
groupOther = new GroupBox();
checkAutoApplyWindowsPowerMode = new CheckBox();
checkKeyboardAuto = new CheckBox();
checkUSBC = new CheckBox();
checkNoOverdrive = new CheckBox();
@@ -233,7 +234,7 @@ namespace GHelper
//
// numericBacklightTime
//
numericBacklightTime.Location = new Point(477, 131);
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);
@@ -241,37 +242,35 @@ namespace GHelper
//
// labelBacklightTimeout
//
labelBacklightTimeout.Location = new Point(13, 133);
labelBacklightTimeout.Location = new Point(13, 135);
labelBacklightTimeout.Name = "labelBacklightTimeout";
labelBacklightTimeout.Size = new Size(489, 45);
labelBacklightTimeout.Size = new Size(636, 45);
labelBacklightTimeout.TabIndex = 46;
labelBacklightTimeout.Text = "Seconds to turn off backlight on battery";
//
// labelBrightness
//
labelBrightness.Location = new Point(13, 76);
labelBrightness.Location = new Point(13, 75);
labelBrightness.Name = "labelBrightness";
labelBrightness.Size = new Size(197, 49);
labelBrightness.Size = new Size(336, 43);
labelBrightness.TabIndex = 41;
labelBrightness.Text = "Brightness";
//
// trackBrightness
//
trackBrightness.LargeChange = 1;
trackBrightness.Location = new Point(216, 60);
trackBrightness.Location = new Point(355, 60);
trackBrightness.Maximum = 3;
trackBrightness.Name = "trackBrightness";
trackBrightness.Size = new Size(600, 90);
trackBrightness.Size = new Size(558, 90);
trackBrightness.TabIndex = 42;
trackBrightness.TickStyle = TickStyle.TopLeft;
//
// labelSpeed
//
labelSpeed.AutoSize = true;
labelSpeed.Location = new Point(13, 15);
labelSpeed.MaximumSize = new Size(200, 0);
labelSpeed.Name = "labelSpeed";
labelSpeed.Size = new Size(198, 32);
labelSpeed.Size = new Size(538, 40);
labelSpeed.TabIndex = 44;
labelSpeed.Text = "Animation Speed";
//
@@ -284,7 +283,7 @@ namespace GHelper
comboKeyboardSpeed.FormattingEnabled = true;
comboKeyboardSpeed.ItemHeight = 32;
comboKeyboardSpeed.Items.AddRange(new object[] { "Slow", "Normal", "Fast" });
comboKeyboardSpeed.Location = new Point(220, 12);
comboKeyboardSpeed.Location = new Point(607, 15);
comboKeyboardSpeed.Margin = new Padding(4, 10, 4, 8);
comboKeyboardSpeed.Name = "comboKeyboardSpeed";
comboKeyboardSpeed.Size = new Size(291, 40);
@@ -574,6 +573,7 @@ namespace GHelper
//
// groupOther
//
groupOther.Controls.Add(checkAutoApplyWindowsPowerMode);
groupOther.Controls.Add(checkKeyboardAuto);
groupOther.Controls.Add(checkUSBC);
groupOther.Controls.Add(checkNoOverdrive);
@@ -586,10 +586,20 @@ namespace GHelper
groupOther.TabStop = false;
groupOther.Text = "Other";
//
// checkAutoApplyWindowsPowerMode
//
checkAutoApplyWindowsPowerMode.AutoSize = true;
checkAutoApplyWindowsPowerMode.Location = new Point(25, 220);
checkAutoApplyWindowsPowerMode.Name = "checkAutoApplyWindowsPowerMode";
checkAutoApplyWindowsPowerMode.Size = new Size(416, 36);
checkAutoApplyWindowsPowerMode.TabIndex = 47;
checkAutoApplyWindowsPowerMode.Text = "Auto Adjust Windows Power Mode";
checkAutoApplyWindowsPowerMode.UseVisualStyleBackColor = true;
//
// checkKeyboardAuto
//
checkKeyboardAuto.AutoSize = true;
checkKeyboardAuto.Location = new Point(25, 53);
checkKeyboardAuto.Location = new Point(25, 40);
checkKeyboardAuto.MaximumSize = new Size(780, 0);
checkKeyboardAuto.Name = "checkKeyboardAuto";
checkKeyboardAuto.Size = new Size(712, 36);
@@ -600,7 +610,7 @@ namespace GHelper
// checkUSBC
//
checkUSBC.AutoSize = true;
checkUSBC.Location = new Point(25, 210);
checkUSBC.Location = new Point(25, 85);
checkUSBC.Name = "checkUSBC";
checkUSBC.Size = new Size(659, 36);
checkUSBC.TabIndex = 4;
@@ -610,7 +620,7 @@ namespace GHelper
// checkNoOverdrive
//
checkNoOverdrive.AutoSize = true;
checkNoOverdrive.Location = new Point(25, 156);
checkNoOverdrive.Location = new Point(25, 130);
checkNoOverdrive.Name = "checkNoOverdrive";
checkNoOverdrive.Size = new Size(307, 36);
checkNoOverdrive.TabIndex = 3;
@@ -620,7 +630,7 @@ namespace GHelper
// checkTopmost
//
checkTopmost.AutoSize = true;
checkTopmost.Location = new Point(25, 104);
checkTopmost.Location = new Point(25, 175);
checkTopmost.Name = "checkTopmost";
checkTopmost.Size = new Size(390, 36);
checkTopmost.TabIndex = 1;
@@ -714,5 +724,6 @@ namespace GHelper
private Label labelBacklightTimeout;
private NumericUpDown numericBacklightTime;
private CheckBox checkKeyboardAuto;
private CheckBox checkAutoApplyWindowsPowerMode;
}
}

View File

@@ -21,6 +21,10 @@ namespace GHelper
private void SetKeyCombo(ComboBox combo, TextBox txbox, string name)
{
if (name == "m3")
customActions[""] = Properties.Strings.MuteMic;
if (name == "m4")
customActions[""] = Properties.Strings.OpenGHelper;
@@ -68,11 +72,13 @@ namespace GHelper
labelSpeed.Text = Properties.Strings.AnimationSpeed;
labelBrightness.Text = Properties.Strings.Brightness;
labelBacklightTimeout.Text = Properties.Strings.BacklightTimeout;
checkKeyboardAuto.Text = Properties.Strings.KeyboardAuto;
checkNoOverdrive.Text = Properties.Strings.DisableOverdrive;
checkTopmost.Text = Properties.Strings.WindowTop;
checkUSBC.Text = Properties.Strings.OptimizedUSBC;
checkAutoApplyWindowsPowerMode.Text = Properties.Strings.ApplyWindowsPowerPlan;
labelBacklight.Text = Properties.Strings.Keyboard;
labelBacklightBar.Text = Properties.Strings.Lightbar;
@@ -90,10 +96,10 @@ namespace GHelper
Shown += Keyboard_Shown;
comboKeyboardSpeed.DropDownStyle = ComboBoxStyle.DropDownList;
comboKeyboardSpeed.DataSource = new BindingSource(Aura.GetSpeeds(), null);
comboKeyboardSpeed.DataSource = new BindingSource(AsusUSB.GetSpeeds(), null);
comboKeyboardSpeed.DisplayMember = "Value";
comboKeyboardSpeed.ValueMember = "Key";
comboKeyboardSpeed.SelectedValue = Aura.Speed;
comboKeyboardSpeed.SelectedValue = AsusUSB.Speed;
comboKeyboardSpeed.SelectedValueChanged += ComboKeyboardSpeed_SelectedValueChanged;
// Keyboard
@@ -176,13 +182,16 @@ namespace GHelper
checkUSBC.Checked = (Program.config.getConfig("optimized_usbc") == 1);
checkUSBC.CheckedChanged += CheckUSBC_CheckedChanged;
checkAutoApplyWindowsPowerMode.Checked = (Program.config.getConfig("auto_apply_power_plan") != 0);
checkAutoApplyWindowsPowerMode.CheckedChanged += checkAutoApplyWindowsPowerMode_CheckedChanged;
int kb_brightness = Program.config.getConfig("keyboard_brightness");
trackBrightness.Value = (kb_brightness >= 0 && kb_brightness <= 3) ? kb_brightness : 3;
pictureHelp.Click += PictureHelp_Click;
trackBrightness.Scroll += TrackBrightness_Scroll;
panelXMG.Visible = (Program.wmi.DeviceGet(ASUSWmi.GPUXGConnected) == 1);
panelXMG.Visible = (Program.acpi.DeviceGet(AsusACPI.GPUXGConnected) == 1);
checkXMG.Checked = !(Program.config.getConfig("xmg_light") == 0);
checkXMG.CheckedChanged += CheckXMG_CheckedChanged;
@@ -197,13 +206,13 @@ namespace GHelper
{
Program.RunAsAdmin("extra");
Program.config.setConfig("keyboard_light_tiomeout", (int)numericBacklightTime.Value);
Aura.SetBacklightOffDelay((int)numericBacklightTime.Value);
AsusUSB.SetBacklightOffDelay((int)numericBacklightTime.Value);
}
private void CheckXMG_CheckedChanged(object? sender, EventArgs e)
{
Program.config.setConfig("xmg_light", (checkXMG.Checked ? 1 : 0));
Aura.ApplyXGMLight(checkXMG.Checked);
AsusUSB.ApplyXGMLight(checkXMG.Checked);
}
private void CheckUSBC_CheckedChanged(object? sender, EventArgs e)
@@ -214,7 +223,7 @@ namespace GHelper
private void TrackBrightness_Scroll(object? sender, EventArgs e)
{
Program.config.setConfig("keyboard_brightness", trackBrightness.Value);
Aura.ApplyBrightness(trackBrightness.Value);
AsusUSB.ApplyBrightness(trackBrightness.Value);
}
private void PictureHelp_Click(object? sender, EventArgs e)
@@ -283,7 +292,7 @@ namespace GHelper
if (checkSleepLogo.Checked) flags.Add(AuraDev19b6.SleepLogo);
if (checkShutdownLogo.Checked) flags.Add(AuraDev19b6.ShutdownLogo);
Aura.ApplyAuraPower(flags);
AsusUSB.ApplyAuraPower(flags);
}
@@ -299,5 +308,10 @@ namespace GHelper
Top = Program.settingsForm.Top;
Left = Program.settingsForm.Left - Width - 5;
}
private void checkAutoApplyWindowsPowerMode_CheckedChanged(object? sender, EventArgs e)
{
Program.config.setConfig("auto_apply_power_plan", checkAutoApplyWindowsPowerMode.Checked ? 1 : 0);
}
}
}

View File

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

297
app/Fans.Designer.cs generated
View File

@@ -37,17 +37,22 @@ namespace GHelper
Title title2 = new Title();
ChartArea chartArea3 = new ChartArea();
Title title3 = new Title();
ChartArea chartArea4 = new ChartArea();
Title title4 = new Title();
panelFans = new Panel();
labelFansResult = new Label();
labelTip = new Label();
labelBoost = new Label();
comboBoost = new RComboBox();
picturePerf = new PictureBox();
tableFanCharts = new TableLayoutPanel();
chartGPU = new Chart();
chartCPU = new Chart();
chartMid = new Chart();
chartXGM = new Chart();
panelTitleFans = new Panel();
labelBoost = new Label();
comboBoost = new RComboBox();
picturePerf = new PictureBox();
labelFans = new Label();
panelApplyFans = new Panel();
labelFansResult = new Label();
checkApplyFans = new RCheckBox();
buttonReset = new RButton();
panelSliders = new Panel();
@@ -87,11 +92,14 @@ namespace GHelper
pictureGPU = new PictureBox();
labelGPU = new Label();
panelFans.SuspendLayout();
((System.ComponentModel.ISupportInitialize)picturePerf).BeginInit();
tableFanCharts.SuspendLayout();
((System.ComponentModel.ISupportInitialize)chartGPU).BeginInit();
((System.ComponentModel.ISupportInitialize)chartCPU).BeginInit();
((System.ComponentModel.ISupportInitialize)chartMid).BeginInit();
((System.ComponentModel.ISupportInitialize)chartXGM).BeginInit();
panelTitleFans.SuspendLayout();
((System.ComponentModel.ISupportInitialize)picturePerf).BeginInit();
panelApplyFans.SuspendLayout();
panelSliders.SuspendLayout();
panelPower.SuspendLayout();
panelApplyPower.SuspendLayout();
@@ -116,53 +124,134 @@ namespace GHelper
//
// panelFans
//
panelFans.Controls.Add(labelFansResult);
panelFans.AutoSize = true;
panelFans.AutoSizeMode = AutoSizeMode.GrowAndShrink;
panelFans.Controls.Add(labelTip);
panelFans.Controls.Add(labelBoost);
panelFans.Controls.Add(comboBoost);
panelFans.Controls.Add(picturePerf);
panelFans.Controls.Add(tableFanCharts);
panelFans.Controls.Add(labelFans);
panelFans.Controls.Add(checkApplyFans);
panelFans.Controls.Add(buttonReset);
panelFans.Controls.Add(panelTitleFans);
panelFans.Controls.Add(panelApplyFans);
panelFans.Dock = DockStyle.Left;
panelFans.Location = new Point(533, 0);
panelFans.Margin = new Padding(0);
panelFans.MaximumSize = new Size(815, 0);
panelFans.MinimumSize = new Size(815, 0);
panelFans.Name = "panelFans";
panelFans.Padding = new Padding(10);
panelFans.Size = new Size(824, 1189);
panelFans.Padding = new Padding(0, 0, 10, 0);
panelFans.Size = new Size(815, 1189);
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.AutoSize = true;
labelTip.BackColor = SystemColors.ControlLightLight;
labelTip.Location = new Point(155, 9);
labelTip.Location = new Point(684, 91);
labelTip.Name = "labelTip";
labelTip.Padding = new Padding(5);
labelTip.Size = new Size(107, 42);
labelTip.TabIndex = 40;
labelTip.Text = "500,300";
//
// tableFanCharts
//
tableFanCharts.AutoSize = true;
tableFanCharts.AutoSizeMode = AutoSizeMode.GrowAndShrink;
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
//
chartArea1.Name = "ChartArea1";
chartGPU.ChartAreas.Add(chartArea1);
chartGPU.Dock = DockStyle.Fill;
chartGPU.Location = new Point(12, 342);
chartGPU.Margin = new Padding(2, 10, 2, 10);
chartGPU.Name = "chartGPU";
chartGPU.Size = new Size(781, 312);
chartGPU.TabIndex = 17;
chartGPU.Text = "chartGPU";
title1.Name = "Title1";
chartGPU.Titles.Add(title1);
//
// chartCPU
//
chartArea2.Name = "ChartArea1";
chartCPU.ChartAreas.Add(chartArea2);
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, 312);
chartCPU.TabIndex = 14;
chartCPU.Text = "chartCPU";
title2.Name = "Title1";
chartCPU.Titles.Add(title2);
//
// chartMid
//
chartArea3.Name = "ChartArea3";
chartMid.ChartAreas.Add(chartArea3);
chartMid.Dock = DockStyle.Fill;
chartMid.Location = new Point(12, 674);
chartMid.Margin = new Padding(2, 10, 2, 10);
chartMid.Name = "chartMid";
chartMid.Size = new Size(781, 313);
chartMid.TabIndex = 14;
chartMid.Text = "chartMid";
title3.Name = "Title3";
chartMid.Titles.Add(title3);
chartMid.Visible = false;
//
// chartXGM
//
chartArea4.Name = "ChartAreaXGM";
chartXGM.ChartAreas.Add(chartArea4);
chartXGM.Dock = DockStyle.Fill;
chartXGM.Location = new Point(12, 674);
chartXGM.Margin = new Padding(2, 10, 2, 10);
chartXGM.Name = "chartXGM";
chartXGM.Size = new Size(781, 313);
chartXGM.TabIndex = 14;
chartXGM.Text = "chartXGM";
title4.Name = "Title4";
chartXGM.Titles.Add(title4);
chartXGM.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.Anchor = AnchorStyles.Top | AnchorStyles.Right;
labelBoost.AutoSize = true;
labelBoost.Location = new Point(375, 17);
labelBoost.Location = new Point(335, 20);
labelBoost.Name = "labelBoost";
labelBoost.Size = new Size(125, 32);
labelBoost.TabIndex = 39;
labelBoost.Size = new Size(143, 32);
labelBoost.TabIndex = 43;
labelBoost.Text = "CPU Boost";
labelBoost.TextAlign = ContentAlignment.MiddleRight;
//
@@ -174,106 +263,66 @@ namespace GHelper
comboBoost.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoost.FormattingEnabled = true;
comboBoost.Items.AddRange(new object[] { "Disabled", "Enabled", "Aggressive", "Efficient Enabled", "Efficient Aggressive" });
comboBoost.Location = new Point(526, 15);
comboBoost.Location = new Point(503, 16);
comboBoost.Name = "comboBoost";
comboBoost.Size = new Size(266, 40);
comboBoost.TabIndex = 38;
comboBoost.Size = new Size(287, 40);
comboBoost.TabIndex = 42;
//
// picturePerf
//
picturePerf.BackgroundImage = Properties.Resources.icons8_fan_head_96;
picturePerf.BackgroundImageLayout = ImageLayout.Zoom;
picturePerf.InitialImage = null;
picturePerf.Location = new Point(30, 18);
picturePerf.Location = new Point(20, 18);
picturePerf.Margin = new Padding(4, 2, 4, 2);
picturePerf.Name = "picturePerf";
picturePerf.Size = new Size(36, 38);
picturePerf.TabIndex = 37;
picturePerf.TabIndex = 41;
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
//
chartArea1.Name = "ChartArea1";
chartGPU.ChartAreas.Add(chartArea1);
chartGPU.Dock = DockStyle.Fill;
chartGPU.Location = new Point(2, 350);
chartGPU.Margin = new Padding(2, 10, 2, 10);
chartGPU.Name = "chartGPU";
chartGPU.Size = new Size(760, 320);
chartGPU.TabIndex = 17;
chartGPU.Text = "chartGPU";
title1.Name = "Title1";
chartGPU.Titles.Add(title1);
//
// chartCPU
//
chartArea2.Name = "ChartArea1";
chartCPU.ChartAreas.Add(chartArea2);
chartCPU.Dock = DockStyle.Fill;
chartCPU.Location = new Point(2, 10);
chartCPU.Margin = new Padding(2, 10, 2, 10);
chartCPU.Name = "chartCPU";
chartCPU.Size = new Size(760, 320);
chartCPU.TabIndex = 14;
chartCPU.Text = "chartCPU";
title2.Name = "Title1";
chartCPU.Titles.Add(title2);
//
// chartMid
//
chartArea3.Name = "ChartArea3";
chartMid.ChartAreas.Add(chartArea3);
chartMid.Dock = DockStyle.Fill;
chartMid.Location = new Point(2, 690);
chartMid.Margin = new Padding(2, 10, 2, 10);
chartMid.Name = "chartMid";
chartMid.Size = new Size(760, 322);
chartMid.TabIndex = 14;
chartMid.Text = "chartMid";
title3.Name = "Title3";
chartMid.Titles.Add(title3);
chartMid.Visible = false;
//
// labelFans
//
labelFans.AutoSize = true;
labelFans.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelFans.Location = new Point(66, 20);
labelFans.Location = new Point(64, 20);
labelFans.Margin = new Padding(4, 0, 4, 0);
labelFans.Name = "labelFans";
labelFans.Size = new Size(138, 32);
labelFans.TabIndex = 28;
labelFans.Size = new Size(293, 32);
labelFans.TabIndex = 40;
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.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
checkApplyFans.AutoSize = true;
checkApplyFans.BackColor = SystemColors.ControlLight;
checkApplyFans.Location = new Point(449, 1118);
checkApplyFans.Location = new Point(454, 46);
checkApplyFans.Margin = new Padding(4, 2, 4, 2);
checkApplyFans.Name = "checkApplyFans";
checkApplyFans.Padding = new Padding(15, 5, 15, 5);
checkApplyFans.Size = new Size(339, 46);
checkApplyFans.TabIndex = 17;
checkApplyFans.TabIndex = 19;
checkApplyFans.Text = Properties.Strings.ApplyFanCurve;
checkApplyFans.UseVisualStyleBackColor = false;
//
@@ -285,12 +334,12 @@ namespace GHelper
buttonReset.BorderColor = Color.Transparent;
buttonReset.BorderRadius = 2;
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.Name = "buttonReset";
buttonReset.Secondary = true;
buttonReset.Size = new Size(232, 54);
buttonReset.TabIndex = 15;
buttonReset.TabIndex = 18;
buttonReset.Text = Properties.Strings.FactoryDefaults;
buttonReset.UseVisualStyleBackColor = false;
//
@@ -325,10 +374,10 @@ namespace GHelper
//
panelApplyPower.Controls.Add(checkApplyPower);
panelApplyPower.Dock = DockStyle.Bottom;
panelApplyPower.Location = new Point(0, 445);
panelApplyPower.Location = new Point(0, 447);
panelApplyPower.Name = "panelApplyPower";
panelApplyPower.Padding = new Padding(10);
panelApplyPower.Size = new Size(523, 92);
panelApplyPower.Size = new Size(523, 90);
panelApplyPower.TabIndex = 44;
//
// checkApplyPower
@@ -336,7 +385,7 @@ namespace GHelper
checkApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
checkApplyPower.AutoSize = true;
checkApplyPower.BackColor = SystemColors.ControlLight;
checkApplyPower.Location = new Point(18, 22);
checkApplyPower.Location = new Point(18, 20);
checkApplyPower.Margin = new Padding(10);
checkApplyPower.Name = "checkApplyPower";
checkApplyPower.Padding = new Padding(15, 5, 15, 5);
@@ -724,7 +773,7 @@ namespace GHelper
//
labelGPU.AutoSize = true;
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.Name = "labelGPU";
labelGPU.Size = new Size(162, 32);
@@ -737,7 +786,7 @@ namespace GHelper
AutoScaleMode = AutoScaleMode.Dpi;
AutoSize = true;
AutoSizeMode = AutoSizeMode.GrowAndShrink;
ClientSize = new Size(1361, 1189);
ClientSize = new Size(1340, 1189);
Controls.Add(panelFans);
Controls.Add(panelSliders);
Margin = new Padding(4, 2, 4, 2);
@@ -752,11 +801,15 @@ namespace GHelper
Text = "Fans and Power";
panelFans.ResumeLayout(false);
panelFans.PerformLayout();
((System.ComponentModel.ISupportInitialize)picturePerf).EndInit();
tableFanCharts.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)chartGPU).EndInit();
((System.ComponentModel.ISupportInitialize)chartCPU).EndInit();
((System.ComponentModel.ISupportInitialize)chartMid).EndInit();
((System.ComponentModel.ISupportInitialize)chartXGM).EndInit();
panelTitleFans.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)picturePerf).EndInit();
panelApplyFans.ResumeLayout(false);
panelApplyFans.PerformLayout();
panelSliders.ResumeLayout(false);
panelSliders.PerformLayout();
panelPower.ResumeLayout(false);
@@ -790,23 +843,18 @@ namespace GHelper
panelTitleGPU.PerformLayout();
((System.ComponentModel.ISupportInitialize)pictureGPU).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private Panel panelFans;
private RCheckBox checkApplyFans;
private RButton buttonReset;
private Panel panelSliders;
private TableLayoutPanel tableFanCharts;
private System.Windows.Forms.DataVisualization.Charting.Chart chartGPU;
private System.Windows.Forms.DataVisualization.Charting.Chart chartCPU;
private System.Windows.Forms.DataVisualization.Charting.Chart chartMid;
private Label labelFans;
private PictureBox picturePerf;
private RComboBox comboBoost;
private Label labelBoost;
private Chart chartGPU;
private Chart chartCPU;
private Chart chartMid;
private Chart chartXGM;
private Label labelTip;
private Label labelFansResult;
private Panel panelPower;
private Label labelInfo;
private Panel panelCPU;
@@ -842,5 +890,14 @@ namespace GHelper
private Label labelGPUTemp;
private Label labelGPUTempTitle;
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;
}
}

View File

@@ -12,9 +12,12 @@ namespace GHelper
Series seriesCPU;
Series seriesGPU;
Series seriesMid;
Series seriesXGM;
static int MinRPM, MaxRPM;
const int fansMax = 100;
NvidiaGpuControl? nvControl = null;
public Fans()
@@ -34,6 +37,11 @@ namespace GHelper
labelGPU.Text = Properties.Strings.GPUSettings;
labelGPUCoreTitle.Text = Properties.Strings.GPUCoreClockOffset;
labelGPUMemoryTitle.Text = Properties.Strings.GPUMemoryClockOffset;
labelGPUBoostTitle.Text = Properties.Strings.GPUBoost;
labelGPUTempTitle.Text = Properties.Strings.GPUTempTarget;
InitTheme();
MinRPM = 18;
@@ -46,10 +54,12 @@ namespace GHelper
seriesCPU = chartCPU.Series.Add("CPU");
seriesGPU = chartGPU.Series.Add("GPU");
seriesMid = chartMid.Series.Add("Mid");
seriesXGM = chartXGM.Series.Add("XGM");
seriesCPU.Color = colorStandard;
seriesGPU.Color = colorTurbo;
seriesMid.Color = colorEco;
seriesXGM.Color = Color.Orange;
chartCPU.MouseMove += ChartCPU_MouseMove;
chartCPU.MouseUp += ChartCPU_MouseUp;
@@ -60,13 +70,16 @@ namespace GHelper
chartMid.MouseMove += ChartCPU_MouseMove;
chartMid.MouseUp += ChartCPU_MouseUp;
chartXGM.MouseMove += ChartCPU_MouseMove;
chartXGM.MouseUp += ChartCPU_MouseUp;
buttonReset.Click += ButtonReset_Click;
trackTotal.Maximum = ASUSWmi.MaxTotal;
trackTotal.Minimum = ASUSWmi.MinTotal;
trackTotal.Maximum = AsusACPI.MaxTotal;
trackTotal.Minimum = AsusACPI.MinTotal;
trackCPU.Maximum = ASUSWmi.MaxCPU;
trackCPU.Minimum = ASUSWmi.MinCPU;
trackCPU.Maximum = AsusACPI.MaxCPU;
trackCPU.Minimum = AsusACPI.MinCPU;
trackCPU.Scroll += TrackPower_Scroll;
trackTotal.Scroll += TrackPower_Scroll;
@@ -83,11 +96,11 @@ namespace GHelper
trackGPUMemory.Minimum = NvidiaGpuControl.MinMemoryOffset;
trackGPUMemory.Maximum = NvidiaGpuControl.MaxMemoryOffset;
trackGPUBoost.Minimum = ASUSWmi.MinGPUBoost;
trackGPUBoost.Maximum = ASUSWmi.MaxGPUBoost;
trackGPUBoost.Minimum = AsusACPI.MinGPUBoost;
trackGPUBoost.Maximum = AsusACPI.MaxGPUBoost;
trackGPUTemp.Minimum = ASUSWmi.MinGPUTemp;
trackGPUTemp.Maximum = ASUSWmi.MaxGPUTemp;
trackGPUTemp.Minimum = AsusACPI.MinGPUTemp;
trackGPUTemp.Maximum = AsusACPI.MaxGPUTemp;
trackGPUCore.Scroll += trackGPU_Scroll;
trackGPUMemory.Scroll += trackGPU_Scroll;
@@ -144,9 +157,9 @@ namespace GHelper
int core = Program.config.getConfigPerf("gpu_core");
int memory = Program.config.getConfigPerf("gpu_memory");
if (gpu_boost < 0) gpu_boost = ASUSWmi.MaxGPUBoost;
if (gpu_temp < 0) gpu_temp = ASUSWmi.MaxGPUTemp;
if (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;
@@ -159,18 +172,25 @@ namespace GHelper
memory = current_memory;
}
labelGPU.Text = nvControl.FullName;
try
{
labelGPU.Text = nvControl.FullName;
}
catch
{
}
//}
trackGPUCore.Value = Math.Max(Math.Min(core, NvidiaGpuControl.MaxCoreOffset), NvidiaGpuControl.MinCoreOffset);
trackGPUMemory.Value = Math.Max(Math.Min(memory, NvidiaGpuControl.MaxMemoryOffset), NvidiaGpuControl.MinMemoryOffset);
trackGPUBoost.Value = Math.Max(Math.Min(gpu_boost, ASUSWmi.MaxGPUBoost), ASUSWmi.MinGPUBoost);
trackGPUTemp.Value = Math.Max(Math.Min(gpu_temp, ASUSWmi.MaxGPUTemp), ASUSWmi.MinGPUTemp);
trackGPUBoost.Value = Math.Max(Math.Min(gpu_boost, AsusACPI.MaxGPUBoost), AsusACPI.MinGPUBoost);
trackGPUTemp.Value = Math.Max(Math.Min(gpu_temp, AsusACPI.MaxGPUTemp), AsusACPI.MinGPUTemp);
panelGPUBoost.Visible = (Program.wmi.DeviceGet(ASUSWmi.PPT_GPUC0) >= 0);
panelGPUTemp.Visible = (Program.wmi.DeviceGet(ASUSWmi.PPT_GPUC2) >= 0);
panelGPUBoost.Visible = (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC0) >= 0);
panelGPUTemp.Visible = (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC2) >= 0);
VisualiseGPUSettings();
@@ -219,17 +239,26 @@ namespace GHelper
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)
title = Properties.Strings.FanProfileGPU;
else if (device == 2)
title = Properties.Strings.FanProfileMid;
else
title = Properties.Strings.FanProfileCPU;
switch (device)
{
case AsusFan.CPU:
title = Properties.Strings.FanProfileCPU;
break;
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)
labelFans.Text = Properties.Strings.FanProfiles + ": " + Program.settingsForm.perfName;
@@ -241,7 +270,7 @@ namespace GHelper
chart.ChartAreas[0].AxisX.Interval = 10;
chart.ChartAreas[0].AxisY.Minimum = 0;
chart.ChartAreas[0].AxisY.Maximum = 100;
chart.ChartAreas[0].AxisY.Maximum = fansMax;
chart.ChartAreas[0].AxisY.LabelStyle.Font = new Font("Arial", 7F);
@@ -250,10 +279,10 @@ namespace GHelper
chart.ChartAreas[0].AxisX.LineColor = chartGrid;
chart.ChartAreas[0].AxisY.LineColor = chartGrid;
for (int i = 0; i <= 90; i += 10)
for (int i = 0; i <= fansMax - 10; i += 10)
chart.ChartAreas[0].AxisY.CustomLabels.Add(i - 2, i + 2, ChartPercToRPM(i));
chart.ChartAreas[0].AxisY.CustomLabels.Add(98, 102, Properties.Strings.RPM);
chart.ChartAreas[0].AxisY.CustomLabels.Add(fansMax - 2, fansMax + 2, Properties.Strings.RPM);
chart.ChartAreas[0].AxisY.Interval = 10;
@@ -264,6 +293,8 @@ namespace GHelper
private void Fans_Shown(object? sender, EventArgs e)
{
panelSliders.Visible = panelGPU.Visible || panelPower.Visible;
if (Height > Program.settingsForm.Height)
{
Top = Program.settingsForm.Top + Program.settingsForm.Height - Height;
@@ -275,8 +306,8 @@ namespace GHelper
Top = Program.settingsForm.Top;
}
Left = Program.settingsForm.Left - Width - 5;
}
@@ -314,7 +345,7 @@ namespace GHelper
}
else
{
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
Program.settingsForm.AutoFans();
}
@@ -333,7 +364,7 @@ namespace GHelper
}
else
{
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
Program.settingsForm.AutoPower();
}
}
@@ -360,8 +391,8 @@ namespace GHelper
public void InitPower(bool changed = false)
{
bool cpuBmode = (Program.wmi.DeviceGet(ASUSWmi.PPT_CPUB0) >= 0); // 2022 model +
bool cpuAmode = (Program.wmi.DeviceGet(ASUSWmi.PPT_TotalA0) >= 0); // 2021 model +
bool cpuBmode = (Program.acpi.DeviceGet(AsusACPI.PPT_CPUB0) >= 0); // 2022 model +
bool cpuAmode = (Program.acpi.DeviceGet(AsusACPI.PPT_TotalA0) >= 0); // 2021 model +
panelPower.Visible = cpuAmode;
panelCPU.Visible = cpuBmode;
@@ -387,13 +418,13 @@ namespace GHelper
limit_cpu = Program.config.getConfigPerf("limit_cpu");
}
if (limit_total < 0) limit_total = ASUSWmi.DefaultTotal;
if (limit_total > ASUSWmi.MaxTotal) limit_total = ASUSWmi.MaxTotal;
if (limit_total < ASUSWmi.MinTotal) limit_total = ASUSWmi.MinTotal;
if (limit_total < 0) limit_total = AsusACPI.DefaultTotal;
if (limit_total > AsusACPI.MaxTotal) limit_total = AsusACPI.MaxTotal;
if (limit_total < AsusACPI.MinTotal) limit_total = AsusACPI.MinTotal;
if (limit_cpu < 0) limit_cpu = ASUSWmi.DefaultCPU;
if (limit_cpu > ASUSWmi.MaxCPU) limit_cpu = ASUSWmi.MaxCPU;
if (limit_cpu < ASUSWmi.MinCPU) limit_cpu = ASUSWmi.MinCPU;
if (limit_cpu < 0) limit_cpu = AsusACPI.DefaultCPU;
if (limit_cpu > AsusACPI.MaxCPU) limit_cpu = AsusACPI.MaxCPU;
if (limit_cpu < AsusACPI.MinCPU) limit_cpu = AsusACPI.MinCPU;
if (limit_cpu > limit_total) limit_cpu = limit_total;
trackTotal.Value = limit_total;
@@ -419,27 +450,43 @@ namespace GHelper
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);
Program.config.setConfig("mid_fan", 1);
chartCount++;
chartMid.Visible = true;
SetChart(chartMid, AsusFan.Mid);
LoadProfile(seriesMid, AsusFan.Mid);
MinimumSize = new Size(0, chartCount * 400 + 200);
}
else
{
Program.config.setConfig("mid_fan", 1);
chartMid.Visible = true;
SetChart(chartMid, 2);
LoadProfile(seriesMid, 2);
Program.config.setConfig("mid_fan", 0);
}
// XG Mobile Fan check
if (Program.acpi.IsXGConnected())
{
Program.config.setConfig("xgm_fan", 1);
chartCount++;
chartXGM.Visible = true;
SetChart(chartXGM, AsusFan.XGM);
LoadProfile(seriesXGM, AsusFan.XGM);
MinimumSize = new Size(0, chartCount * 400 + 200);
}
else
{
Program.config.setConfig("xgm_fan", 0);
}
SetChart(chartCPU, 0);
SetChart(chartGPU, 1);
SetChart(chartCPU, AsusFan.CPU);
SetChart(chartGPU, AsusFan.GPU);
LoadProfile(seriesCPU, 0);
LoadProfile(seriesGPU, 1);
LoadProfile(seriesCPU, AsusFan.CPU);
LoadProfile(seriesGPU, AsusFan.GPU);
int auto_apply = Program.config.getConfigPerf("auto_apply");
@@ -448,7 +495,7 @@ namespace GHelper
}
void LoadProfile(Series series, int device, int def = 0)
void LoadProfile(Series series, AsusFan device, bool reset = false)
{
series.ChartType = SeriesChartType.Line;
@@ -460,11 +507,16 @@ namespace GHelper
int mode = Program.config.getConfig("performance_mode");
byte[] curve = Program.config.getFanConfig(device);
if (def == 1 || curve.Length != 16)
curve = Program.wmi.GetFanCurve(device, mode);
if (reset || AsusACPI.IsEmptyCurve(curve))
{
curve = Program.acpi.GetFanCurve(device, mode);
if (curve.Length != 16 || curve.All(singleByte => singleByte == 0))
curve = Program.config.getDefaultCurve(device);
if (AsusACPI.IsEmptyCurve(curve))
curve = Program.config.getDefaultCurve(device);
curve = AsusACPI.FixFanCurve(curve);
}
//Debug.WriteLine(BitConverter.ToString(curve));
@@ -480,7 +532,7 @@ namespace GHelper
}
void SaveProfile(Series series, int device)
void SaveProfile(Series series, AsusFan device)
{
byte[] curve = new byte[16];
int i = 0;
@@ -500,10 +552,14 @@ namespace GHelper
private void ButtonReset_Click(object? sender, EventArgs e)
{
LoadProfile(seriesCPU, 0, 1);
LoadProfile(seriesGPU, 1, 1);
if (Program.config.getConfig("mid_fan") == 1)
LoadProfile(seriesMid, 2, 1);
LoadProfile(seriesCPU, AsusFan.CPU, true);
LoadProfile(seriesGPU, AsusFan.GPU, true);
if (Program.config.isConfig("mid_fan"))
LoadProfile(seriesMid, AsusFan.Mid, true);
if (Program.config.isConfig("xgm_fan"))
LoadProfile(seriesXGM, AsusFan.XGM, true);
checkApplyFans.Checked = false;
checkApplyPower.Checked = false;
@@ -511,12 +567,13 @@ namespace GHelper
Program.config.setConfigPerf("auto_apply", 0);
Program.config.setConfigPerf("auto_apply_power", 0);
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
if (Program.acpi.IsXGConnected()) AsusUSB.ResetXGM();
trackGPUCore.Value = 0;
trackGPUMemory.Value = 0;
trackGPUBoost.Value = ASUSWmi.MaxGPUBoost;
trackGPUTemp.Value = ASUSWmi.MaxGPUTemp;
trackGPUBoost.Value = AsusACPI.MaxGPUBoost;
trackGPUTemp.Value = AsusACPI.MaxGPUTemp;
Program.config.setConfigPerf("gpu_boost", trackGPUBoost.Value);
Program.config.setConfigPerf("gpu_temp", trackGPUTemp.Value);
@@ -533,10 +590,14 @@ namespace GHelper
curPoint = null;
labelTip.Visible = false;
SaveProfile(seriesCPU, 0);
SaveProfile(seriesGPU, 1);
if (Program.config.getConfig("mid_fan") == 1)
SaveProfile(seriesMid, 2);
SaveProfile(seriesCPU, AsusFan.CPU);
SaveProfile(seriesGPU, AsusFan.GPU);
if (Program.config.isConfig("mid_fan"))
SaveProfile(seriesMid, AsusFan.Mid);
if (Program.config.isConfig("xgm_fan"))
SaveProfile(seriesXGM, AsusFan.XGM);
Program.settingsForm.AutoFans();
@@ -577,7 +638,7 @@ namespace GHelper
if (dx > 100) dx = 100;
if (dy < 0) dy = 0;
if (dy > 100) dy = 100;
if (dy > fansMax) dy = fansMax;
dymin = (dx - 65) * 1.2;

View File

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

View File

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

View File

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

View File

@@ -3,6 +3,7 @@
public interface IGpuControl : IDisposable {
bool IsNvidia { get; }
bool IsValid { get; }
public string FullName { get; }
int? GetCurrentTemperature();
int? GetGpuUse();
}

View File

@@ -117,10 +117,10 @@ public class NvidiaGpuControl : IGpuControl
{
try
{
string script = @"$device = Get-PnpDevice | Where-Object { $_.FriendlyName -imatch 'NVIDIA' -and $_.Class -eq 'Display' }; Disable-PnpDevice $device.InstanceId -Confirm:$false; Start-Sleep -Seconds 2; Enable-PnpDevice $device.InstanceId -Confirm:$false";
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);
//Thread.Sleep(2000);
return true;
}
catch (Exception ex )

View File

@@ -41,9 +41,9 @@ public static class HardwareControl
if (fan > fanMax && fan < 110) SetFanMax(fan);
if (Program.config.getConfig("fan_rpm") == 1)
return " Fan: " + (fan * 100).ToString() + "RPM";
return GHelper.Properties.Strings.FanSpeed + (fan * 100).ToString() + GHelper.Properties.Strings.RPM;
else
return " Fan: " + Math.Min(Math.Round((float)fan / fanMax * 100), 100).ToString() + "%"; // relatively to 6000 rpm
return GHelper.Properties.Strings.FanSpeed + Math.Min(Math.Round((float)fan / fanMax * 100), 100).ToString() + "%"; // relatively to 6000 rpm
}
private static int GetGpuUse()
@@ -51,6 +51,7 @@ public static class HardwareControl
try
{
int? gpuUse = GpuControl?.GetGpuUse();
Logger.WriteLine("GPU usage: " + GpuControl?.FullName + " " + gpuUse + "%");
if (gpuUse is not null) return (int)gpuUse;
}
catch (Exception ex)
@@ -68,11 +69,11 @@ public static class HardwareControl
gpuTemp = -1;
gpuUse = -1;
cpuFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.CPU_Fan));
gpuFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.GPU_Fan));
midFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.Mid_Fan));
cpuFan = FormatFan(Program.acpi.DeviceGet(AsusACPI.CPU_Fan));
gpuFan = FormatFan(Program.acpi.DeviceGet(AsusACPI.GPU_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
{
@@ -98,7 +99,7 @@ public static class HardwareControl
}
if (gpuTemp is null || gpuTemp < 0)
gpuTemp = Program.wmi.DeviceGet(ASUSWmi.Temp_GPU);
gpuTemp = Program.acpi.DeviceGet(AsusACPI.Temp_GPU);
try
{
@@ -113,7 +114,7 @@ public static class HardwareControl
}
}
public static bool IsUsedGPU(int threshold = 20)
public static bool IsUsedGPU(int threshold = 10)
{
if (GetGpuUse() > threshold)
{
@@ -132,7 +133,7 @@ public static class HardwareControl
return null;
}
public static void RecreateGpuControlWithDelay(int delay = 3)
public static void RecreateGpuControlWithDelay(int delay = 5)
{
// Re-enabling the discrete GPU takes a bit of time,
// so a simple workaround is to refresh again after that happens

View File

@@ -4,7 +4,7 @@ using System.Runtime.InteropServices;
namespace OSD
{
class OSDNativeForm : NativeWindow, IDisposable
public class OSDNativeForm : NativeWindow, IDisposable
{
private bool _disposed = false;

View File

@@ -1,5 +1,6 @@
using System.Text.RegularExpressions;
using System.Text;
using System.Diagnostics;
namespace GHelper
{
@@ -33,6 +34,11 @@ namespace GHelper
File.WriteAllText(path, fileContents, Encoding.Unicode);
}
}
public static bool IsRunning()
{
return (Process.GetProcessesByName("AsusOptimization").Count() > 0);
}
}
}

View File

@@ -1,5 +1,5 @@
using GHelper.Gpu;
using Microsoft.Win32;
using NAudio.CoreAudioApi;
using System.Diagnostics;
using System.Globalization;
using System.Management;
@@ -19,11 +19,10 @@ namespace GHelper
Visible = true
};
public static ASUSWmi? wmi;
public static AsusACPI? acpi;
public static AppConfig config = new AppConfig();
public static SettingsForm settingsForm = new SettingsForm();
public static ToastForm toast = new ToastForm();
public static IntPtr unRegPowerNotify;
@@ -31,6 +30,8 @@ namespace GHelper
private static long lastTheme;
private static long lastAdmin;
private static bool isOptimizationRunning = OptimizationService.IsRunning();
private static PowerLineStatus isPlugged = PowerLineStatus.Unknown;
// The main entry point for the application
@@ -43,13 +44,13 @@ namespace GHelper
Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture;
Debug.WriteLine(CultureInfo.CurrentUICulture);
//Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("es");
//Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("fr");
CheckProcesses();
try
{
wmi = new ASUSWmi();
acpi = new AsusACPI();
}
catch
{
@@ -64,7 +65,7 @@ namespace GHelper
}
Logger.WriteLine("------------");
Logger.WriteLine("App launched: " + config.GetModel() + " :" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + (IsUserAdministrator()?"A":""));
Logger.WriteLine("App launched: " + config.GetModel() + " :" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + (IsUserAdministrator() ? "A" : ""));
Application.EnableVisualStyles();
@@ -74,7 +75,7 @@ namespace GHelper
trayIcon.MouseClick += TrayIcon_MouseClick;
wmi.SubscribeToEvents(WatcherEventArrived);
acpi.SubscribeToEvents(WatcherEventArrived);
settingsForm.InitAura();
settingsForm.InitMatrix();
@@ -91,14 +92,21 @@ namespace GHelper
unRegPowerNotify = NativeMethods.RegisterPowerSettingNotification(ds, settingGuid.ConsoleDisplayState, NativeMethods.DEVICE_NOTIFY_WINDOW_HANDLE);
// CTRL + SHIFT + F5 to cycle profiles
var ghk = new KeyHandler(KeyHandler.SHIFT | KeyHandler.CTRL, Keys.F5, ds);
ghk.Register();
Keys keybind_profile = (config.getConfig("keybind_profile") != -1) ? (Keys)config.getConfig("keybind_profile") : Keys.F5;
if (keybind_profile != 0)
{
var ghk = new KeyHandler(KeyHandler.SHIFT | KeyHandler.CTRL, keybind_profile, ds);
ghk.Register();
}
if (Environment.CurrentDirectory.Trim('\\') == Application.StartupPath.Trim('\\') || action.Length > 0)
{
SettingsToggle(action);
}
if (!isOptimizationRunning) AsusUSB.RunListener(HandleEvent);
Application.Run();
}
@@ -153,7 +161,7 @@ namespace GHelper
}
settingsForm.AutoKeyboard();
settingsForm.SetMatrix();
settingsForm.matrix.SetMatrix();
}
private static void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e)
@@ -214,6 +222,8 @@ namespace GHelper
action = "ghelper";
if (name == "fnf4")
action = "aura";
if (name == "m3" && !isOptimizationRunning)
action = "micmute";
}
switch (action)
@@ -248,22 +258,40 @@ namespace GHelper
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;
settingsForm.BeginInvoke(settingsForm.RunToast, muteStatus ? "Muted" : "Unmuted", muteStatus ? ToastIcon.MicrophoneMute : ToastIcon.Microphone);
}
break;
default:
break;
}
}
static void WatcherEventArrived(object sender, EventArrivedEventArgs e)
static void TabletMode()
{
var collection = (ManagementEventWatcher)sender;
bool touchpadState, tabletState;
if (e.NewEvent is null) return;
using (var key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\PrecisionTouchPad\Status", false))
{
touchpadState = (key?.GetValue("Enabled")?.ToString() == "1");
}
int EventID = int.Parse(e.NewEvent["EventID"].ToString());
tabletState = acpi.DeviceGet(AsusACPI.TabletState) > 0;
Logger.WriteLine("WMI event " + EventID);
Logger.WriteLine("Tablet: " + tabletState + " Touchpad: " + touchpadState);
if ((tabletState && touchpadState) || (!tabletState && !touchpadState)) AsusUSB.TouchpadToggle();
}
static void HandleEvent(int EventID)
{
switch (EventID)
{
case 124: // M3
@@ -278,9 +306,55 @@ namespace GHelper
case 179: // FN+F4
KeyProcess("fnf4");
return;
case 189: // Tablet mode
TabletMode();
return;
}
if (isOptimizationRunning) return;
// Asus Optimization service Events
int brightness = config.getConfig("keyboard_brightness");
switch (EventID)
{
case 197: // FN+F2
brightness = Math.Max(0, brightness - 1);
config.setConfig("keyboard_brightness", brightness);
AsusUSB.ApplyBrightness(brightness);
settingsForm.BeginInvoke(settingsForm.RunToast, "Backlight", ToastIcon.BacklightDown);
break;
case 196: // FN+F3
brightness = Math.Min(3, brightness + 1);
config.setConfig("keyboard_brightness", brightness);
AsusUSB.ApplyBrightness(brightness);
settingsForm.BeginInvoke(settingsForm.RunToast, "Backlight", ToastIcon.BacklightUp);
break;
case 16: // FN+F7
ScreenBrightness.Adjust(-10);
settingsForm.BeginInvoke(settingsForm.RunToast, "Brightness", ToastIcon.BrightnessDown);
break;
case 32: // FN+F8
ScreenBrightness.Adjust(+10);
settingsForm.BeginInvoke(settingsForm.RunToast, "Brightness", ToastIcon.BrightnessUp);
break;
case 107: // FN+F10
AsusUSB.TouchpadToggle();
settingsForm.BeginInvoke(settingsForm.RunToast, "Touchpad", ToastIcon.Touchpad);
break;
case 108: // FN+F11
Application.SetSuspendState(PowerState.Suspend, true, true);
break;
}
}
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);
}
static void SettingsToggle(string action = "")

View File

@@ -61,25 +61,55 @@ namespace GHelper.Properties {
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Icon eco {
internal static System.Drawing.Bitmap backlight_down {
get {
object obj = ResourceManager.GetObject("eco", resourceCulture);
return ((System.Drawing.Icon)(obj));
object obj = ResourceManager.GetObject("backlight_down", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap everything_is_fine_itsfine {
internal static System.Drawing.Bitmap backlight_up {
get {
object obj = ResourceManager.GetObject("everything-is-fine-itsfine", resourceCulture);
object obj = ResourceManager.GetObject("backlight_up", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap brightness_down {
get {
object obj = ResourceManager.GetObject("brightness_down", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap brightness_up {
get {
object obj = ResourceManager.GetObject("brightness_up", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
internal static System.Drawing.Icon eco {
get {
object obj = ResourceManager.GetObject("eco", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@@ -230,6 +260,26 @@ namespace GHelper.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap icons8_microphone_96 {
get {
object obj = ResourceManager.GetObject("icons8_microphone_96", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap icons8_mute_unmute_96 {
get {
object obj = ResourceManager.GetObject("icons8_mute_unmute_96", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@@ -330,6 +380,16 @@ namespace GHelper.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap icons8_touchpad_96 {
get {
object obj = ResourceManager.GetObject("icons8_touchpad_96", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View File

@@ -133,9 +133,6 @@
<data name="icons8-fiat-500-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-fiat-500-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-project-management-48 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-project-management-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-bicycle-48 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-bicycle-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@@ -205,13 +202,34 @@
<data name="icons8-speed-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-speed-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="everything-is-fine-itsfine" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\itsfine.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-help-64" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-help-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8_video_48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-video-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-project-management-48 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-project-management-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8_microphone_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-microphone-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8_touchpad_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-touchpad-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="backlight_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\backlight-down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="backlight_up" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\backlight-up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="brightness_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\brightness-down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="brightness_up" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\brightness-up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8_mute_unmute_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-mute-unmute-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

@@ -168,6 +168,15 @@ namespace GHelper.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Auto adjust Windows Power Mode.
/// </summary>
internal static string ApplyWindowsPowerPlan {
get {
return ResourceManager.GetString("ApplyWindowsPowerPlan", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Breathe.
/// </summary>
@@ -267,6 +276,15 @@ namespace GHelper.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Seconds to turn off backlight on battery.
/// </summary>
internal static string BacklightTimeout {
get {
return ResourceManager.GetString("BacklightTimeout", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Balanced.
/// </summary>
@@ -465,6 +483,15 @@ namespace GHelper.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Fan: .
/// </summary>
internal static string FanSpeed {
get {
return ResourceManager.GetString("FanSpeed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Fans + Power.
/// </summary>
@@ -474,6 +501,15 @@ namespace GHelper.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Dynamic Boost.
/// </summary>
internal static string GPUBoost {
get {
return ResourceManager.GetString("GPUBoost", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Changing.
/// </summary>
@@ -483,6 +519,24 @@ namespace GHelper.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Core Clock Offset.
/// </summary>
internal static string GPUCoreClockOffset {
get {
return ResourceManager.GetString("GPUCoreClockOffset", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Memory Clock Offset.
/// </summary>
internal static string GPUMemoryClockOffset {
get {
return ResourceManager.GetString("GPUMemoryClockOffset", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to GPU Mode.
/// </summary>
@@ -528,6 +582,15 @@ namespace GHelper.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Temperature Target.
/// </summary>
internal static string GPUTempTarget {
get {
return ResourceManager.GetString("GPUTempTarget", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Key Bindings.
/// </summary>
@@ -609,6 +672,15 @@ namespace GHelper.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Audio Visualizer.
/// </summary>
internal static string MatrixAudio {
get {
return ResourceManager.GetString("MatrixAudio", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Binary Banner.
/// </summary>
@@ -708,6 +780,15 @@ namespace GHelper.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Mute Mic.
/// </summary>
internal static string MuteMic {
get {
return ResourceManager.GetString("MuteMic", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Open G-Helper window.
/// </summary>

View File

@@ -59,106 +59,115 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ACPIError" xml:space="preserve">
<value>Can't connect to ASUS ACPI. Application can't function without it. Try to install Asus System Control Interface</value>
<value>Verbindung zu ASUS ACPI fehlgeschlagen. G-Helper kann nicht ausgeführt werden. Bitte installiere ASUS System Control Interface.</value>
</data>
<data name="AlertDGPU" xml:space="preserve">
<value>Looks like GPU is in heavy use, disable it?</value>
<value>Die GPU wird gerade verwendet. Trotzdem deaktivieren?</value>
</data>
<data name="AlertDGPUTitle" xml:space="preserve">
<value>Eco Mode</value>
<value>Eco Modus</value>
</data>
<data name="AlertUltimateOff" xml:space="preserve">
<value>Switching off Ultimate Mode requires restart</value>
<value>Wechseln in den Ultimate Modus benötigt einen Neustart. Jetzt neustarten?</value>
</data>
<data name="AlertUltimateOn" xml:space="preserve">
<value>Ultimate Mode requires restart</value>
<value>Ultimate Modus benötigt einen Neustart</value>
</data>
<data name="AlertUltimateTitle" xml:space="preserve">
<value>Reboot now?</value>
<value>Jetzt neustarten?</value>
</data>
<data name="AnimationSpeed" xml:space="preserve">
<value>Animation Speed</value>
<value>Animationsgeschwindigkeit</value>
</data>
<data name="AnimeMatrix" xml:space="preserve">
<value>Anime Matrix</value>
<value>AniMeMatrix</value>
</data>
<data name="AppAlreadyRunning" xml:space="preserve">
<value>App already running</value>
<value>Die Anwendung läuft bereits</value>
</data>
<data name="AppAlreadyRunningText" xml:space="preserve">
<value>G-Helper is already running. Check system tray for an icon.</value>
<value>G-Helper läuft bereits. Bitte prüfe den Systemtray.</value>
</data>
<data name="ApplyFanCurve" xml:space="preserve">
<value>Apply Custom Fan Curve</value>
<value>Lüfterkurve anweden</value>
</data>
<data name="ApplyPowerLimits" xml:space="preserve">
<value>Apply Power Limits</value>
<value>Leistunsgrenzen anwenden</value>
</data>
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
<value>Windows Leistungsmodus automatisch anpassen</value>
</data>
<data name="AuraBreathe" xml:space="preserve">
<value>Breathe</value>
<value>Atmen</value>
</data>
<data name="AuraColorCycle" xml:space="preserve">
<value>Color Cycle</value>
<value>Farbwechsel</value>
</data>
<data name="AuraFast" xml:space="preserve">
<value>Fast</value>
<value>Schnell</value>
</data>
<data name="AuraNormal" xml:space="preserve">
<value>Normal</value>
</data>
<data name="AuraRainbow" xml:space="preserve">
<value>Rainbow</value>
<value>Regenbogen</value>
</data>
<data name="AuraSlow" xml:space="preserve">
<value>Slow</value>
<value>Langsam</value>
</data>
<data name="AuraStatic" xml:space="preserve">
<value>Static</value>
<value>Statisch</value>
</data>
<data name="AuraStrobe" xml:space="preserve">
<value>Strobe</value>
<value>Stroboskop</value>
</data>
<data name="AutoMode" xml:space="preserve">
<value>Auto</value>
</data>
<data name="AutoRefreshTooltip" xml:space="preserve">
<value>Sets 60Hz to save battery, and back when plugged</value>
<value>60Hz im Batteriebetrieb Maximal wenn eingesteckt.</value>
</data>
<data name="Awake" xml:space="preserve">
<value>Awake</value>
<value>Im Betrieb</value>
</data>
<data name="BacklightTimeout" xml:space="preserve">
<value>Tastaturbelechtung abschalten in (Sekunden)</value>
</data>
<data name="Balanced" xml:space="preserve">
<value>Balanced</value>
<value>Ausbalanciert</value>
</data>
<data name="BatteryChargeLimit" xml:space="preserve">
<value>Battery Charge Limit</value>
<value>Ladebegrenzung</value>
</data>
<data name="Boot" xml:space="preserve">
<value>Boot</value>
<value>Hochfahren</value>
</data>
<data name="Brightness" xml:space="preserve">
<value>Helligkeit</value>
</data>
<data name="Color" xml:space="preserve">
<value>Color</value>
<value>Farbe</value>
</data>
<data name="CPUBoost" xml:space="preserve">
<value>CPU Boost</value>
</data>
<data name="Custom" xml:space="preserve">
<value>Custom</value>
<value>Benutzerdefiniert</value>
</data>
<data name="Default" xml:space="preserve">
<value>Default</value>
<value>Standard</value>
</data>
<data name="DisableOverdrive" xml:space="preserve">
<value>Disable screen overdrive</value>
<value>Overdrive abschalten</value>
</data>
<data name="Discharging" xml:space="preserve">
<value>Discharging</value>
<value>Entlädt</value>
</data>
<data name="DownloadUpdate" xml:space="preserve">
<value>Download Update</value>
<value>Updates herunterladen</value>
</data>
<data name="EcoGPUTooltip" xml:space="preserve">
<value>Disables dGPU for battery savings</value>
<value>dGPU zum Stromsparen abschalten</value>
</data>
<data name="EcoMode" xml:space="preserve">
<value>Eco</value>
@@ -167,172 +176,193 @@
<value>Extra</value>
</data>
<data name="ExtraSettings" xml:space="preserve">
<value>Extra Settings</value>
<value>Extra-Einstellungen</value>
</data>
<data name="FactoryDefaults" xml:space="preserve">
<value>Factory Defaults</value>
<value>Werkseinstellungen</value>
</data>
<data name="FanCurves" xml:space="preserve">
<value>Fan Curves</value>
<value>Lüfterkurven</value>
</data>
<data name="FanProfileCPU" xml:space="preserve">
<value>CPU Fan Profile</value>
<value>CPU Lüfterprofil</value>
</data>
<data name="FanProfileGPU" xml:space="preserve">
<value>GPU Fan Profile</value>
<value>GPU Lüfterprofil</value>
</data>
<data name="FanProfileMid" xml:space="preserve">
<value>Mid Fan Profile</value>
<value>Mittleres Lüfterprofil</value>
</data>
<data name="FanProfiles" xml:space="preserve">
<value>Fan Profiles</value>
<value>Lüfterprofile</value>
</data>
<data name="FansAndPower" xml:space="preserve">
<value>Fans and Power</value>
<value>Lüfter und Leistung</value>
</data>
<data name="FanSpeed" xml:space="preserve">
<value> Lüfter: </value>
</data>
<data name="FansPower" xml:space="preserve">
<value>Fans + Power</value>
<value>Lüfter + Leistung</value>
</data>
<data name="GPUBoost" xml:space="preserve">
<value>Dynamic Boost</value>
</data>
<data name="GPUChanging" xml:space="preserve">
<value>Changing</value>
<value>Wechseln</value>
</data>
<data name="GPUCoreClockOffset" xml:space="preserve">
<value>Kernfrequenz Anpassung</value>
</data>
<data name="GPUMemoryClockOffset" xml:space="preserve">
<value>Speicherfrequenz Anpassung</value>
</data>
<data name="GPUMode" xml:space="preserve">
<value>GPU Mode</value>
<value>GPU Modus</value>
</data>
<data name="GPUModeEco" xml:space="preserve">
<value>iGPU only</value>
<value>Nur iGPU</value>
</data>
<data name="GPUModeStandard" xml:space="preserve">
<value>iGPU + dGPU</value>
</data>
<data name="GPUModeUltimate" xml:space="preserve">
<value>dGPU exclusive</value>
<value>Nur dGPU</value>
</data>
<data name="GPUTempTarget" xml:space="preserve">
<value>Maximale GPU Temperatur</value>
</data>
<data name="KeyBindings" xml:space="preserve">
<value>Key Bindings</value>
<value>Tastenbelegung</value>
</data>
<data name="Keyboard" xml:space="preserve">
<value>Keyboard</value>
<value>Tastatur</value>
</data>
<data name="KeyboardAuto" xml:space="preserve">
<value>Lower backlight brightness on battery and back when plugged</value>
<value>Tastaturbeleuchtung im Batteriebetrieb abdunkeln.</value>
</data>
<data name="KeyboardBacklight" xml:space="preserve">
<value>Keyboard Backlight</value>
<value>Tastaturbeleuchtung</value>
</data>
<data name="LaptopBacklight" xml:space="preserve">
<value>Laptopbelechtung</value>
</data>
<data name="LaptopKeyboard" xml:space="preserve">
<value>Laptop Keyboard</value>
<value>Laptoptastatur</value>
</data>
<data name="LaptopScreen" xml:space="preserve">
<value>Laptop Screen</value>
<value>Laptopbildschirm</value>
</data>
<data name="MatrixBanner" xml:space="preserve">
<value>Binary Banner</value>
</data>
<data name="MatrixBright" xml:space="preserve">
<value>Bright</value>
<value>Hell</value>
</data>
<data name="MatrixClock" xml:space="preserve">
<value>Clock</value>
<value>Uhr</value>
</data>
<data name="MatrixDim" xml:space="preserve">
<value>Dim</value>
<value>Dunkel</value>
</data>
<data name="MatrixLogo" xml:space="preserve">
<value>Rog Logo</value>
<value>ROG Logo</value>
</data>
<data name="MatrixMedium" xml:space="preserve">
<value>Medium</value>
<value>Mittel</value>
</data>
<data name="MatrixOff" xml:space="preserve">
<value>Off</value>
<value>Aus</value>
</data>
<data name="MatrixPicture" xml:space="preserve">
<value>Picture</value>
<value>Bild</value>
</data>
<data name="MaxRefreshTooltip" xml:space="preserve">
<value>Max refresh rate for lower latency</value>
<value>Maximale Wiederholrate für niedrigste Latenz</value>
</data>
<data name="MinRefreshTooltip" xml:space="preserve">
<value>60Hz refresh rate to save battery</value>
<value>60Hz um Strom zu sparen</value>
</data>
<data name="Multizone" xml:space="preserve">
<value>Multizone</value>
<value>Multi-Zone</value>
</data>
<data name="OpenGHelper" xml:space="preserve">
<value>Open G-Helper window</value>
<value>G-Helper Fenster öffnen</value>
</data>
<data name="Optimized" xml:space="preserve">
<value>Optimized</value>
<value>Optimiert</value>
</data>
<data name="OptimizedGPUTooltip" xml:space="preserve">
<value>Switch to Eco on battery and to Standard when plugged</value>
<value>Eco Modus im Batteriebetrieb, Standard wenn eingesteckt.</value>
</data>
<data name="OptimizedUSBC" xml:space="preserve">
<value>GPU beim USB-C Laden im Optimierten Modus deaktiviert lassen</value>
</data>
<data name="Other" xml:space="preserve">
<value>Other</value>
<value>Sonstiges</value>
</data>
<data name="Overdrive" xml:space="preserve">
<value>Overdrive</value>
</data>
<data name="PerformanceMode" xml:space="preserve">
<value>Performance Mode</value>
<value>Leistungsmodus</value>
</data>
<data name="PictureGif" xml:space="preserve">
<value>Picture / Gif</value>
<value>Bild / GIF</value>
</data>
<data name="PlayPause" xml:space="preserve">
<value>Play / Pause</value>
<value>Wiedergabe / Pause</value>
</data>
<data name="PowerLimits" xml:space="preserve">
<value>Power Limits (PPT)</value>
<value>Leistungsbegrenzung (PPT)</value>
</data>
<data name="PPTExperimental" xml:space="preserve">
<value>Power Limits (PPT) is experimental feature. Use carefully and on your own risk!</value>
<value>Leistungsbegrenzung (PPT) ist experimentell. Nutzung erfolgt auf eigene Gefahr!</value>
</data>
<data name="PrintScreen" xml:space="preserve">
<value>PrintScreen</value>
<value>Druck</value>
</data>
<data name="Quit" xml:space="preserve">
<value>Quit</value>
<value>Schließen</value>
</data>
<data name="RPM" xml:space="preserve">
<value>RPM</value>
<value>U/Min</value>
</data>
<data name="RunOnStartup" xml:space="preserve">
<value>Run on Startup</value>
<value>Beim Start ausführen</value>
</data>
<data name="Shutdown" xml:space="preserve">
<value>Shutdown</value>
<value>Herunterfahren</value>
</data>
<data name="Silent" xml:space="preserve">
<value>Silent</value>
<value>Leise</value>
</data>
<data name="Sleep" xml:space="preserve">
<value>Sleep</value>
<value>Standby</value>
</data>
<data name="StandardGPUTooltip" xml:space="preserve">
<value>Enables dGPU for standard use</value>
<value>dGPU aktivieren</value>
</data>
<data name="StandardMode" xml:space="preserve">
<value>Standard</value>
</data>
<data name="StartupError" xml:space="preserve">
<value>Startup Error</value>
<value>Startfehler</value>
</data>
<data name="ToggleAura" xml:space="preserve">
<value>Toggle Aura</value>
<value>Aura umschalten</value>
</data>
<data name="Turbo" xml:space="preserve">
<value>Turbo</value>
</data>
<data name="TurnedOff" xml:space="preserve">
<value>Turned off</value>
<value>Ausgeschaltet</value>
</data>
<data name="TurnOffOnBattery" xml:space="preserve">
<value>Turn off on battery</value>
<value>Im Batteriebetrieb abschalten</value>
</data>
<data name="UltimateGPUTooltip" xml:space="preserve">
<value>Routes laptop screen to dGPU, maximizing FPS</value>
<value>Verbindet den Bildschirm mit der dGPU für maximale Leistung.</value>
</data>
<data name="UltimateMode" xml:space="preserve">
<value>Ultimate</value>
@@ -341,9 +371,9 @@
<value>Version</value>
</data>
<data name="VolumeMute" xml:space="preserve">
<value>Volume Mute</value>
<value>Stummschalten</value>
</data>
<data name="WindowTop" xml:space="preserve">
<value>Keep app window always on top</value>
<value>Fenster immer über allen anderen</value>
</data>
</root>

View File

@@ -153,6 +153,9 @@
<data name="ApplyPowerLimits" xml:space="preserve">
<value>Aplicar límites de energía</value>
</data>
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
<value>Auto-ajustar plan de energía Windows</value>
</data>
<data name="AuraBreathe" xml:space="preserve">
<value>Respiración</value>
</data>
@@ -186,6 +189,9 @@
<data name="Awake" xml:space="preserve">
<value>Encendida</value>
</data>
<data name="BacklightTimeout" xml:space="preserve">
<value>Apagar retroiluminación con batería (s.)</value>
</data>
<data name="Balanced" xml:space="preserve">
<value>Equilibrado</value>
</data>
@@ -252,11 +258,23 @@
<data name="FansAndPower" xml:space="preserve">
<value>Ventiladores y energía</value>
</data>
<data name="FanSpeed" xml:space="preserve">
<value> Fan: </value>
</data>
<data name="FansPower" xml:space="preserve">
<value>Ventiladores + Energía</value>
</data>
<data name="GPUBoost" xml:space="preserve">
<value>Dynamic Boost</value>
</data>
<data name="GPUChanging" xml:space="preserve">
<value>Cargando</value>
</data>
<data name="GPUCoreClockOffset" xml:space="preserve">
<value>Core Clock Offset</value>
</data>
<data name="GPUMemoryClockOffset" xml:space="preserve">
<value>Memory Clock Offset</value>
</data>
<data name="GPUMode" xml:space="preserve">
<value>Modo de GPU</value>
@@ -272,6 +290,9 @@
</data>
<data name="GPUSettings" xml:space="preserve">
<value>Ajustes de GPU</value>
</data>
<data name="GPUTempTarget" xml:space="preserve">
<value>Temperatura objetivo</value>
</data>
<data name="KeyBindings" xml:space="preserve">
<value>Atajos de teclado</value>
@@ -299,6 +320,9 @@
</data>
<data name="Logo" xml:space="preserve">
<value>Logo</value>
</data>
<data name="MatrixAudio" xml:space="preserve">
<value>Visualizador de audio</value>
</data>
<data name="MatrixBanner" xml:space="preserve">
<value>Banner binario</value>
@@ -372,6 +396,9 @@
<data name="Quit" xml:space="preserve">
<value>Quitar</value>
</data>
<data name="RestartGPU" xml:space="preserve">
<value>Algo está usando la dGPU e impide usar Modo Eco. ¿Reiniciar dGPU en administrador de dispositivos? * Proceda bajo su propio riesgo.</value>
</data>
<data name="RPM" xml:space="preserve">
<value>RPM</value>
</data>

View File

@@ -59,280 +59,283 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ACPIError" xml:space="preserve">
<value>Can't connect to ASUS ACPI. Application can't function without it. Try to install Asus System Control Interface</value>
<value>Connexion impossible avec ASUS ACPI. Lapplication ne peut fonctionner sans. Veuillez installer Asus System Control Interface.</value>
</data>
<data name="AlertDGPU" xml:space="preserve">
<value>Looks like GPU is in heavy use, disable it?</value>
<value>Le GPU semble être surchargé, voulez vous le désactiver ?</value>
</data>
<data name="AlertDGPUTitle" xml:space="preserve">
<value>Eco Mode</value>
<value>Mode Économique</value>
</data>
<data name="AlertUltimateOff" xml:space="preserve">
<value>Switching off Ultimate Mode requires restart</value>
<value>Désactiver le Mode Ultime requiert un redémarrage</value>
</data>
<data name="AlertUltimateOn" xml:space="preserve">
<value>Ultimate Mode requires restart</value>
<value>Activer le Mode Ultime requiert un redémarrage</value>
</data>
<data name="AlertUltimateTitle" xml:space="preserve">
<value>Reboot now?</value>
<value>Redémarrer maintenant ?</value>
</data>
<data name="AnimationSpeed" xml:space="preserve">
<value>Animation Speed</value>
<value>Vitesse danimation</value>
</data>
<data name="AnimeMatrix" xml:space="preserve">
<value>Anime Matrix</value>
</data>
<data name="AppAlreadyRunning" xml:space="preserve">
<value>App already running</value>
<value>Lapplication est déjà en cours déxecution</value>
</data>
<data name="AppAlreadyRunningText" xml:space="preserve">
<value>G-Helper is already running. Check system tray for an icon.</value>
<value>G-Helper est déjà en cours d'exécution. Vérifiez la barre d'état du système</value>
</data>
<data name="ApplyFanCurve" xml:space="preserve">
<value>Apply Custom Fan Curve</value>
<value>Appliquer la courbe de ventilateur personnalisée</value>
</data>
<data name="ApplyPowerLimits" xml:space="preserve">
<value>Apply Power Limits</value>
<value>Appliquer les limites de performance</value>
</data>
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
<value>Ajuster automatiquement les modes de Performance Windows</value>
</data>
<data name="AuraBreathe" xml:space="preserve">
<value>Breathe</value>
<value>Respiration</value>
</data>
<data name="AuraColorCycle" xml:space="preserve">
<value>Color Cycle</value>
<value>Cycle de couleur</value>
</data>
<data name="AuraFast" xml:space="preserve">
<value>Fast</value>
<value>Rapide</value>
</data>
<data name="AuraNormal" xml:space="preserve">
<value>Normal</value>
</data>
<data name="AuraRainbow" xml:space="preserve">
<value>Rainbow</value>
<value>Arc-en-ciel</value>
</data>
<data name="AuraSlow" xml:space="preserve">
<value>Slow</value>
<value>Lent</value>
</data>
<data name="AuraStatic" xml:space="preserve">
<value>Static</value>
<value>Statique</value>
</data>
<data name="AuraStrobe" xml:space="preserve">
<value>Strobe</value>
<value>Stroboscopique</value>
</data>
<data name="AutoMode" xml:space="preserve">
<value>Auto</value>
<value>Automatique</value>
</data>
<data name="AutoRefreshTooltip" xml:space="preserve">
<value>Sets 60Hz to save battery, and back when plugged</value>
<value>Limiter le rafraîchissement de lécran à 60Hz pour économiser de la batterie, et retour à la normal en chargement</value>
</data>
<data name="Awake" xml:space="preserve">
<value>Awake</value>
<value>Éveillé</value>
</data>
<data name="Balanced" xml:space="preserve">
<value>Balanced</value>
<value>Balancé</value>
</data>
<data name="BatteryChargeLimit" xml:space="preserve">
<value>Battery Charge Limit</value>
<value>Limite de charge de la batterie</value>
</data>
<data name="Boot" xml:space="preserve">
<value>Boot</value>
<value>Au lancement</value>
</data>
<data name="Color" xml:space="preserve">
<value>Color</value>
<value>Couleur</value>
</data>
<data name="CPUBoost" xml:space="preserve">
<value>CPU Boost</value>
</data>
<data name="Custom" xml:space="preserve">
<value>Custom</value>
<value>Personnalisé</value>
</data>
<data name="Default" xml:space="preserve">
<value>Default</value>
<value>Par défaut</value>
</data>
<data name="DisableOverdrive" xml:space="preserve">
<value>Disable screen overdrive</value>
<value>Désactiver lOverdrive de lÉcran</value>
</data>
<data name="Discharging" xml:space="preserve">
<value>Discharging</value>
<value>En déchargement</value>
</data>
<data name="DownloadUpdate" xml:space="preserve">
<value>Download Update</value>
<value>Télécharger la mise à jour</value>
</data>
<data name="EcoGPUTooltip" xml:space="preserve">
<value>Disables dGPU for battery savings</value>
<value>Désactive le dGPU pour économiser la batterie</value>
</data>
<data name="EcoMode" xml:space="preserve">
<value>Eco</value>
<value>Économique</value>
</data>
<data name="Extra" xml:space="preserve">
<value>Extra</value>
<value>Aditionnel</value>
</data>
<data name="ExtraSettings" xml:space="preserve">
<value>Extra Settings</value>
<value>Paramètres additionnels</value>
</data>
<data name="FactoryDefaults" xml:space="preserve">
<value>Factory Defaults</value>
<value>Paramètres d'usine</value>
</data>
<data name="FanCurves" xml:space="preserve">
<value>Fan Curves</value>
<value>Courbes des ventilateurs</value>
</data>
<data name="FanProfileCPU" xml:space="preserve">
<value>CPU Fan Profile</value>
<value>Profil de ventilateur CPU</value>
</data>
<data name="FanProfileGPU" xml:space="preserve">
<value>GPU Fan Profile</value>
<value>Profil de ventilateur GPU</value>
</data>
<data name="FanProfileMid" xml:space="preserve">
<value>Mid Fan Profile</value>
<value>Profil de ventilateur central</value>
</data>
<data name="FanProfiles" xml:space="preserve">
<value>Fan Profiles</value>
<value>Profil des ventilateurs </value>
</data>
<data name="FansAndPower" xml:space="preserve">
<value>Fans and Power</value>
<value>Ventilateurs et Puissance</value>
</data>
<data name="FansPower" xml:space="preserve">
<value>Fans + Power</value>
<value>Ventilateurs + Puissance</value>
</data>
<data name="GPUChanging" xml:space="preserve">
<value>Changing</value>
<value>Changement</value>
</data>
<data name="GPUMode" xml:space="preserve">
<value>GPU Mode</value>
<value>Mode de GPU</value>
</data>
<data name="GPUModeEco" xml:space="preserve">
<value>iGPU only</value>
<value>Seulement iGPU</value>
</data>
<data name="GPUModeStandard" xml:space="preserve">
<value>iGPU + dGPU</value>
</data>
<data name="GPUModeUltimate" xml:space="preserve">
<value>dGPU exclusive</value>
<value>Exclusivement dGPU</value>
</data>
<data name="KeyBindings" xml:space="preserve">
<value>Key Bindings</value>
<value>Raccourcis clavier</value>
</data>
<data name="Keyboard" xml:space="preserve">
<value>Keyboard</value>
<value>Clavier</value>
</data>
<data name="KeyboardAuto" xml:space="preserve">
<value>Lower backlight brightness on battery and back when plugged</value>
<value>Baisser la luminosité du rétroéclairage sur batterie et retour à la normal en charge</value>
</data>
<data name="KeyboardBacklight" xml:space="preserve">
<value>Keyboard Backlight</value>
<value>Rétroéclairage du clavier</value>
</data>
<data name="LaptopKeyboard" xml:space="preserve">
<value>Laptop Keyboard</value>
<value>Clavier de lordinateur</value>
</data>
<data name="LaptopScreen" xml:space="preserve">
<value>Laptop Screen</value>
<value>Écran de lordinateur</value>
</data>
<data name="MatrixBanner" xml:space="preserve">
<value>Binary Banner</value>
<value>Bannière binaire</value>
</data>
<data name="MatrixBright" xml:space="preserve">
<value>Bright</value>
<value>Lumineux</value>
</data>
<data name="MatrixClock" xml:space="preserve">
<value>Clock</value>
<value>Horloge</value>
</data>
<data name="MatrixDim" xml:space="preserve">
<value>Dim</value>
<value>Faible</value>
</data>
<data name="MatrixLogo" xml:space="preserve">
<value>Rog Logo</value>
<value>Logo ROG</value>
</data>
<data name="MatrixMedium" xml:space="preserve">
<value>Medium</value>
<value>Moyen</value>
</data>
<data name="MatrixOff" xml:space="preserve">
<value>Off</value>
<value>Éteint</value>
</data>
<data name="MatrixPicture" xml:space="preserve">
<value>Picture</value>
<value>Image</value>
</data>
<data name="MaxRefreshTooltip" xml:space="preserve">
<value>Max refresh rate for lower latency</value>
<value>Rafraichissement maximum pour baisser la latance</value>
</data>
<data name="MinRefreshTooltip" xml:space="preserve">
<value>60Hz refresh rate to save battery</value>
<value>Rafraichissement à 60Hz pour économiser de la batterie</value>
</data>
<data name="Multizone" xml:space="preserve">
<value>Multizone</value>
</data>
<data name="OpenGHelper" xml:space="preserve">
<value>Open G-Helper window</value>
<value>Ouvrir la fenêtre G-Helper</value>
</data>
<data name="Optimized" xml:space="preserve">
<value>Optimized</value>
<value>Optimizé</value>
</data>
<data name="OptimizedGPUTooltip" xml:space="preserve">
<value>Switch to Eco on battery and to Standard when plugged</value>
<value>Passer en Économique sur batterie et sur Standard en chargement</value>
</data>
<data name="Other" xml:space="preserve">
<value>Other</value>
<value>Autre</value>
</data>
<data name="Overdrive" xml:space="preserve">
<value>Overdrive</value>
</data>
<data name="PerformanceMode" xml:space="preserve">
<value>Performance Mode</value>
<value>Mode Performance</value>
</data>
<data name="PictureGif" xml:space="preserve">
<value>Picture / Gif</value>
<value>Image / Gif</value>
</data>
<data name="PlayPause" xml:space="preserve">
<value>Play / Pause</value>
<value>Reproduire / Pause</value>
</data>
<data name="PowerLimits" xml:space="preserve">
<value>Power Limits (PPT)</value>
<value>Limites de puissance (PPT)</value>
</data>
<data name="PPTExperimental" xml:space="preserve">
<value>Power Limits (PPT) is experimental feature. Use carefully and on your own risk!</value>
<value>Limites de puissance (PPT) est une fonctionnalité expérimentale. Utilisez la avec attention et à vos risques.</value>
</data>
<data name="PrintScreen" xml:space="preserve">
<value>PrintScreen</value>
<value>Capture dÉcran</value>
</data>
<data name="Quit" xml:space="preserve">
<value>Quit</value>
<value>Quitter</value>
</data>
<data name="RPM" xml:space="preserve">
<value>RPM</value>
</data>
<data name="RunOnStartup" xml:space="preserve">
<value>Run on Startup</value>
<value>Executer au lancement</value>
</data>
<data name="Shutdown" xml:space="preserve">
<value>Shutdown</value>
<value>Éteindre</value>
</data>
<data name="Silent" xml:space="preserve">
<value>Silent</value>
<value>Silencieux</value>
</data>
<data name="Sleep" xml:space="preserve">
<value>Sleep</value>
<value>En veille</value>
</data>
<data name="StandardGPUTooltip" xml:space="preserve">
<value>Enables dGPU for standard use</value>
<value>Active le dGPU pour une utilisation standard</value>
</data>
<data name="StandardMode" xml:space="preserve">
<value>Standard</value>
</data>
<data name="StartupError" xml:space="preserve">
<value>Startup Error</value>
<value>Erreur au lancement</value>
</data>
<data name="ToggleAura" xml:space="preserve">
<value>Toggle Aura</value>
<value>Basculer Aura</value>
</data>
<data name="Turbo" xml:space="preserve">
<value>Turbo</value>
</data>
<data name="TurnedOff" xml:space="preserve">
<value>Turned off</value>
<value>Éteint</value>
</data>
<data name="TurnOffOnBattery" xml:space="preserve">
<value>Turn off on battery</value>
<value>Éteindre sur batterie</value>
</data>
<data name="UltimateGPUTooltip" xml:space="preserve">
<value>Routes laptop screen to dGPU, maximizing FPS</value>
<value>Redirige lécran de lordinateur sur le dGPU pour maximiser le nombre de FPS</value>
</data>
<data name="UltimateMode" xml:space="preserve">
<value>Ultimate</value>
@@ -341,9 +344,57 @@
<value>Version</value>
</data>
<data name="VolumeMute" xml:space="preserve">
<value>Volume Mute</value>
<value>Mettre en sourdine</value>
</data>
<data name="WindowTop" xml:space="preserve">
<value>Keep app window always on top</value>
<value>Garder lapplication au premier plan</value>
</data>
<data name="Brightness" xml:space="preserve">
<value>Luminosité</value>
</data>
<data name="FanSpeed" xml:space="preserve">
<value>Ventilateurs :</value>
</data>
<data name="GPUBoost" xml:space="preserve">
<value>Boost Dynamique</value>
</data>
<data name="GPUCoreClockOffset" xml:space="preserve">
<value>Augmentation de la fréquence de base</value>
</data>
<data name="GPUMemoryClockOffset" xml:space="preserve">
<value>Augmentation de la fréquence de la mémoire</value>
</data>
<data name="GPUSettings" xml:space="preserve">
<value>Paramêtres de GPU</value>
</data>
<data name="GPUTempTarget" xml:space="preserve">
<value>Température ciblée</value>
</data>
<data name="LaptopBacklight" xml:space="preserve">
<value>Rétroéclairage de lordinateur</value>
</data>
<data name="Lid" xml:space="preserve">
<value>Capot</value>
</data>
<data name="Lightbar" xml:space="preserve">
<value>Barre de lumière</value>
</data>
<data name="Logo" xml:space="preserve">
<value>Logo</value>
</data>
<data name="OptimizedUSBC" xml:space="preserve">
<value>Garder le GPU désactivé en chargement via USB-C dans le mode Optimisé</value>
</data>
<data name="RestartGPU" xml:space="preserve">
<value>Un processus utilise le dGPU est empêche le passage en mode Économique. Redémarrer le dGPU dans le gestionnaire de périphérique ? * Veuillez procéder à vos risques</value>
</data>
<data name="ToggleMiniled" xml:space="preserve">
<value>Basculer sur Miniled (si supporté)</value>
</data>
<data name="ToggleScreen" xml:space="preserve">
<value>Basculer décran</value>
</data>
<data name="BacklightTimeout" xml:space="preserve">
<value>Nombre de secondes avant déteindre le rétroéclairage sur batterie</value>
</data>
</root>

View File

@@ -94,6 +94,9 @@
<data name="ApplyPowerLimits" xml:space="preserve">
<value>Apply Power Limits</value>
</data>
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
<value>Auto Adjust Windows Power Mode</value>
</data>
<data name="AuraBreathe" xml:space="preserve">
<value>Breathe</value>
</data>

View File

@@ -0,0 +1,350 @@
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ACPIError" xml:space="preserve">
<value>Não foi possível conectar ao ASUS ACPI. O applicativo não pode funcionar sem isso. Tente instalar Asus System Controle Interface</value>
</data>
<data name="AlertDGPU" xml:space="preserve">
<value>Parece que o GPU está em uso pesado.</value>
</data>
<data name="AlertDGPUTitle" xml:space="preserve">
<value>Modo econômico</value>
</data>
<data name="AlertUltimateOff" xml:space="preserve">
<value>Passar ao Modo Final implica na reinicialização do sistema</value>
</data>
<data name="AlertUltimateOn" xml:space="preserve">
<value>Modo Ultimado necessita de reinicialização.</value>
</data>
<data name="AlertUltimateTitle" xml:space="preserve">
<value>Reiniciar agora ?</value>
</data>
<data name="AnimationSpeed" xml:space="preserve">
<value>Velocidade da Animação</value>
</data>
<data name="AnimeMatrix" xml:space="preserve">
<value>Anime Matrix</value>
</data>
<data name="AppAlreadyRunning" xml:space="preserve">
<value>O applicativo já está em execução</value>
</data>
<data name="AppAlreadyRunningText" xml:space="preserve">
<value>G-Helper já está em execução. Verifique a barra de sistema</value>
</data>
<data name="ApplyFanCurve" xml:space="preserve">
<value>Aplicar a curva de ventilador personalizada</value>
</data>
<data name="ApplyPowerLimits" xml:space="preserve">
<value>Aplicar as limitações de energia</value>
</data>
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
<value>Automaticamente ajustar os Modos de Energia Windows</value>
</data>
<data name="AuraBreathe" xml:space="preserve">
<value>Repiração</value>
</data>
<data name="AuraColorCycle" xml:space="preserve">
<value>Ciclo de cores</value>
</data>
<data name="AuraFast" xml:space="preserve">
<value>Rápido</value>
</data>
<data name="AuraNormal" xml:space="preserve">
<value>Normal</value>
</data>
<data name="AuraRainbow" xml:space="preserve">
<value>Arco-íris</value>
</data>
<data name="AuraSlow" xml:space="preserve">
<value>Lento</value>
</data>
<data name="AuraStatic" xml:space="preserve">
<value>Estático</value>
</data>
<data name="AuraStrobe" xml:space="preserve">
<value>Estroboscópio</value>
</data>
<data name="AutoMode" xml:space="preserve">
<value>Automático</value>
</data>
<data name="AutoRefreshTooltip" xml:space="preserve">
<value>Estabelece 60Hz para economizar energia</value>
</data>
<data name="Awake" xml:space="preserve">
<value>Acordado</value>
</data>
<data name="BacklightTimeout" xml:space="preserve">
<value>Números de segundos para desligar a luz de fundo</value>
</data>
<data name="Balanced" xml:space="preserve">
<value>Equilibrado</value>
</data>
<data name="BatteryChargeLimit" xml:space="preserve">
<value>Limite de carga da bateria</value>
</data>
<data name="Boot" xml:space="preserve">
<value>Durante o lançamento</value>
</data>
<data name="Brightness" xml:space="preserve">
<value>Luminosidade</value>
</data>
<data name="Color" xml:space="preserve">
<value>Cor</value>
</data>
<data name="CPUBoost" xml:space="preserve">
<value>CPU Boost</value>
</data>
<data name="Custom" xml:space="preserve">
<value>Personalizado</value>
</data>
<data name="Default" xml:space="preserve">
<value>Padrão</value>
</data>
<data name="DisableOverdrive" xml:space="preserve">
<value>Desativar o overdrive da tela</value>
</data>
<data name="Discharging" xml:space="preserve">
<value>Descarregando</value>
</data>
<data name="DownloadUpdate" xml:space="preserve">
<value>Baixar a atualização</value>
</data>
<data name="EcoGPUTooltip" xml:space="preserve">
<value>Desativar o dGPU para economisar a energía</value>
</data>
<data name="EcoMode" xml:space="preserve">
<value>Econômico</value>
</data>
<data name="Extra" xml:space="preserve">
<value>Adicional</value>
</data>
<data name="ExtraSettings" xml:space="preserve">
<value>Configurações adicionais</value>
</data>
<data name="FactoryDefaults" xml:space="preserve">
<value>Padrão de fábrica</value>
</data>
<data name="FanCurves" xml:space="preserve">
<value>Curvas de ventilador</value>
</data>
<data name="FanProfileCPU" xml:space="preserve">
<value>Perfil de ventilador CPU</value>
</data>
<data name="FanProfileGPU" xml:space="preserve">
<value>Perfil de ventilador GPU</value>
</data>
<data name="FanProfileMid" xml:space="preserve">
<value>Perfil de ventilador central</value>
</data>
<data name="FanProfiles" xml:space="preserve">
<value>Perfis de ventilador</value>
</data>
<data name="FansAndPower" xml:space="preserve">
<value>Ventiladores e Energía</value>
</data>
<data name="FanSpeed" xml:space="preserve">
<value>Ventilador</value>
</data>
<data name="FansPower" xml:space="preserve">
<value>Ventiladores + Energía</value>
</data>
<data name="GPUBoost" xml:space="preserve">
<value>Boost dinâmico</value>
</data>
<data name="GPUChanging" xml:space="preserve">
<value>Carregando</value>
</data>
<data name="GPUMode" xml:space="preserve">
<value>Modo de GPU</value>
</data>
<data name="GPUModeEco" xml:space="preserve">
<value>Só iGPU</value>
</data>
<data name="GPUModeStandard" xml:space="preserve">
<value>iGPU + dGPU</value>
</data>
<data name="GPUModeUltimate" xml:space="preserve">
<value>Exclusivamente dGPU</value>
</data>
<data name="GPUSettings" xml:space="preserve">
<value>Parâmetros de GPU</value>
</data>
<data name="GPUTempTarget" xml:space="preserve">
<value>Alvo de temperatura</value>
</data>
<data name="Keyboard" xml:space="preserve">
<value>Teclado</value>
</data>
<data name="KeyboardAuto" xml:space="preserve">
<value>Abaixar a luz de fundo na bateria e voltar quando carregando</value>
</data>
<data name="KeyboardBacklight" xml:space="preserve">
<value>Luz de fundo do teclado</value>
</data>
<data name="LaptopBacklight" xml:space="preserve">
<value>Luz de fundo do computador</value>
</data>
<data name="LaptopKeyboard" xml:space="preserve">
<value>Teclado do computador</value>
</data>
<data name="LaptopScreen" xml:space="preserve">
<value>Tela do computador</value>
</data>
<data name="Lid" xml:space="preserve">
<value>Tampa</value>
</data>
<data name="Logo" xml:space="preserve">
<value>Logo</value>
</data>
<data name="MatrixBanner" xml:space="preserve">
<value>Bandeira Binária</value>
</data>
<data name="MatrixBright" xml:space="preserve">
<value>Brilho</value>
</data>
<data name="MatrixClock" xml:space="preserve">
<value>Relógio</value>
</data>
<data name="MatrixDim" xml:space="preserve">
<value>Escuro</value>
</data>
<data name="MatrixLogo" xml:space="preserve">
<value>Logo ROG</value>
</data>
<data name="MatrixMedium" xml:space="preserve">
<value>Médio</value>
</data>
<data name="MatrixOff" xml:space="preserve">
<value>Desligado</value>
</data>
<data name="MatrixPicture" xml:space="preserve">
<value>Imagem</value>
</data>
<data name="MaxRefreshTooltip" xml:space="preserve">
<value>Taxa de atualização maxíma para abaixar a latência</value>
</data>
<data name="MinRefreshTooltip" xml:space="preserve">
<value>Taxa de atualização à 60Hz para salvar energía</value>
</data>
<data name="Multizone" xml:space="preserve">
<value>Multizona</value>
</data>
<data name="OpenGHelper" xml:space="preserve">
<value>Abrir G-Helper</value>
</data>
<data name="Optimized" xml:space="preserve">
<value>Otimizado</value>
</data>
<data name="OptimizedGPUTooltip" xml:space="preserve">
<value>Passar ao Ecônomico em bateria e voltar quando carregando</value>
</data>
<data name="OptimizedUSBC" xml:space="preserve">
<value>Manter o GPU desligado com um carregador USB-C no Modo Otimizado</value>
</data>
<data name="Other" xml:space="preserve">
<value>Outro</value>
</data>
<data name="Overdrive" xml:space="preserve">
<value>Overdrive</value>
</data>
<data name="PerformanceMode" xml:space="preserve">
<value>Modo Desempenho</value>
</data>
<data name="PictureGif" xml:space="preserve">
<value>Imagem / Gif</value>
</data>
<data name="PlayPause" xml:space="preserve">
<value>Reproduzir / Pausar</value>
</data>
<data name="PowerLimits" xml:space="preserve">
<value>Limitações de Energia (PPT)</value>
</data>
<data name="PPTExperimental" xml:space="preserve">
<value>Limitações de Energia (PPT) é uma funcionalidade experimental. Usar isso com cuidado </value>
</data>
<data name="PrintScreen" xml:space="preserve">
<value>Captura de tela</value>
</data>
<data name="Quit" xml:space="preserve">
<value>Sair</value>
</data>
<data name="GPUCoreClockOffset" xml:space="preserve">
<value>Aumento da frequência básica</value>
</data>
<data name="GPUMemoryClockOffset" xml:space="preserve">
<value>Aumento da frequência da memória</value>
</data>
<data name="KeyBindings" xml:space="preserve">
<value>Combinações de teclas</value>
</data>
<data name="RPM" xml:space="preserve">
<value>RPM</value>
</data>
<data name="RestartGPU" xml:space="preserve">
<value>Algum processo está usando o dGPU e impedindo o modo Econômico. Reinicialize o dGPU no gerenciador de dispositivos. Por favor, proceda por sua conta e risco. </value>
</data>
<data name="RunOnStartup" xml:space="preserve">
<value>Executar ao iniciar</value>
</data>
<data name="Shutdown" xml:space="preserve">
<value>Desligar</value>
</data>
<data name="Silent" xml:space="preserve">
<value>Silencioso</value>
</data>
<data name="Sleep" xml:space="preserve">
<value>Hibernação</value>
</data>
<data name="StandardGPUTooltip" xml:space="preserve">
<value>Liga o dGPU para uso padrão</value>
</data>
<data name="StandardMode" xml:space="preserve">
<value>Padrão</value>
</data>
<data name="StartupError" xml:space="preserve">
<value>Erro ao iniciar</value>
</data>
<data name="ToggleAura" xml:space="preserve">
<value>Alternar Aura</value>
</data>
<data name="ToggleMiniled" xml:space="preserve">
<value>Alternar Miniled (se suportado) </value>
</data>
<data name="ToggleScreen" xml:space="preserve">
<value>Alternar Tela</value>
</data>
<data name="Turbo" xml:space="preserve">
<value>Turbo</value>
</data>
<data name="TurnedOff" xml:space="preserve">
<value>Desligado</value>
</data>
<data name="TurnOffOnBattery" xml:space="preserve">
<value>Desligar em bateria</value>
</data>
<data name="UltimateGPUTooltip" xml:space="preserve">
<value>Direciona a tela do computador ao dGPU</value>
</data>
<data name="UltimateMode" xml:space="preserve">
<value>Ultimate</value>
</data>
<data name="VersionLabel" xml:space="preserve">
<value>Versão</value>
</data>
<data name="VolumeMute" xml:space="preserve">
<value>Mudo</value>
</data>
<data name="WindowTop" xml:space="preserve">
<value>Manter o app em primeiro plano</value>
</data>
</root>

View File

@@ -153,6 +153,9 @@
<data name="ApplyPowerLimits" xml:space="preserve">
<value>Apply Power Limits</value>
</data>
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
<value>Auto adjust Windows Power Mode</value>
</data>
<data name="AuraBreathe" xml:space="preserve">
<value>Breathe</value>
</data>
@@ -186,6 +189,9 @@
<data name="Awake" xml:space="preserve">
<value>Awake</value>
</data>
<data name="BacklightTimeout" xml:space="preserve">
<value>Seconds to turn off backlight on battery</value>
</data>
<data name="Balanced" xml:space="preserve">
<value>Balanced</value>
</data>
@@ -252,12 +258,24 @@
<data name="FansAndPower" xml:space="preserve">
<value>Fans and Power</value>
</data>
<data name="FanSpeed" xml:space="preserve">
<value> Fan: </value>
</data>
<data name="FansPower" xml:space="preserve">
<value>Fans + Power</value>
</data>
<data name="GPUBoost" xml:space="preserve">
<value>Dynamic Boost</value>
</data>
<data name="GPUChanging" xml:space="preserve">
<value>Changing</value>
</data>
<data name="GPUCoreClockOffset" xml:space="preserve">
<value>Core Clock Offset</value>
</data>
<data name="GPUMemoryClockOffset" xml:space="preserve">
<value>Memory Clock Offset</value>
</data>
<data name="GPUMode" xml:space="preserve">
<value>GPU Mode</value>
</data>
@@ -273,6 +291,9 @@
<data name="GPUSettings" xml:space="preserve">
<value>GPU Settings</value>
</data>
<data name="GPUTempTarget" xml:space="preserve">
<value>Temperature Target</value>
</data>
<data name="KeyBindings" xml:space="preserve">
<value>Key Bindings</value>
</data>
@@ -300,6 +321,9 @@
<data name="Logo" xml:space="preserve">
<value>Logo</value>
</data>
<data name="MatrixAudio" xml:space="preserve">
<value>Audio Visualizer</value>
</data>
<data name="MatrixBanner" xml:space="preserve">
<value>Binary Banner</value>
</data>
@@ -333,6 +357,9 @@
<data name="Multizone" xml:space="preserve">
<value>Multizone</value>
</data>
<data name="MuteMic" xml:space="preserve">
<value>Mute Mic</value>
</data>
<data name="OpenGHelper" xml:space="preserve">
<value>Open G-Helper window</value>
</data>

View File

@@ -153,6 +153,9 @@
<data name="ApplyPowerLimits" xml:space="preserve">
<value>Güç Sınırlarını Uygula</value>
</data>
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
<value>Auto adjust Windows Power Mode</value>
</data>
<data name="AuraBreathe" xml:space="preserve">
<value>Nefes</value>
</data>

View File

@@ -153,6 +153,9 @@
<data name="ApplyPowerLimits" xml:space="preserve">
<value>Застосувати потужність</value>
</data>
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
<value>Автоматично застосовувати Windows Power Mode</value>
</data>
<data name="AuraBreathe" xml:space="preserve">
<value>Дихання</value>
</data>

View File

@@ -153,6 +153,9 @@
<data name="ApplyPowerLimits" xml:space="preserve">
<value>应用功率限制</value>
</data>
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
<value>自动调整Windows电源模式</value>
</data>
<data name="AuraBreathe" xml:space="preserve">
<value>呼吸</value>
</data>
@@ -408,4 +411,4 @@
<data name="WindowTop" xml:space="preserve">
<value>窗口置顶</value>
</data>
</root>
</root>

View File

@@ -153,6 +153,9 @@
<data name="ApplyPowerLimits" xml:space="preserve">
<value>套用功率限制</value>
</data>
<data name="ApplyWindowsPowerPlan" xml:space="preserve">
<value>自動調整Windows電源模式</value>
</data>
<data name="AuraBreathe" xml:space="preserve">
<value>呼吸</value>
</data>
@@ -186,6 +189,9 @@
<data name="Awake" xml:space="preserve">
<value>喚醒時</value>
</data>
<data name="BacklightTimeout" xml:space="preserve">
<value>電池模式下自動關閉背光的秒數</value>
</data>
<data name="Balanced" xml:space="preserve">
<value>平衡模式</value>
</data>
@@ -252,12 +258,24 @@
<data name="FansAndPower" xml:space="preserve">
<value>風扇和電源</value>
</data>
<data name="FanSpeed" xml:space="preserve">
<value> 風扇: </value>
</data>
<data name="FansPower" xml:space="preserve">
<value>自定義設置</value>
</data>
<data name="GPUBoost" xml:space="preserve">
<value>Dynamic Boost</value>
</data>
<data name="GPUChanging" xml:space="preserve">
<value>切換中...</value>
</data>
<data name="GPUCoreClockOffset" xml:space="preserve">
<value>核心時脈偏移量(Offset)</value>
</data>
<data name="GPUMemoryClockOffset" xml:space="preserve">
<value>顯示卡記憶體偏移量(Offset)</value>
</data>
<data name="GPUMode" xml:space="preserve">
<value>GPU 模式</value>
</data>
@@ -270,6 +288,12 @@
<data name="GPUModeUltimate" xml:space="preserve">
<value>獨立顯卡</value>
</data>
<data name="GPUSettings" xml:space="preserve">
<value>顯卡設定</value>
</data>
<data name="GPUTempTarget" xml:space="preserve">
<value>GPU溫度上限</value>
</data>
<data name="KeyBindings" xml:space="preserve">
<value>按鍵綁定</value>
</data>
@@ -288,6 +312,18 @@
<data name="LaptopScreen" xml:space="preserve">
<value>螢幕顯示</value>
</data>
<data name="Lid" xml:space="preserve">
<value>螢幕背蓋</value>
</data>
<data name="Lightbar" xml:space="preserve">
<value>燈條</value>
</data>
<data name="Logo" xml:space="preserve">
<value>Logo</value>
</data>
<data name="MatrixAudio" xml:space="preserve">
<value>Audio Visualizer</value>
</data>
<data name="MatrixBanner" xml:space="preserve">
<value>横幅</value>
</data>
@@ -330,6 +366,9 @@
<data name="OptimizedGPUTooltip" xml:space="preserve">
<value>使用電池切換到節能模式,插入電源時切換到標準模式</value>
</data>
<data name="OptimizedUSBC" xml:space="preserve">
<value>自動模式下使用USB-C充電時持續關閉獨顯</value>
</data>
<data name="Other" xml:space="preserve">
<value>其他</value>
</data>
@@ -357,6 +396,9 @@
<data name="Quit" xml:space="preserve">
<value>退出</value>
</data>
<data name="RestartGPU" xml:space="preserve">
<value>有其他程式正在使用獨顯導致無法切換至節能模式. 是否在裝置管理員中重啟獨顯? * 請自行評估風險</value>
</data>
<data name="RPM" xml:space="preserve">
<value>每分鐘轉數</value>
</data>
@@ -384,6 +426,12 @@
<data name="ToggleAura" xml:space="preserve">
<value>切換Aura</value>
</data>
<data name="ToggleMiniled" xml:space="preserve">
<value>切換Miniled(若有支援)</value>
</data>
<data name="ToggleScreen" xml:space="preserve">
<value>切換螢幕</value>
</data>
<data name="Turbo" xml:space="preserve">
<value>極速模式</value>
</data>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 784 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 979 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

46
app/ScreenBrightness.cs Normal file
View File

@@ -0,0 +1,46 @@
namespace GHelper
{
using System;
using System.Diagnostics;
using System.Management;
public static class ScreenBrightness
{
public static int Get()
{
using var mclass = new ManagementClass("WmiMonitorBrightness")
{
Scope = new ManagementScope(@"\\.\root\wmi")
};
using var instances = mclass.GetInstances();
foreach (ManagementObject instance in instances)
{
return (byte)instance.GetPropertyValue("CurrentBrightness");
}
return 0;
}
public static void Set(int brightness)
{
using var mclass = new ManagementClass("WmiMonitorBrightnessMethods")
{
Scope = new ManagementScope(@"\\.\root\wmi")
};
using var instances = mclass.GetInstances();
var args = new object[] { 1, brightness };
foreach (ManagementObject instance in instances)
{
instance.InvokeMethod("WmiSetBrightness", args);
}
}
public static void Adjust(int delta)
{
int brightness = Get();
Debug.WriteLine(brightness);
brightness = Math.Min(100, Math.Max(0, brightness + delta));
Set(brightness);
}
}
}

View File

@@ -185,7 +185,7 @@ namespace GHelper
comboMatrixRunning.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
comboMatrixRunning.FormattingEnabled = true;
comboMatrixRunning.ItemHeight = 32;
comboMatrixRunning.Items.AddRange(new object[] { Properties.Strings.MatrixBanner, Properties.Strings.MatrixLogo, Properties.Strings.MatrixPicture, Properties.Strings.MatrixClock });
comboMatrixRunning.Items.AddRange(new object[] { Properties.Strings.MatrixBanner, Properties.Strings.MatrixLogo, Properties.Strings.MatrixPicture, Properties.Strings.MatrixClock, Properties.Strings.MatrixAudio });
comboMatrixRunning.Location = new Point(261, 10);
comboMatrixRunning.Margin = new Padding(4, 10, 4, 8);
comboMatrixRunning.Name = "comboMatrixRunning";
@@ -267,24 +267,25 @@ namespace GHelper
labelModel.Anchor = AnchorStyles.Top | AnchorStyles.Right;
labelModel.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
labelModel.ForeColor = SystemColors.ControlDark;
labelModel.Location = new Point(291, 119);
labelModel.Location = new Point(380, 119);
labelModel.Margin = new Padding(8, 0, 8, 0);
labelModel.Name = "labelModel";
labelModel.Size = new Size(492, 32);
labelModel.Size = new Size(400, 32);
labelModel.TabIndex = 38;
labelModel.TextAlign = ContentAlignment.TopRight;
//
// labelVersion
//
labelVersion.AutoSize = true;
labelVersion.AutoSize = false;
labelVersion.Font = new Font("Segoe UI", 9F, FontStyle.Underline, GraphicsUnit.Point);
labelVersion.ForeColor = SystemColors.ControlDark;
labelVersion.Location = new Point(25, 119);
labelVersion.Margin = new Padding(8, 0, 8, 0);
labelVersion.Name = "labelVersion";
labelVersion.Size = new Size(44, 32);
labelVersion.Size = new Size(300, 32);
labelVersion.TabIndex = 37;
labelVersion.Text = "v.0";
labelVersion.Cursor = Cursors.Hand;
//
// labelBattery
//

View File

@@ -1,11 +1,9 @@
using CustomControls;
using GHelper.AnimeMatrix;
using GHelper.Gpu;
using Starlight.AnimeMatrix;
using System;
using System.Diagnostics;
using System.Drawing.Imaging;
using System.Net;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text.Json;
using System.Timers;
using System.Windows.Forms;
@@ -20,19 +18,19 @@ namespace GHelper
private ContextMenuStrip contextMenuStrip = new CustomContextMenu();
private ToolStripMenuItem menuSilent, menuBalanced, menuTurbo, menuEco, menuStandard, menuUltimate, menuOptimized;
public ToastForm toast = new ToastForm();
public static System.Timers.Timer aTimer = default!;
public static Point trayPoint;
static System.Timers.Timer matrixTimer = default!;
public string versionUrl = "http://github.com/seerge/g-helper/releases";
public string perfName = "Balanced";
public AniMatrix matrix;
public Fans fans;
public Extra keyb;
static AnimeMatrixDevice mat;
static long lastRefresh;
private bool customFans = false;
@@ -41,7 +39,6 @@ namespace GHelper
public SettingsForm()
{
InitializeComponent();
InitTheme(true);
@@ -142,7 +139,7 @@ namespace GHelper
int trim = model.LastIndexOf("_");
if (trim > 0) model = model.Substring(0, trim);
labelModel.Text = model+(Program.IsUserAdministrator()?".":"");
labelModel.Text = model + (Program.IsUserAdministrator() ? "." : "");
TopMost = Program.config.getConfig("topmost") == 1;
@@ -156,12 +153,17 @@ namespace GHelper
}
public void RunToast(string text, ToastIcon? icon = null)
{
toast.RunToast(text, icon);
}
public void SetContextMenu()
{
contextMenuStrip.Items.Clear();
Padding padding = new Padding(5, 5, 5, 5);
Padding padding = new Padding(15, 5, 5, 5);
/*
TableLayoutPanel[] tables = { tablePerf, tableGPU };
@@ -248,7 +250,7 @@ namespace GHelper
quit.Margin = padding;
contextMenuStrip.Items.Add(quit);
contextMenuStrip.ShowCheckMargin = true;
//contextMenuStrip.ShowCheckMargin = true;
contextMenuStrip.RenderMode = ToolStripRenderMode.System;
if (CheckSystemDarkModeStatus())
@@ -264,14 +266,18 @@ namespace GHelper
private void ButtonXGM_Click(object? sender, EventArgs e)
{
if (Program.wmi.DeviceGet(ASUSWmi.GPUXG) == 1)
if (Program.acpi.DeviceGet(AsusACPI.GPUXG) == 1)
{
Program.wmi.DeviceSet(ASUSWmi.GPUXG, 0, "GPU XGM");
Program.acpi.DeviceSet(AsusACPI.GPUXG, 0, "GPU XGM");
}
else
{
Program.wmi.DeviceSet(ASUSWmi.GPUXG, 1, "GPU XGM");
Program.acpi.DeviceSet(AsusACPI.GPUXG, 1, "GPU XGM");
if (Program.config.getConfigPerf("auto_apply") == 1)
AsusUSB.SetXGMFan(Program.config.getFanConfig(AsusFan.XGM));
}
InitXGM();
}
@@ -297,10 +303,20 @@ namespace GHelper
var gitVersion = new Version(tag);
var appVersion = new Version(Assembly.GetExecutingAssembly().GetName().Version.ToString());
//appVersion = new Version("0.50.0.0");
if (gitVersion.CompareTo(appVersion) > 0)
{
SetVersionLabel(Properties.Strings.DownloadUpdate + ": " + tag, url);
if (Program.config.getConfigString("skip_version") != tag)
{
DialogResult dialogResult = MessageBox.Show(Properties.Strings.DownloadUpdate + ": G-Helper " + tag + "?", "Update", MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes)
AutoUpdate(url);
else
Program.config.setConfig("skip_version", tag);
}
}
else
{
@@ -317,6 +333,57 @@ namespace GHelper
}
void SetVersionLabel(string label, string url = null)
{
BeginInvoke(delegate
{
labelVersion.Text = label;
if (url is not null)
{
this.versionUrl = url;
labelVersion.ForeColor = Color.Red;
}
});
}
public async void AutoUpdate(string requestUri)
{
Uri uri = new Uri(requestUri);
string zipName = Path.GetFileName(uri.LocalPath);
string exeLocation = Application.ExecutablePath;
string exeDir = Path.GetDirectoryName(exeLocation);
string zipLocation = exeDir + "\\" + zipName;
using (WebClient client = new WebClient())
{
client.DownloadFile(uri, zipLocation);
}
var cmd = new Process();
cmd.StartInfo.UseShellExecute = false;
cmd.StartInfo.CreateNoWindow = true;
cmd.StartInfo.FileName = "powershell";
cmd.StartInfo.Arguments = $"Start-Sleep -Seconds 1; Expand-Archive {zipLocation} -DestinationPath {exeDir} -Force; Remove-Item {zipLocation} -Force; {exeLocation}";
cmd.Start();
Debug.WriteLine(requestUri);
Debug.WriteLine(zipLocation);
Application.Exit();
return;
}
private void LabelVersion_Click(object? sender, EventArgs e)
{
Process.Start(new ProcessStartInfo(versionUrl) { UseShellExecute = true });
}
private static void TrayIcon_MouseMove(object? sender, MouseEventArgs e)
{
Program.settingsForm.RefreshSensors();
@@ -422,22 +489,8 @@ namespace GHelper
}
void SetVersionLabel(string label, string url = null)
{
labelVersion.Text = label;
if (url is not null)
{
this.versionUrl = url;
labelVersion.ForeColor = Color.Red;
}
}
private void LabelVersion_Click(object? sender, EventArgs e)
{
Process.Start(new ProcessStartInfo(versionUrl) { UseShellExecute = true });
}
private void CheckStartup_CheckedChanged(object? sender, EventArgs e)
{
@@ -459,84 +512,9 @@ namespace GHelper
if (sender is null) return;
CheckBox check = (CheckBox)sender;
Program.config.setConfig("matrix_auto", check.Checked ? 1 : 0);
matrix?.SetMatrix();
}
private static void StartMatrixTimer(int interval = 100)
{
matrixTimer.Interval = interval;
matrixTimer.Enabled = true;
}
private static void StopMatrixTimer()
{
matrixTimer.Enabled = false;
}
private static void MatrixTimer_Elapsed(object? sender, ElapsedEventArgs e)
{
if (mat is null) return;
switch (Program.config.getConfig("matrix_running"))
{
case 2:
mat.PresentNextFrame();
break;
case 3:
mat.PresentClock();
break;
}
}
void SetMatrixPicture(string fileName)
{
if (mat is null) 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);
}
}
private void ButtonMatrix_Click(object? sender, EventArgs e)
@@ -563,7 +541,7 @@ namespace GHelper
Program.config.setConfig("matrix_picture", fileName);
Program.config.setConfig("matrix_running", 2);
SetMatrixPicture(fileName);
matrix?.SetMatrixPicture(fileName);
BeginInvoke(delegate
{
comboMatrixRunning.SelectedIndex = 2;
@@ -576,72 +554,16 @@ namespace GHelper
private void ComboMatrixRunning_SelectedValueChanged(object? sender, EventArgs e)
{
Program.config.setConfig("matrix_running", comboMatrixRunning.SelectedIndex);
SetMatrix();
matrix?.SetMatrix();
}
private void ComboMatrix_SelectedValueChanged(object? sender, EventArgs e)
{
Program.config.setConfig("matrix_brightness", comboMatrix.SelectedIndex);
SetMatrix();
matrix?.SetMatrix();
}
public void SetMatrix()
{
if (mat is null) return;
int brightness = Program.config.getConfig("matrix_brightness");
int running = Program.config.getConfig("matrix_running");
bool auto = Program.config.getConfig("matrix_auto") == 1;
if (brightness < 0) brightness = 0;
if (running < 0) running = 0;
BuiltInAnimation animation = new BuiltInAnimation(
(BuiltInAnimation.Running)running,
BuiltInAnimation.Sleeping.Starfield,
BuiltInAnimation.Shutdown.SeeYa,
BuiltInAnimation.Startup.StaticEmergence
);
StopMatrixTimer();
mat.SetProvider();
if (brightness == 0 || (auto && SystemInformation.PowerStatus.PowerLineStatus != PowerLineStatus.Online))
{
mat.SetDisplayState(false);
Logger.WriteLine("Matrix Off");
}
else
{
mat.SetDisplayState(true);
mat.SetBrightness((BrightnessMode)brightness);
switch (running)
{
case 2:
SetMatrixPicture(Program.config.getConfigString("matrix_picture"));
break;
case 3:
mat.SetBuiltInAnimation(false);
StartMatrixTimer(1000);
Logger.WriteLine("Matrix Clock");
break;
default:
mat.SetBuiltInAnimation(true, animation);
Logger.WriteLine("Matrix builtin " + animation.AsByte);
break;
}
//mat.SetBrightness((BrightnessMode)brightness);
}
}
private void LabelCPUFan_Click(object? sender, EventArgs e)
{
@@ -720,33 +642,29 @@ namespace GHelper
public void InitAura()
{
Aura.Mode = Program.config.getConfig("aura_mode");
Aura.Speed = Program.config.getConfig("aura_speed");
Aura.SetColor(Program.config.getConfig("aura_color"));
Aura.SetColor2(Program.config.getConfig("aura_color2"));
AsusUSB.Mode = Program.config.getConfig("aura_mode");
AsusUSB.Speed = Program.config.getConfig("aura_speed");
AsusUSB.SetColor(Program.config.getConfig("aura_color"));
AsusUSB.SetColor2(Program.config.getConfig("aura_color2"));
comboKeyboard.DropDownStyle = ComboBoxStyle.DropDownList;
comboKeyboard.DataSource = new BindingSource(Aura.GetModes(), null);
comboKeyboard.DataSource = new BindingSource(AsusUSB.GetModes(), null);
comboKeyboard.DisplayMember = "Value";
comboKeyboard.ValueMember = "Key";
comboKeyboard.SelectedValue = Aura.Mode;
comboKeyboard.SelectedValue = AsusUSB.Mode;
comboKeyboard.SelectedValueChanged += ComboKeyboard_SelectedValueChanged;
pictureColor.BackColor = Aura.Color1;
pictureColor2.BackColor = Aura.Color2;
pictureColor2.Visible = Aura.HasSecondColor();
pictureColor.BackColor = AsusUSB.Color1;
pictureColor2.BackColor = AsusUSB.Color2;
pictureColor2.Visible = AsusUSB.HasSecondColor();
}
public void InitMatrix()
{
try
{
mat = new AnimeMatrixDevice();
matrixTimer = new System.Timers.Timer(100);
matrixTimer.Elapsed += MatrixTimer_Elapsed;
}
catch
matrix = new AniMatrix();
if (!AniMatrix.IsValid)
{
panelMatrix.Visible = false;
return;
@@ -766,16 +684,16 @@ namespace GHelper
public void SetAura()
{
Aura.Mode = Program.config.getConfig("aura_mode");
Aura.Speed = Program.config.getConfig("aura_speed");
Aura.SetColor(Program.config.getConfig("aura_color"));
Aura.SetColor2(Program.config.getConfig("aura_color2"));
AsusUSB.Mode = Program.config.getConfig("aura_mode");
AsusUSB.Speed = Program.config.getConfig("aura_speed");
AsusUSB.SetColor(Program.config.getConfig("aura_color"));
AsusUSB.SetColor2(Program.config.getConfig("aura_color2"));
pictureColor.BackColor = Aura.Color1;
pictureColor2.BackColor = Aura.Color2;
pictureColor2.Visible = Aura.HasSecondColor();
pictureColor.BackColor = AsusUSB.Color1;
pictureColor2.BackColor = AsusUSB.Color2;
pictureColor2.Visible = AsusUSB.HasSecondColor();
Aura.ApplyAura();
AsusUSB.ApplyAura();
}
@@ -840,13 +758,13 @@ namespace GHelper
if (overdrive >= 0)
{
if (Program.config.getConfig("no_overdrive") == 1) overdrive = 0;
Program.wmi.DeviceSet(ASUSWmi.ScreenOverdrive, overdrive, "ScreenOverdrive");
Program.acpi.DeviceSet(AsusACPI.ScreenOverdrive, overdrive, "ScreenOverdrive");
}
if (miniled >= 0)
{
Program.wmi.DeviceSet(ASUSWmi.ScreenMiniled, miniled, "Miniled");
Program.acpi.DeviceSet(AsusACPI.ScreenMiniled, miniled, "Miniled");
Debug.WriteLine("Miniled " + miniled);
}
@@ -862,8 +780,8 @@ namespace GHelper
bool screenAuto = (Program.config.getConfig("screen_auto") == 1);
bool overdriveSetting = (Program.config.getConfig("no_overdrive") != 1);
int overdrive = Program.wmi.DeviceGet(ASUSWmi.ScreenOverdrive);
int miniled = Program.wmi.DeviceGet(ASUSWmi.ScreenMiniled);
int overdrive = Program.acpi.DeviceGet(AsusACPI.ScreenOverdrive);
int miniled = Program.acpi.DeviceGet(AsusACPI.ScreenMiniled);
bool screenEnabled = (frequency >= 0);
@@ -935,17 +853,17 @@ namespace GHelper
private void ButtonUltimate_Click(object? sender, EventArgs e)
{
SetGPUMode(ASUSWmi.GPUModeUltimate);
SetGPUMode(AsusACPI.GPUModeUltimate);
}
private void ButtonStandard_Click(object? sender, EventArgs e)
{
SetGPUMode(ASUSWmi.GPUModeStandard);
SetGPUMode(AsusACPI.GPUModeStandard);
}
private void ButtonEco_Click(object? sender, EventArgs e)
{
SetGPUMode(ASUSWmi.GPUModeEco);
SetGPUMode(AsusACPI.GPUModeEco);
}
public async void RefreshSensors(bool force = false)
@@ -1022,22 +940,22 @@ namespace GHelper
int limit_total = Program.config.getConfigPerf("limit_total");
int limit_cpu = Program.config.getConfigPerf("limit_cpu");
if (limit_total > ASUSWmi.MaxTotal) return;
if (limit_total < ASUSWmi.MinTotal) return;
if (limit_total > AsusACPI.MaxTotal) return;
if (limit_total < AsusACPI.MinTotal) return;
if (limit_cpu > ASUSWmi.MaxCPU) return;
if (limit_cpu < ASUSWmi.MinCPU) return;
if (limit_cpu > AsusACPI.MaxCPU) return;
if (limit_cpu < AsusACPI.MinCPU) return;
if (Program.wmi.DeviceGet(ASUSWmi.PPT_TotalA0) >= 0)
if (Program.acpi.DeviceGet(AsusACPI.PPT_TotalA0) >= 0)
{
Program.wmi.DeviceSet(ASUSWmi.PPT_TotalA0, limit_total, "PowerLimit A0");
Program.wmi.DeviceSet(ASUSWmi.PPT_APUA3, limit_total, "PowerLimit A3");
Program.acpi.DeviceSet(AsusACPI.PPT_TotalA0, limit_total, "PowerLimit A0");
Program.acpi.DeviceSet(AsusACPI.PPT_APUA3, limit_total, "PowerLimit A3");
customPower = limit_total;
}
if (Program.wmi.DeviceGet(ASUSWmi.PPT_CPUB0) >= 0)
if (Program.acpi.DeviceGet(AsusACPI.PPT_CPUB0) >= 0)
{
Program.wmi.DeviceSet(ASUSWmi.PPT_CPUB0, limit_cpu, "PowerLimit B0");
Program.acpi.DeviceSet(AsusACPI.PPT_CPUB0, limit_cpu, "PowerLimit B0");
customPower = limit_cpu;
}
@@ -1056,7 +974,7 @@ namespace GHelper
//if ((gpu_core > -5 && gpu_core < 5) && (gpu_memory > -5 && gpu_memory < 5)) launchAsAdmin = false;
if (Program.wmi.DeviceGet(ASUSWmi.GPUEco) == 1) return;
if (Program.acpi.DeviceGet(AsusACPI.GPUEco) == 1) return;
if (HardwareControl.GpuControl is null) return;
if (!HardwareControl.GpuControl!.IsNvidia) return;
@@ -1086,17 +1004,17 @@ namespace GHelper
int gpu_temp = Program.config.getConfigPerf("gpu_temp");
if (gpu_boost < ASUSWmi.MinGPUBoost || gpu_boost > ASUSWmi.MaxGPUBoost ) return;
if (gpu_temp < ASUSWmi.MinGPUTemp || gpu_temp > ASUSWmi.MaxGPUTemp) return;
if (gpu_boost < AsusACPI.MinGPUBoost || gpu_boost > AsusACPI.MaxGPUBoost) return;
if (gpu_temp < AsusACPI.MinGPUTemp || gpu_temp > AsusACPI.MaxGPUTemp) return;
if (Program.wmi.DeviceGet(ASUSWmi.PPT_GPUC0) >= 0)
if (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC0) >= 0)
{
Program.wmi.DeviceSet(ASUSWmi.PPT_GPUC0, gpu_boost, "PowerLimit C0");
Program.acpi.DeviceSet(AsusACPI.PPT_GPUC0, gpu_boost, "PowerLimit C0");
}
if (Program.wmi.DeviceGet(ASUSWmi.PPT_GPUC2) >= 0)
if (Program.acpi.DeviceGet(AsusACPI.PPT_GPUC2) >= 0)
{
Program.wmi.DeviceSet(ASUSWmi.PPT_GPUC2, gpu_temp, "PowerLimit C2");
Program.acpi.DeviceSet(AsusACPI.PPT_GPUC2, gpu_temp, "PowerLimit C2");
}
}
@@ -1114,18 +1032,21 @@ namespace GHelper
if (Program.config.getConfigPerf("auto_apply") == 1 || force)
{
int cpuResult = Program.wmi.SetFanCurve(0, Program.config.getFanConfig(0));
int gpuResult = Program.wmi.SetFanCurve(1, Program.config.getFanConfig(1));
int cpuResult = Program.acpi.SetFanCurve(AsusFan.CPU, Program.config.getFanConfig(AsusFan.CPU));
int gpuResult = Program.acpi.SetFanCurve(AsusFan.GPU, Program.config.getFanConfig(AsusFan.GPU));
if (Program.config.getConfig("mid_fan") == 1)
Program.wmi.SetFanCurve(2, Program.config.getFanConfig(2));
if (Program.config.isConfig("mid_fan"))
Program.acpi.SetFanCurve(AsusFan.Mid, Program.config.getFanConfig(AsusFan.Mid));
if (Program.config.isConfig("xgm_fan") && Program.acpi.IsXGConnected())
AsusUSB.SetXGMFan(Program.config.getFanConfig(AsusFan.XGM));
// something went wrong, resetting to default profile
if (cpuResult != 1 || gpuResult != 1)
{
int mode = Program.config.getConfig("performance_mode");
Logger.WriteLine("ASUS BIOS rejected fan curve, resetting mode to " + mode);
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, mode, "PerformanceMode");
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, mode, "PerformanceMode");
LabelFansResult("ASUS BIOS rejected fan curve");
}
else
@@ -1140,8 +1061,8 @@ namespace GHelper
Task.Run(async () =>
{
await Task.Delay(TimeSpan.FromSeconds(1));
Program.wmi.DeviceSet(ASUSWmi.PPT_TotalA0, 80, "PowerLimit Fix A0");
Program.wmi.DeviceSet(ASUSWmi.PPT_APUA3, 80, "PowerLimit Fix A3");
Program.acpi.DeviceSet(AsusACPI.PPT_TotalA0, 80, "PowerLimit Fix A0");
Program.acpi.DeviceSet(AsusACPI.PPT_APUA3, 80, "PowerLimit Fix A3");
});
}
@@ -1199,17 +1120,17 @@ namespace GHelper
switch (PerformanceMode)
{
case ASUSWmi.PerformanceSilent:
case AsusACPI.PerformanceSilent:
buttonSilent.Activated = true;
perfName = Properties.Strings.Silent;
break;
case ASUSWmi.PerformanceTurbo:
case AsusACPI.PerformanceTurbo:
buttonTurbo.Activated = true;
perfName = Properties.Strings.Turbo;
break;
default:
buttonBalanced.Activated = true;
PerformanceMode = ASUSWmi.PerformanceBalanced;
PerformanceMode = AsusACPI.PerformanceBalanced;
perfName = Properties.Strings.Balanced;
break;
}
@@ -1222,13 +1143,14 @@ namespace GHelper
Program.config.setConfig("performance_" + (int)SystemInformation.PowerStatus.PowerLineStatus, PerformanceMode);
Program.config.setConfig("performance_mode", PerformanceMode);
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, PerformanceMode, "PerformanceMode");
Program.acpi.DeviceSet(AsusACPI.PerformanceMode, PerformanceMode, "PerformanceMode");
if (Program.config.isConfig("xgm_fan") && Program.acpi.IsXGConnected()) AsusUSB.ResetXGM();
if (notify && (oldMode != PerformanceMode))
{
try
{
Program.toast.RunToast(perfName);
toast.RunToast(perfName);
}
catch
{
@@ -1241,11 +1163,13 @@ namespace GHelper
AutoFans();
AutoPower(1000);
if (Program.config.getConfigPerfString("scheme") is not null)
NativeMethods.SetPowerScheme(Program.config.getConfigPerfString("scheme"));
else
NativeMethods.SetPowerScheme(PerformanceMode);
if (Program.config.getConfig("auto_apply_power_plan") != 0)
{
if (Program.config.getConfigPerfString("scheme") is not null)
NativeMethods.SetPowerScheme(Program.config.getConfigPerfString("scheme"));
else
NativeMethods.SetPowerScheme(PerformanceMode);
}
if (Program.config.getConfigPerf("auto_boost") != -1)
{
@@ -1285,9 +1209,9 @@ namespace GHelper
if (Program.config.getConfig("keyboard_auto") != 1) return;
if (SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online)
Aura.ApplyBrightness(3);
AsusUSB.ApplyBrightness(3);
else
Aura.ApplyBrightness(0);
AsusUSB.ApplyBrightness(0);
}
@@ -1312,9 +1236,10 @@ namespace GHelper
SetScreen(1000, 1);
else
SetScreen(60, 0);
} else
}
else
{
SetScreen(overdrive : Program.config.getConfig("overdrive"));
SetScreen(overdrive: Program.config.getConfig("overdrive"));
}
@@ -1326,7 +1251,7 @@ namespace GHelper
bool optimizedUSBC = Program.config.getConfig("optimized_usbc") != 1;
return SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online &&
(optimizedUSBC || Program.wmi.DeviceGet(ASUSWmi.ChargerMode) != ASUSWmi.ChargerUSB);
(optimizedUSBC || Program.acpi.DeviceGet(AsusACPI.ChargerMode) != AsusACPI.ChargerUSB);
}
@@ -1340,8 +1265,8 @@ namespace GHelper
if (!GpuAuto && !ForceGPU) return false;
int eco = Program.wmi.DeviceGet(ASUSWmi.GPUEco);
int mux = Program.wmi.DeviceGet(ASUSWmi.GPUMux);
int eco = Program.acpi.DeviceGet(AsusACPI.GPUEco);
int mux = Program.acpi.DeviceGet(AsusACPI.GPUMux);
if (mux == 0) // GPU in Ultimate, ignore
return false;
@@ -1351,13 +1276,13 @@ namespace GHelper
if (ReEnableGPU()) return true;
if (eco == 1)
if ((GpuAuto && IsPlugged()) || (ForceGPU && GpuMode == ASUSWmi.GPUModeStandard))
if ((GpuAuto && IsPlugged()) || (ForceGPU && GpuMode == AsusACPI.GPUModeStandard))
{
SetGPUEco(0);
return true;
}
if (eco == 0)
if ((GpuAuto && !IsPlugged()) || (ForceGPU && GpuMode == ASUSWmi.GPUModeEco))
if ((GpuAuto && !IsPlugged()) || (ForceGPU && GpuMode == AsusACPI.GPUModeEco))
{
if (HardwareControl.IsUsedGPU())
@@ -1406,20 +1331,16 @@ namespace GHelper
public void InitXGM()
{
int connected = Program.wmi.DeviceGet(ASUSWmi.GPUXGConnected);
int enabled = Program.wmi.DeviceGet(ASUSWmi.GPUXG);
buttonXGM.Enabled = buttonXGM.Visible = (connected == 1);
buttonXGM.Activated = (enabled == 1);
buttonXGM.Enabled = buttonXGM.Visible = Program.acpi.IsXGConnected();
buttonXGM.Activated = (Program.acpi.DeviceGet(AsusACPI.GPUXG) == 1);
}
public int InitGPUMode()
{
int eco = Program.wmi.DeviceGet(ASUSWmi.GPUEco);
int mux = Program.wmi.DeviceGet(ASUSWmi.GPUMux);
int eco = Program.acpi.DeviceGet(AsusACPI.GPUEco);
int mux = Program.acpi.DeviceGet(AsusACPI.GPUMux);
Logger.WriteLine("Eco flag : " + eco);
Logger.WriteLine("Mux flag : " + mux);
@@ -1427,13 +1348,13 @@ namespace GHelper
int GpuMode;
if (mux == 0)
GpuMode = ASUSWmi.GPUModeUltimate;
GpuMode = AsusACPI.GPUModeUltimate;
else
{
if (eco == 1)
GpuMode = ASUSWmi.GPUModeEco;
GpuMode = AsusACPI.GPUModeEco;
else
GpuMode = ASUSWmi.GPUModeStandard;
GpuMode = AsusACPI.GPUModeStandard;
UltimateUI(mux == 1);
@@ -1481,7 +1402,7 @@ namespace GHelper
ButtonEnabled(buttonStandard, false);
ButtonEnabled(buttonUltimate, false);
});
var nvControl = (NvidiaGpuControl)HardwareControl.GpuControl;
bool status = nvControl.RestartGPU();
@@ -1517,7 +1438,7 @@ namespace GHelper
}
//if (eco == 1) status = 0; else
status = Program.wmi.SetGPUEco(eco);
status = Program.acpi.SetGPUEco(eco);
if (status == 0 && eco == 1 && hardWay)
{
@@ -1558,34 +1479,34 @@ namespace GHelper
var restart = false;
var changed = false;
if (CurrentGPU == ASUSWmi.GPUModeUltimate)
if (CurrentGPU == AsusACPI.GPUModeUltimate)
{
DialogResult dialogResult = MessageBox.Show(Properties.Strings.AlertUltimateOff, Properties.Strings.AlertUltimateTitle, MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes)
{
Program.wmi.DeviceSet(ASUSWmi.GPUMux, 1, "GPUMux");
Program.acpi.DeviceSet(AsusACPI.GPUMux, 1, "GPUMux");
restart = true;
changed = true;
}
}
else if (GPUMode == ASUSWmi.GPUModeUltimate)
else if (GPUMode == AsusACPI.GPUModeUltimate)
{
DialogResult dialogResult = MessageBox.Show(Properties.Strings.AlertUltimateOn, Properties.Strings.AlertUltimateTitle, MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes)
{
Program.wmi.DeviceSet(ASUSWmi.GPUMux, 0, "GPUMux");
Program.acpi.DeviceSet(AsusACPI.GPUMux, 0, "GPUMux");
restart = true;
changed = true;
}
}
else if (GPUMode == ASUSWmi.GPUModeEco)
else if (GPUMode == AsusACPI.GPUModeEco)
{
VisualiseGPUMode(GPUMode);
SetGPUEco(1, true);
changed = true;
}
else if (GPUMode == ASUSWmi.GPUModeStandard)
else if (GPUMode == AsusACPI.GPUModeStandard)
{
VisualiseGPUMode(GPUMode);
SetGPUEco(0);
@@ -1621,14 +1542,14 @@ namespace GHelper
switch (GPUMode)
{
case ASUSWmi.GPUModeEco:
case AsusACPI.GPUModeEco:
buttonOptimized.BorderColor = colorEco;
buttonEco.Activated = !GPUAuto;
buttonOptimized.Activated = GPUAuto;
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUModeEco;
Program.trayIcon.Icon = Properties.Resources.eco;
break;
case ASUSWmi.GPUModeUltimate:
case AsusACPI.GPUModeUltimate:
buttonUltimate.Activated = true;
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUModeUltimate;
Program.trayIcon.Icon = Properties.Resources.ultimate;
@@ -1652,17 +1573,17 @@ namespace GHelper
private void ButtonSilent_Click(object? sender, EventArgs e)
{
SetPerformanceMode(ASUSWmi.PerformanceSilent);
SetPerformanceMode(AsusACPI.PerformanceSilent);
}
private void ButtonBalanced_Click(object? sender, EventArgs e)
{
SetPerformanceMode(ASUSWmi.PerformanceBalanced);
SetPerformanceMode(AsusACPI.PerformanceBalanced);
}
private void ButtonTurbo_Click(object? sender, EventArgs e)
{
SetPerformanceMode(ASUSWmi.PerformanceTurbo);
SetPerformanceMode(AsusACPI.PerformanceTurbo);
}
private void Settings_Load(object sender, EventArgs e)
@@ -1693,8 +1614,15 @@ namespace GHelper
labelBatteryTitle.Text = Properties.Strings.BatteryChargeLimit + ": " + limit.ToString() + "%";
sliderBattery.Value = limit;
Program.wmi.DeviceSet(ASUSWmi.BatteryLimit, limit, "BatteryLimit");
OptimizationService.SetChargeLimit(limit);
Program.acpi.DeviceSet(AsusACPI.BatteryLimit, limit, "BatteryLimit");
try
{
OptimizationService.SetChargeLimit(limit);
}
catch (Exception ex)
{
Debug.WriteLine(ex);
}
Program.config.setConfig("charge_limit", limit);

View File

@@ -1,4 +1,6 @@
using System.Drawing.Drawing2D;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using OSD;
@@ -41,12 +43,32 @@ namespace GHelper
}
}
class ToastForm : OSDNativeForm
public enum ToastIcon
{
BrightnessUp,
BrightnessDown,
BacklightUp,
BacklightDown,
Touchpad,
Microphone,
MicrophoneMute
}
public class ToastForm : OSDNativeForm
{
protected static string toastText = "Balanced";
protected static ToastIcon? toastIcon = null;
protected static System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
public ToastForm()
{
timer.Tick += timer_Tick;
timer.Enabled = false;
timer.Interval = 2000;
}
protected override void PerformPaint(PaintEventArgs e)
{
Brush brush = new SolidBrush(Color.FromArgb(150,Color.Black));
@@ -56,17 +78,58 @@ namespace GHelper
format.LineAlignment = StringAlignment.Center;
format.Alignment = StringAlignment.Center;
e.Graphics.DrawString(toastText,
new Font("Segoe UI", 16f, FontStyle.Bold),
new SolidBrush(Color.White),
new PointF(this.Bound.Width/2, this.Bound.Height / 2),
format);
Bitmap? icon = null;
switch (toastIcon)
{
case ToastIcon.BrightnessUp:
icon = Properties.Resources.brightness_up;
break;
case ToastIcon.BrightnessDown:
icon = Properties.Resources.brightness_down;
break;
case ToastIcon.BacklightUp:
icon = Properties.Resources.backlight_up;
break;
case ToastIcon.BacklightDown:
icon = Properties.Resources.backlight_down;
break;
case ToastIcon.Microphone:
icon = Properties.Resources.icons8_microphone_96;
break;
case ToastIcon.MicrophoneMute:
icon = Properties.Resources.icons8_mute_unmute_96;
break;
case ToastIcon.Touchpad:
icon = Properties.Resources.icons8_touchpad_96;
break;
}
int shiftX = 0;
if (icon is not null)
{
e.Graphics.DrawImage(icon, 18, 18, 64, 64);
shiftX = 40;
}
e.Graphics.DrawString(toastText,
new Font("Segoe UI", 36f, FontStyle.Bold, GraphicsUnit.Pixel),
new SolidBrush(Color.White),
new PointF(this.Bound.Width / 2 + shiftX, this.Bound.Height / 2),
format);
}
public void RunToast(string text)
public void RunToast(string text, ToastIcon? icon = null)
{
//Hide();
timer.Stop();
toastText = text;
toastIcon = icon;
Screen screen1 = Screen.FromHandle(base.Handle);
Width = 300;
@@ -75,20 +138,15 @@ namespace GHelper
Y = screen1.Bounds.Height - 300 - this.Height;
Show();
timer.Stop();
timer.Tick -= timer_Tick;
timer.Tick += timer_Tick;
timer.Enabled = true;
timer.Interval = 2000;
timer.Start();
}
private void timer_Tick(object? sender, EventArgs e)
{
timer.Stop();
Debug.WriteLine("Toast end");
Hide();
timer.Stop();
}
}
}

View File

@@ -20,7 +20,7 @@ Control tool for ROG Zephyrus G14, G15, G16, M16, Flow X13, Flow X16, TUF, Strix
## [:floppy_disk: Download App](https://github.com/seerge/g-helper/releases/latest/download/GHelper.zip)
If you like this app, please [star :star: it on Github](https://github.com/seerge/g-helper) and spread a word about it!
### [:euro: Donate EUR](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA) | [💵 Donate USD](https://www.paypal.com/donate/?hosted_button_id=SRM6QUX6ACXDY)
### [:euro: Donate EUR](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA) | [💵 Donate USD](https://www.paypal.com/donate/?hosted_button_id=SRM6QUX6ACXDY) | [:coin: Donate via Stripe](https://buy.stripe.com/00gaFJ9Lf79v7WobII)
_If you post about the app - please include a link. Thanks._
@@ -124,8 +124,11 @@ It's a lightweight Armoury Crate alternative for Asus laptops. A small utility t
-----------------------------
## :euro: [Support Project](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA)
#### If you like the app you can make a [Donation via Paypal](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA)
[![QR Code](https://user-images.githubusercontent.com/5920850/233658717-0441494d-fede-4a2c-b4f2-4b16a184a69a.png)](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA)
#### If you like the app you can make a Donation
| [Paypal in EUR](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA) | [Paypal in USD](https://www.paypal.com/donate/?hosted_button_id=SRM6QUX6ACXDY) |
| ------------------------------------------ | ----------------------------------------------- |
| [![QR Code](https://user-images.githubusercontent.com/5920850/233658717-0441494d-fede-4a2c-b4f2-4b16a184a69a.png)](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA) | [![QR Code](https://github-production-user-asset-6210df.s3.amazonaws.com/5920850/239492811-b487e89a-3df6-42ea-bdb8-24c455ab2310.png)](https://www.paypal.com/donate/?hosted_button_id=SRM6QUX6ACXDY) |
----------------
@@ -149,6 +152,8 @@ It's a lightweight Armoury Crate alternative for Asus laptops. A small utility t
- It's not recommended to use an app in combination with Armoury Crate services, because they adjust the same settings. You can [uninstall it using it's own uninstall tool](https://dlcdnets.asus.com/pub/ASUS/mb/14Utilities/Armoury_Crate_Uninstall_Tool.zip?model=armoury%20crate). Just in case, you can always install it back later.
- Also, it's not recommended to have "ASUS Smart Display Control" app running, as it will try to change refresh rates and fight with g-helper for the same function. You can safely uninstall it.
-------------------------------
Designed and developed for Asus Zephyrus G14 2022 (with AMD Radeon iGPU and dGPU). But could and should potentially work for G14 of 2021 and 2020, G15, X FLOW, and other ROG models for relevant and supported features.
@@ -199,9 +204,13 @@ Full list of keycodes https://learn.microsoft.com/en-us/windows/win32/inputdev/v
Some people reported that on G15 model bios can be bugged and either not turn on or not turn off fans, when you set custom fan curve (in Armoury or g-helper, or any other app)
I have added a very optional workaround as it was asked, on launch app will try to disable and re-enable dGPU when external monitor is connected, that seems to wake up fans :)
To enable this custom workaround you need to add an extra line in In config.json (under ``%AppData%\GHelper``)
To enable this custom workaround you need to add an extra line in config.json (under ``%AppData%\GHelper``)
``gpu_reenable : 1,``
### Keybinding to toggle performance modes (on external keyboards)
By default app will toggle performance modes with Ctr+Shift+F5. You can change this binding by adding ``"keybind_profile": 116`` in config.json (under ``%AppData%\GHelper``), where 116 is [numerical code for desired key](https://www.oreilly.com/library/view/javascript-dhtml/9780596514082/apb.html). Put 0 to completely disable this binding.
------------
**Disclaimers**
"ROG", "TUF", and "Armoury Crate" are trademarked by and belong to AsusTek Computer, Inc. I make no claims to these or any assets belonging to AsusTek Computer and use them purely for informational purposes only.