From 899e49c2d9f8b7c53740ecd8fc902eb16cf3c9ed Mon Sep 17 00:00:00 2001 From: Vincent Maas Date: Sun, 22 Sep 2024 15:24:54 +0200 Subject: [PATCH] fix some Nvidia issues, improve color profiles, add GPU info to new UI --- .../Components/Pages/AMD/AmdSummary.razor | 2 +- .../Pages/ColorProfile/ColorProfilePage.razor | 14 +- .../ColorProfile/ColorProfileSummary.razor | 6 +- .../Pages/Game/GamePresetPage.razor | 235 ++-- .../Components/Pages/Game/GameSummary.razor | 2 +- .../Components/Pages/Generic/StepsInput.razor | 28 + .../Components/Pages/LG/LgSummary.razor | 2 +- .../Pages/Nvidia/NvidiaSummary.razor | 37 +- .../Pages/Samsung/SamsungSummary.razor | 2 +- ColorControl/ColorControl.csproj | 4 +- ColorControl/MainForm.cs | 660 +++++------ ColorControl/Services/AMD/AmdPanel.cs | 1 + ColorControl/Services/AMD/AmdService.cs | 6 + .../Services/Common/ColorProfileService.cs | 556 ++++----- .../Services/Common/GraphicsService.cs | 206 ++-- ColorControl/Services/Common/ServiceBase.cs | 7 + ColorControl/Services/Common/UpdateManager.cs | 332 +++--- .../Services/GameLauncher/GameService.cs | 50 + ColorControl/Services/NVIDIA/NvGpuInfo.cs | 89 +- ColorControl/Services/NVIDIA/NvPanel.cs | 5 +- ColorControl/Services/NVIDIA/NvService.cs | 76 +- .../XForms/ColorProfileWindow.xaml.cs | 2 +- NvAPIWrapper/Display/HDRColorData.cs | 10 +- Shared/Common/Utils.cs | 6 + Shared/Contracts/Game/GameApp.cs | 8 + Shared/Contracts/NVIDIA/NvEnums.cs | 59 +- Shared/Contracts/NVIDIA/NvGpuInfoDto.cs | 28 + Shared/Contracts/NVIDIA/NvPreset.cs | 1048 ++++++++--------- Shared/Native/CCD.cs | 117 +- Shared/Services/RpcServerService.cs | 3 +- 30 files changed, 1997 insertions(+), 1604 deletions(-) create mode 100644 Shared/Contracts/Game/GameApp.cs create mode 100644 Shared/Contracts/NVIDIA/NvGpuInfoDto.cs diff --git a/ColorControl.UI/Components/Pages/AMD/AmdSummary.razor b/ColorControl.UI/Components/Pages/AMD/AmdSummary.razor index 9f93bd7..916d998 100644 --- a/ColorControl.UI/Components/Pages/AMD/AmdSummary.razor +++ b/ColorControl.UI/Components/Pages/AMD/AmdSummary.razor @@ -116,7 +116,7 @@ else
-
@@ -305,7 +305,7 @@ } else { - ColorProfile = await _rpcClientService.CallAsync("ColorProfileService", "GetColorProfile", ColorProfileName); + ColorProfile = await _rpcClientService.CallAsync("ColorProfileService", "GetColorProfile", ColorProfileName, DisplayInfo?.IsHdrSupportedAndEnabled ?? false); } if (ColorProfile != null) @@ -390,6 +390,16 @@ IsInstalled = true; } + private async Task CloseOnClick() + { + IsVisible = false; + + if (ColorProfile != null && AfterApply != null) + { + await AfterApply.Invoke(ColorProfile); + } + } + private void ModalOnFocus(FocusEventArgs e) { if (!IsVisible) diff --git a/ColorControl.UI/Components/Pages/ColorProfile/ColorProfileSummary.razor b/ColorControl.UI/Components/Pages/ColorProfile/ColorProfileSummary.razor index 94c01c3..5c8ec8e 100644 --- a/ColorControl.UI/Components/Pages/ColorProfile/ColorProfileSummary.razor +++ b/ColorControl.UI/Components/Pages/ColorProfile/ColorProfileSummary.razor @@ -210,7 +210,7 @@ else return; } - var result = await _rpcClientService.CallAsync("ColorProfileService", "SetDisplayDefaultColorProfile", SelectedDisplay.DeviceName, colorProfile); + var result = await _rpcClientService.CallAsync("ColorProfileService", "SetDisplayDefaultColorProfile", SelectedDisplay.DeviceName, colorProfile, Type.Missing, SelectedDisplay.IsHdrSupportedAndEnabled); if (result) { SelectedDisplay.DefaultColorProfile = colorProfile; @@ -250,7 +250,7 @@ else return; } - await _rpcClientService.CallAsync("ColorProfileService", "RemoveDisplayColorProfile", SelectedDisplay.DeviceName, SelectedColorProfileName); + await _rpcClientService.CallAsync("ColorProfileService", "RemoveDisplayColorProfile", SelectedDisplay.DeviceName, SelectedColorProfileName, SelectedDisplay.IsHdrSupportedAndEnabled); SelectedColorProfileName = null; @@ -265,7 +265,7 @@ else return; } - await _rpcClientService.CallAsync("ColorProfileService", "AddDisplayColorProfile", SelectedDisplay.DeviceName, SelectedColorProfileName, false); + await _rpcClientService.CallAsync("ColorProfileService", "AddDisplayColorProfile", SelectedDisplay.DeviceName, SelectedColorProfileName, false, SelectedDisplay.IsHdrSupportedAndEnabled); SelectedColorProfileName = null; diff --git a/ColorControl.UI/Components/Pages/Game/GamePresetPage.razor b/ColorControl.UI/Components/Pages/Game/GamePresetPage.razor index b795783..0b0f9b2 100644 --- a/ColorControl.UI/Components/Pages/Game/GamePresetPage.razor +++ b/ColorControl.UI/Components/Pages/Game/GamePresetPage.razor @@ -21,113 +21,125 @@