mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
GPU Aura Mode
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using GHelper.Helpers;
|
||||
using HidLibrary;
|
||||
using NAudio.Gui;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
|
||||
@@ -387,9 +388,6 @@ namespace GHelper
|
||||
|
||||
|
||||
public static void ApplyAuraPower()
|
||||
{
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
|
||||
AuraPower flags = new();
|
||||
@@ -445,8 +443,6 @@ namespace GHelper
|
||||
flags.SleepKeyb,
|
||||
flags.ShutdownKeyb);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -533,6 +529,7 @@ namespace GHelper
|
||||
|
||||
else
|
||||
{
|
||||
Debug.WriteLine(color.ToString());
|
||||
auraDevice.Write(AuraMessage(0, color, color, 0));
|
||||
auraDevice.Write(MESSAGE_SET);
|
||||
}
|
||||
@@ -544,7 +541,9 @@ namespace GHelper
|
||||
{
|
||||
if (AppConfig.Get("aura_mode") != GPUMODE) return;
|
||||
|
||||
switch (GPUModeControl.GpuMode)
|
||||
Logger.WriteLine(GPUModeControl.gpuMode.ToString());
|
||||
|
||||
switch (GPUModeControl.gpuMode)
|
||||
{
|
||||
case AsusACPI.GPUModeUltimate:
|
||||
ApplyColor(Color.Red, true);
|
||||
@@ -582,13 +581,7 @@ namespace GHelper
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
|
||||
|
||||
int _speed;
|
||||
|
||||
switch (Speed)
|
||||
{
|
||||
case 1:
|
||||
@@ -621,7 +614,6 @@ namespace GHelper
|
||||
|
||||
if (isTuf)
|
||||
Program.acpi.TUFKeyboardRGB(Mode, Color1, _speed);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace GHelper.Gpu
|
||||
SettingsForm settings;
|
||||
ScreenControl screenControl = new ScreenControl();
|
||||
|
||||
public static int GpuMode;
|
||||
public static int gpuMode;
|
||||
|
||||
public GPUModeControl(SettingsForm settingsForm)
|
||||
{
|
||||
@@ -27,14 +27,14 @@ namespace GHelper.Gpu
|
||||
|
||||
if (mux == 0)
|
||||
{
|
||||
GpuMode = AsusACPI.GPUModeUltimate;
|
||||
gpuMode = AsusACPI.GPUModeUltimate;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (eco == 1)
|
||||
GpuMode = AsusACPI.GPUModeEco;
|
||||
gpuMode = AsusACPI.GPUModeEco;
|
||||
else
|
||||
GpuMode = AsusACPI.GPUModeStandard;
|
||||
gpuMode = AsusACPI.GPUModeStandard;
|
||||
|
||||
// Ultimate mode not supported
|
||||
if (mux != 1) settings.HideUltimateMode();
|
||||
@@ -42,10 +42,13 @@ namespace GHelper.Gpu
|
||||
if (eco < 0 && mux < 0) settings.HideGPUModes();
|
||||
}
|
||||
|
||||
AppConfig.Set("gpu_mode", GpuMode);
|
||||
AppConfig.Set("gpu_mode", gpuMode);
|
||||
|
||||
InitXGM();
|
||||
settings.VisualiseGPUMode(GpuMode);
|
||||
settings.VisualiseGPUMode(gpuMode);
|
||||
|
||||
AsusUSB.ApplyGPUColor();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -551,8 +551,7 @@ namespace GHelper
|
||||
if (colorDlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
AppConfig.Set("aura_color2", colorDlg.Color.ToArgb());
|
||||
AsusUSB.ApplyAura();
|
||||
VisualiseAura();
|
||||
SetAura();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -625,8 +624,7 @@ namespace GHelper
|
||||
if (colorDlg.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
AppConfig.Set("aura_color", colorDlg.Color.ToArgb());
|
||||
AsusUSB.ApplyAura();
|
||||
VisualiseAura();
|
||||
SetAura();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -659,11 +657,23 @@ namespace GHelper
|
||||
|
||||
}
|
||||
|
||||
public void SetAura()
|
||||
{
|
||||
Task.Run(() =>
|
||||
{
|
||||
AsusUSB.ApplyAura();
|
||||
VisualiseAura();
|
||||
});
|
||||
}
|
||||
|
||||
public void VisualiseAura()
|
||||
{
|
||||
Invoke(delegate
|
||||
{
|
||||
pictureColor.BackColor = AsusUSB.Color1;
|
||||
pictureColor2.BackColor = AsusUSB.Color2;
|
||||
pictureColor2.Visible = AsusUSB.HasSecondColor();
|
||||
});
|
||||
}
|
||||
|
||||
public void InitMatrix()
|
||||
@@ -695,8 +705,7 @@ namespace GHelper
|
||||
private void ComboKeyboard_SelectedValueChanged(object? sender, EventArgs e)
|
||||
{
|
||||
AppConfig.Set("aura_mode", (int)comboKeyboard.SelectedValue);
|
||||
AsusUSB.ApplyAura();
|
||||
VisualiseAura();
|
||||
SetAura();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user