mirror of
https://github.com/Maassoft/ColorControl.git
synced 2026-10-23 00:52:19 -05:00
update to .NET 8, fix conditions, add Nvidia RTX settings, add LG actions, improve Game Bar
This commit is contained in:
1 parent
b1120c8d49
commit
f08dcb7661
39 files changed
+2176
-1168
No files matched your search
@@ -1,6 +1,6 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0-windows10.0.20348.0</TargetFramework>
|
||||
<TargetFramework>net8.0-windows10.0.20348.0</TargetFramework>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
@@ -18,8 +18,8 @@
|
||||
<PublisherName>Maassoft</PublisherName>
|
||||
<Company>Maassoft</Company>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>9.8.1.0</ApplicationVersion>
|
||||
<Version>9.8.1.0</Version>
|
||||
<ApplicationVersion>9.8.2.0</ApplicationVersion>
|
||||
<Version>9.8.2.0</Version>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||
<BootstrapperEnabled>false</BootstrapperEnabled>
|
||||
@@ -59,6 +59,9 @@
|
||||
<Compile Update="Forms\ElevatedForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Forms\OptionsPanel.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Forms\InfoPanel.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
@@ -101,17 +104,17 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2088.41" />
|
||||
<PackageReference Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2277.86" />
|
||||
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="NLog" Version="5.1.2" />
|
||||
<PackageReference Include="NStandard" Version="0.24.0" />
|
||||
<PackageReference Include="NLog" Version="5.2.8" />
|
||||
<PackageReference Include="NStandard" Version="0.59.0" />
|
||||
<PackageReference Include="NWin32" Version="1.2.6" />
|
||||
<PackageReference Include="System.Management" Version="7.0.0" />
|
||||
<PackageReference Include="System.Management" Version="8.0.0" />
|
||||
<PackageReference Include="TaskScheduler" Version="2.10.1" />
|
||||
<PackageReference Include="Vanara.PInvoke.IpHlpApi" Version="3.4.13" />
|
||||
<PackageReference Include="RawInput.Sharp" Version="0.1.1" />
|
||||
<PackageReference Include="Vanara.PInvoke.IpHlpApi" Version="3.4.17" />
|
||||
<PackageReference Include="RawInput.Sharp" Version="0.1.3" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="XForms\ColorProfileWindow.xaml">
|
||||
|
||||
+494
@@ -0,0 +1,494 @@
|
||||
using System.DirectoryServices.ActiveDirectory;
|
||||
using System.Drawing;
|
||||
using System;
|
||||
|
||||
namespace ColorControl.Forms
|
||||
{
|
||||
partial class OptionsPanel
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
grpOptionsModules = new System.Windows.Forms.GroupBox();
|
||||
label1 = new System.Windows.Forms.Label();
|
||||
chkModules = new System.Windows.Forms.CheckedListBox();
|
||||
grpMiscellaneousOptions = new System.Windows.Forms.GroupBox();
|
||||
btnOptionsColorProfiles = new System.Windows.Forms.Button();
|
||||
btnSetShortcutScreenSaver = new System.Windows.Forms.Button();
|
||||
label11 = new System.Windows.Forms.Label();
|
||||
edtBlankScreenSaverShortcut = new System.Windows.Forms.TextBox();
|
||||
lblFixChromeFontsDescription = new System.Windows.Forms.Label();
|
||||
chkFixChromeFonts = new System.Windows.Forms.CheckBox();
|
||||
grpGeneralOptions = new System.Windows.Forms.GroupBox();
|
||||
btnOptionsLog = new System.Windows.Forms.Button();
|
||||
btnOptionsAdvanced = new System.Windows.Forms.Button();
|
||||
chkOptionsUseDarkMode = new System.Windows.Forms.CheckBox();
|
||||
chkAutoInstallUpdates = new System.Windows.Forms.CheckBox();
|
||||
btnStartStopService = new System.Windows.Forms.Button();
|
||||
btnElevationInfo = new System.Windows.Forms.Button();
|
||||
rbElevationService = new System.Windows.Forms.RadioButton();
|
||||
rbElevationProcess = new System.Windows.Forms.RadioButton();
|
||||
rbElevationAdmin = new System.Windows.Forms.RadioButton();
|
||||
label8 = new System.Windows.Forms.Label();
|
||||
rbElevationNone = new System.Windows.Forms.RadioButton();
|
||||
chkGdiScaling = new System.Windows.Forms.CheckBox();
|
||||
chkCheckForUpdates = new System.Windows.Forms.CheckBox();
|
||||
chkMinimizeToSystemTray = new System.Windows.Forms.CheckBox();
|
||||
chkMinimizeOnClose = new System.Windows.Forms.CheckBox();
|
||||
chkStartMinimized = new System.Windows.Forms.CheckBox();
|
||||
chkStartAfterLogin = new System.Windows.Forms.CheckBox();
|
||||
mnuColorProfiles = new System.Windows.Forms.ContextMenuStrip(components);
|
||||
miCreateHDRColorProfile = new System.Windows.Forms.ToolStripMenuItem();
|
||||
miCreateSDRColorProfile = new System.Windows.Forms.ToolStripMenuItem();
|
||||
grpOptionsModules.SuspendLayout();
|
||||
grpMiscellaneousOptions.SuspendLayout();
|
||||
grpGeneralOptions.SuspendLayout();
|
||||
mnuColorProfiles.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// grpOptionsModules
|
||||
//
|
||||
grpOptionsModules.Controls.Add(label1);
|
||||
grpOptionsModules.Controls.Add(chkModules);
|
||||
grpOptionsModules.Location = new Point(11, 223);
|
||||
grpOptionsModules.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
grpOptionsModules.Name = "grpOptionsModules";
|
||||
grpOptionsModules.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
grpOptionsModules.Size = new Size(658, 131);
|
||||
grpOptionsModules.TabIndex = 11;
|
||||
grpOptionsModules.TabStop = false;
|
||||
grpOptionsModules.Text = "Modules";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Location = new Point(7, 19);
|
||||
label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(511, 15);
|
||||
label1.TabIndex = 7;
|
||||
label1.Text = "Here you can disable modules you do not want. A restart is required for a change to have effect.";
|
||||
//
|
||||
// chkModules
|
||||
//
|
||||
chkModules.ColumnWidth = 200;
|
||||
chkModules.FormattingEnabled = true;
|
||||
chkModules.Location = new Point(7, 40);
|
||||
chkModules.MultiColumn = true;
|
||||
chkModules.Name = "chkModules";
|
||||
chkModules.Size = new Size(507, 76);
|
||||
chkModules.TabIndex = 0;
|
||||
chkModules.ItemCheck += chkModules_ItemCheck;
|
||||
//
|
||||
// grpMiscellaneousOptions
|
||||
//
|
||||
grpMiscellaneousOptions.Controls.Add(btnOptionsColorProfiles);
|
||||
grpMiscellaneousOptions.Controls.Add(btnSetShortcutScreenSaver);
|
||||
grpMiscellaneousOptions.Controls.Add(label11);
|
||||
grpMiscellaneousOptions.Controls.Add(edtBlankScreenSaverShortcut);
|
||||
grpMiscellaneousOptions.Controls.Add(lblFixChromeFontsDescription);
|
||||
grpMiscellaneousOptions.Controls.Add(chkFixChromeFonts);
|
||||
grpMiscellaneousOptions.Location = new Point(11, 360);
|
||||
grpMiscellaneousOptions.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
grpMiscellaneousOptions.Name = "grpMiscellaneousOptions";
|
||||
grpMiscellaneousOptions.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
grpMiscellaneousOptions.Size = new Size(658, 131);
|
||||
grpMiscellaneousOptions.TabIndex = 5;
|
||||
grpMiscellaneousOptions.TabStop = false;
|
||||
grpMiscellaneousOptions.Text = "Miscellaneous";
|
||||
//
|
||||
// btnOptionsColorProfiles
|
||||
//
|
||||
btnOptionsColorProfiles.Location = new Point(538, 17);
|
||||
btnOptionsColorProfiles.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnOptionsColorProfiles.Name = "btnOptionsColorProfiles";
|
||||
btnOptionsColorProfiles.Size = new Size(112, 27);
|
||||
btnOptionsColorProfiles.TabIndex = 12;
|
||||
btnOptionsColorProfiles.Text = "Color Profiles...";
|
||||
btnOptionsColorProfiles.UseVisualStyleBackColor = true;
|
||||
btnOptionsColorProfiles.Click += btnOptionsColorProfiles_Click;
|
||||
//
|
||||
// btnSetShortcutScreenSaver
|
||||
//
|
||||
btnSetShortcutScreenSaver.Location = new Point(181, 98);
|
||||
btnSetShortcutScreenSaver.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnSetShortcutScreenSaver.Name = "btnSetShortcutScreenSaver";
|
||||
btnSetShortcutScreenSaver.Size = new Size(40, 27);
|
||||
btnSetShortcutScreenSaver.TabIndex = 10;
|
||||
btnSetShortcutScreenSaver.Text = "Set";
|
||||
btnSetShortcutScreenSaver.UseVisualStyleBackColor = true;
|
||||
btnSetShortcutScreenSaver.Click += btnSetShortcutScreenSaver_Click;
|
||||
//
|
||||
// label11
|
||||
//
|
||||
label11.AutoSize = true;
|
||||
label11.Location = new Point(7, 80);
|
||||
label11.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
label11.Name = "label11";
|
||||
label11.Size = new Size(238, 15);
|
||||
label11.TabIndex = 9;
|
||||
label11.Text = "Set a shortcut to start the blank screensaver:";
|
||||
//
|
||||
// edtBlankScreenSaverShortcut
|
||||
//
|
||||
edtBlankScreenSaverShortcut.Location = new Point(7, 101);
|
||||
edtBlankScreenSaverShortcut.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
edtBlankScreenSaverShortcut.Name = "edtBlankScreenSaverShortcut";
|
||||
edtBlankScreenSaverShortcut.ReadOnly = true;
|
||||
edtBlankScreenSaverShortcut.Size = new Size(165, 23);
|
||||
edtBlankScreenSaverShortcut.TabIndex = 7;
|
||||
edtBlankScreenSaverShortcut.KeyDown += edtShortcut_KeyDown;
|
||||
edtBlankScreenSaverShortcut.KeyUp += edtShortcut_KeyUp;
|
||||
//
|
||||
// lblFixChromeFontsDescription
|
||||
//
|
||||
lblFixChromeFontsDescription.AutoSize = true;
|
||||
lblFixChromeFontsDescription.Location = new Point(4, 45);
|
||||
lblFixChromeFontsDescription.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
lblFixChromeFontsDescription.Name = "lblFixChromeFontsDescription";
|
||||
lblFixChromeFontsDescription.Size = new Size(427, 15);
|
||||
lblFixChromeFontsDescription.TabIndex = 6;
|
||||
lblFixChromeFontsDescription.Text = "This will add the parameter --disable-lcd-text to Chrome and requires elevation.";
|
||||
//
|
||||
// chkFixChromeFonts
|
||||
//
|
||||
chkFixChromeFonts.AutoSize = true;
|
||||
chkFixChromeFonts.Location = new Point(7, 22);
|
||||
chkFixChromeFonts.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
chkFixChromeFonts.Name = "chkFixChromeFonts";
|
||||
chkFixChromeFonts.Size = new Size(378, 19);
|
||||
chkFixChromeFonts.TabIndex = 4;
|
||||
chkFixChromeFonts.Text = "ClearType: fix bad fonts in Chrome (turn on grayscale anti-aliasing)";
|
||||
chkFixChromeFonts.UseVisualStyleBackColor = true;
|
||||
chkFixChromeFonts.CheckedChanged += chkFixChromeFonts_CheckedChanged;
|
||||
//
|
||||
// grpGeneralOptions
|
||||
//
|
||||
grpGeneralOptions.Controls.Add(btnOptionsLog);
|
||||
grpGeneralOptions.Controls.Add(btnOptionsAdvanced);
|
||||
grpGeneralOptions.Controls.Add(chkOptionsUseDarkMode);
|
||||
grpGeneralOptions.Controls.Add(chkAutoInstallUpdates);
|
||||
grpGeneralOptions.Controls.Add(btnStartStopService);
|
||||
grpGeneralOptions.Controls.Add(btnElevationInfo);
|
||||
grpGeneralOptions.Controls.Add(rbElevationService);
|
||||
grpGeneralOptions.Controls.Add(rbElevationProcess);
|
||||
grpGeneralOptions.Controls.Add(rbElevationAdmin);
|
||||
grpGeneralOptions.Controls.Add(label8);
|
||||
grpGeneralOptions.Controls.Add(rbElevationNone);
|
||||
grpGeneralOptions.Controls.Add(chkGdiScaling);
|
||||
grpGeneralOptions.Controls.Add(chkCheckForUpdates);
|
||||
grpGeneralOptions.Controls.Add(chkMinimizeToSystemTray);
|
||||
grpGeneralOptions.Controls.Add(chkMinimizeOnClose);
|
||||
grpGeneralOptions.Controls.Add(chkStartMinimized);
|
||||
grpGeneralOptions.Controls.Add(chkStartAfterLogin);
|
||||
grpGeneralOptions.Location = new Point(7, 6);
|
||||
grpGeneralOptions.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
grpGeneralOptions.Name = "grpGeneralOptions";
|
||||
grpGeneralOptions.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
grpGeneralOptions.Size = new Size(662, 211);
|
||||
grpGeneralOptions.TabIndex = 2;
|
||||
grpGeneralOptions.TabStop = false;
|
||||
grpGeneralOptions.Text = "General";
|
||||
//
|
||||
// btnOptionsLog
|
||||
//
|
||||
btnOptionsLog.Location = new Point(103, 172);
|
||||
btnOptionsLog.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnOptionsLog.Name = "btnOptionsLog";
|
||||
btnOptionsLog.Size = new Size(88, 27);
|
||||
btnOptionsLog.TabIndex = 68;
|
||||
btnOptionsLog.Text = "Logging...";
|
||||
btnOptionsLog.UseVisualStyleBackColor = true;
|
||||
btnOptionsLog.Click += btnOptionsLog_Click;
|
||||
//
|
||||
// btnOptionsAdvanced
|
||||
//
|
||||
btnOptionsAdvanced.Location = new Point(7, 172);
|
||||
btnOptionsAdvanced.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnOptionsAdvanced.Name = "btnOptionsAdvanced";
|
||||
btnOptionsAdvanced.Size = new Size(88, 27);
|
||||
btnOptionsAdvanced.TabIndex = 11;
|
||||
btnOptionsAdvanced.Text = "Advanced...";
|
||||
btnOptionsAdvanced.UseVisualStyleBackColor = true;
|
||||
btnOptionsAdvanced.Click += btnOptionsAdvanced_Click;
|
||||
//
|
||||
// chkOptionsUseDarkMode
|
||||
//
|
||||
chkOptionsUseDarkMode.AutoSize = true;
|
||||
chkOptionsUseDarkMode.Location = new Point(216, 47);
|
||||
chkOptionsUseDarkMode.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
chkOptionsUseDarkMode.Name = "chkOptionsUseDarkMode";
|
||||
chkOptionsUseDarkMode.Size = new Size(164, 19);
|
||||
chkOptionsUseDarkMode.TabIndex = 67;
|
||||
chkOptionsUseDarkMode.Text = "Dark Mode (experimental)";
|
||||
chkOptionsUseDarkMode.UseVisualStyleBackColor = true;
|
||||
chkOptionsUseDarkMode.CheckedChanged += chkOptionsUseDarkMode_CheckedChanged;
|
||||
//
|
||||
// chkAutoInstallUpdates
|
||||
//
|
||||
chkAutoInstallUpdates.AutoSize = true;
|
||||
chkAutoInstallUpdates.Location = new Point(7, 147);
|
||||
chkAutoInstallUpdates.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
chkAutoInstallUpdates.Name = "chkAutoInstallUpdates";
|
||||
chkAutoInstallUpdates.Size = new Size(179, 19);
|
||||
chkAutoInstallUpdates.TabIndex = 66;
|
||||
chkAutoInstallUpdates.Text = "Automatically install updates";
|
||||
chkAutoInstallUpdates.UseVisualStyleBackColor = true;
|
||||
chkAutoInstallUpdates.CheckedChanged += chkAutoInstallUpdates_CheckedChanged;
|
||||
//
|
||||
// btnStartStopService
|
||||
//
|
||||
btnStartStopService.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
btnStartStopService.Location = new Point(614, 129);
|
||||
btnStartStopService.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnStartStopService.Name = "btnStartStopService";
|
||||
btnStartStopService.Size = new Size(40, 27);
|
||||
btnStartStopService.TabIndex = 65;
|
||||
btnStartStopService.Text = "Start";
|
||||
btnStartStopService.UseVisualStyleBackColor = true;
|
||||
btnStartStopService.Click += btnStartStopService_Click;
|
||||
//
|
||||
// btnElevationInfo
|
||||
//
|
||||
btnElevationInfo.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
btnElevationInfo.Location = new Point(329, 67);
|
||||
btnElevationInfo.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnElevationInfo.Name = "btnElevationInfo";
|
||||
btnElevationInfo.Size = new Size(22, 27);
|
||||
btnElevationInfo.TabIndex = 64;
|
||||
btnElevationInfo.Text = "?";
|
||||
btnElevationInfo.UseVisualStyleBackColor = true;
|
||||
btnElevationInfo.Click += btnElevationInfo_Click;
|
||||
//
|
||||
// rbElevationService
|
||||
//
|
||||
rbElevationService.AutoSize = true;
|
||||
rbElevationService.Location = new Point(216, 133);
|
||||
rbElevationService.Name = "rbElevationService";
|
||||
rbElevationService.Size = new Size(136, 19);
|
||||
rbElevationService.TabIndex = 63;
|
||||
rbElevationService.TabStop = true;
|
||||
rbElevationService.Tag = "2";
|
||||
rbElevationService.Text = "Use Windows Service";
|
||||
rbElevationService.UseVisualStyleBackColor = true;
|
||||
rbElevationService.CheckedChanged += rbElevationNone_CheckedChanged;
|
||||
//
|
||||
// rbElevationProcess
|
||||
//
|
||||
rbElevationProcess.AutoSize = true;
|
||||
rbElevationProcess.Location = new Point(216, 154);
|
||||
rbElevationProcess.Name = "rbElevationProcess";
|
||||
rbElevationProcess.Size = new Size(189, 19);
|
||||
rbElevationProcess.TabIndex = 62;
|
||||
rbElevationProcess.TabStop = true;
|
||||
rbElevationProcess.Tag = "3";
|
||||
rbElevationProcess.Text = "Use dedicated elevated process";
|
||||
rbElevationProcess.UseVisualStyleBackColor = true;
|
||||
rbElevationProcess.CheckedChanged += rbElevationNone_CheckedChanged;
|
||||
//
|
||||
// rbElevationAdmin
|
||||
//
|
||||
rbElevationAdmin.AutoSize = true;
|
||||
rbElevationAdmin.Location = new Point(216, 112);
|
||||
rbElevationAdmin.Name = "rbElevationAdmin";
|
||||
rbElevationAdmin.Size = new Size(97, 19);
|
||||
rbElevationAdmin.TabIndex = 61;
|
||||
rbElevationAdmin.TabStop = true;
|
||||
rbElevationAdmin.Tag = "1";
|
||||
rbElevationAdmin.Text = "Run as admin";
|
||||
rbElevationAdmin.UseVisualStyleBackColor = true;
|
||||
rbElevationAdmin.CheckedChanged += rbElevationNone_CheckedChanged;
|
||||
//
|
||||
// label8
|
||||
//
|
||||
label8.AutoSize = true;
|
||||
label8.Location = new Point(216, 73);
|
||||
label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
label8.Name = "label8";
|
||||
label8.Size = new Size(105, 15);
|
||||
label8.TabIndex = 60;
|
||||
label8.Text = "Elevation-method:";
|
||||
//
|
||||
// rbElevationNone
|
||||
//
|
||||
rbElevationNone.AutoSize = true;
|
||||
rbElevationNone.Location = new Point(216, 91);
|
||||
rbElevationNone.Name = "rbElevationNone";
|
||||
rbElevationNone.Size = new Size(54, 19);
|
||||
rbElevationNone.TabIndex = 10;
|
||||
rbElevationNone.TabStop = true;
|
||||
rbElevationNone.Tag = "0";
|
||||
rbElevationNone.Text = "None";
|
||||
rbElevationNone.UseVisualStyleBackColor = true;
|
||||
rbElevationNone.CheckedChanged += rbElevationNone_CheckedChanged;
|
||||
//
|
||||
// chkGdiScaling
|
||||
//
|
||||
chkGdiScaling.AutoSize = true;
|
||||
chkGdiScaling.Location = new Point(216, 22);
|
||||
chkGdiScaling.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
chkGdiScaling.Name = "chkGdiScaling";
|
||||
chkGdiScaling.Size = new Size(197, 19);
|
||||
chkGdiScaling.TabIndex = 7;
|
||||
chkGdiScaling.Text = "Use GDI Scaling (requires restart)";
|
||||
chkGdiScaling.UseVisualStyleBackColor = true;
|
||||
chkGdiScaling.CheckedChanged += chkGdiScaling_CheckedChanged;
|
||||
//
|
||||
// chkCheckForUpdates
|
||||
//
|
||||
chkCheckForUpdates.AutoSize = true;
|
||||
chkCheckForUpdates.Location = new Point(7, 122);
|
||||
chkCheckForUpdates.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
chkCheckForUpdates.Name = "chkCheckForUpdates";
|
||||
chkCheckForUpdates.Size = new Size(197, 19);
|
||||
chkCheckForUpdates.TabIndex = 6;
|
||||
chkCheckForUpdates.Text = "Automatically check for updates";
|
||||
chkCheckForUpdates.UseVisualStyleBackColor = true;
|
||||
chkCheckForUpdates.CheckedChanged += chkCheckForUpdates_CheckedChanged;
|
||||
//
|
||||
// chkMinimizeToSystemTray
|
||||
//
|
||||
chkMinimizeToSystemTray.AutoSize = true;
|
||||
chkMinimizeToSystemTray.Location = new Point(7, 97);
|
||||
chkMinimizeToSystemTray.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
chkMinimizeToSystemTray.Name = "chkMinimizeToSystemTray";
|
||||
chkMinimizeToSystemTray.Size = new Size(152, 19);
|
||||
chkMinimizeToSystemTray.TabIndex = 5;
|
||||
chkMinimizeToSystemTray.Text = "Minimize to system tray";
|
||||
chkMinimizeToSystemTray.UseVisualStyleBackColor = true;
|
||||
chkMinimizeToSystemTray.CheckedChanged += chkMinimizeToSystemTray_CheckedChanged;
|
||||
//
|
||||
// chkMinimizeOnClose
|
||||
//
|
||||
chkMinimizeOnClose.AutoSize = true;
|
||||
chkMinimizeOnClose.Location = new Point(7, 72);
|
||||
chkMinimizeOnClose.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
chkMinimizeOnClose.Name = "chkMinimizeOnClose";
|
||||
chkMinimizeOnClose.Size = new Size(122, 19);
|
||||
chkMinimizeOnClose.TabIndex = 4;
|
||||
chkMinimizeOnClose.Text = "Minimize on close";
|
||||
chkMinimizeOnClose.UseVisualStyleBackColor = true;
|
||||
chkMinimizeOnClose.CheckedChanged += chkMinimizeOnClose_CheckedChanged;
|
||||
//
|
||||
// chkStartMinimized
|
||||
//
|
||||
chkStartMinimized.AutoSize = true;
|
||||
chkStartMinimized.Location = new Point(7, 47);
|
||||
chkStartMinimized.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
chkStartMinimized.Name = "chkStartMinimized";
|
||||
chkStartMinimized.Size = new Size(109, 19);
|
||||
chkStartMinimized.TabIndex = 3;
|
||||
chkStartMinimized.Text = "Start minimized";
|
||||
chkStartMinimized.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// chkStartAfterLogin
|
||||
//
|
||||
chkStartAfterLogin.AutoSize = true;
|
||||
chkStartAfterLogin.Location = new Point(7, 22);
|
||||
chkStartAfterLogin.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
chkStartAfterLogin.Name = "chkStartAfterLogin";
|
||||
chkStartAfterLogin.Size = new Size(183, 19);
|
||||
chkStartAfterLogin.TabIndex = 2;
|
||||
chkStartAfterLogin.Text = "Automatically start after login";
|
||||
chkStartAfterLogin.UseVisualStyleBackColor = true;
|
||||
chkStartAfterLogin.CheckedChanged += chkStartAfterLogin_CheckedChanged;
|
||||
//
|
||||
// mnuColorProfiles
|
||||
//
|
||||
mnuColorProfiles.ImageScalingSize = new Size(20, 20);
|
||||
mnuColorProfiles.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { miCreateHDRColorProfile, miCreateSDRColorProfile });
|
||||
mnuColorProfiles.Name = "mnuLgButtons";
|
||||
mnuColorProfiles.Size = new Size(214, 48);
|
||||
//
|
||||
// miCreateHDRColorProfile
|
||||
//
|
||||
miCreateHDRColorProfile.Name = "miCreateHDRColorProfile";
|
||||
miCreateHDRColorProfile.Size = new Size(213, 22);
|
||||
miCreateHDRColorProfile.Text = "Create HDR Color Profile...";
|
||||
miCreateHDRColorProfile.Click += miCreateHDRColorProfile_Click;
|
||||
//
|
||||
// miCreateSDRColorProfile
|
||||
//
|
||||
miCreateSDRColorProfile.Name = "miCreateSDRColorProfile";
|
||||
miCreateSDRColorProfile.Size = new Size(213, 22);
|
||||
miCreateSDRColorProfile.Text = "Create SDR Color Profile...";
|
||||
miCreateSDRColorProfile.Click += miCreateSDRColorProfile_Click;
|
||||
//
|
||||
// OptionsPanel
|
||||
//
|
||||
Controls.Add(grpOptionsModules);
|
||||
Controls.Add(grpMiscellaneousOptions);
|
||||
Controls.Add(grpGeneralOptions);
|
||||
Name = "OptionsPanel";
|
||||
Size = new Size(732, 523);
|
||||
grpOptionsModules.ResumeLayout(false);
|
||||
grpOptionsModules.PerformLayout();
|
||||
grpMiscellaneousOptions.ResumeLayout(false);
|
||||
grpMiscellaneousOptions.PerformLayout();
|
||||
grpGeneralOptions.ResumeLayout(false);
|
||||
grpGeneralOptions.PerformLayout();
|
||||
mnuColorProfiles.ResumeLayout(false);
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
private System.Windows.Forms.GroupBox grpGeneralOptions;
|
||||
private System.Windows.Forms.CheckBox chkStartMinimized;
|
||||
private System.Windows.Forms.CheckBox chkStartAfterLogin;
|
||||
private System.Windows.Forms.TabPage tabInfo;
|
||||
private System.Windows.Forms.GroupBox grpMiscellaneousOptions;
|
||||
private System.Windows.Forms.CheckBox chkFixChromeFonts;
|
||||
private System.Windows.Forms.Label lblFixChromeFontsDescription;
|
||||
private System.Windows.Forms.Button btnSetShortcutScreenSaver;
|
||||
private System.Windows.Forms.Label label11;
|
||||
private System.Windows.Forms.TextBox edtBlankScreenSaverShortcut;
|
||||
private System.Windows.Forms.CheckBox chkMinimizeOnClose;
|
||||
private System.Windows.Forms.CheckBox chkMinimizeToSystemTray;
|
||||
private System.Windows.Forms.CheckBox chkCheckForUpdates;
|
||||
private System.Windows.Forms.CheckBox chkGdiScaling;
|
||||
private System.Windows.Forms.RadioButton rbElevationService;
|
||||
private System.Windows.Forms.RadioButton rbElevationProcess;
|
||||
private System.Windows.Forms.RadioButton rbElevationAdmin;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.RadioButton rbElevationNone;
|
||||
private System.Windows.Forms.Button btnElevationInfo;
|
||||
private System.Windows.Forms.Button btnStartStopService;
|
||||
private System.Windows.Forms.CheckBox chkAutoInstallUpdates;
|
||||
private System.Windows.Forms.Button btnUpdate;
|
||||
private System.Windows.Forms.GroupBox grpOptionsModules;
|
||||
private System.Windows.Forms.CheckedListBox chkModules;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.CheckBox chkOptionsUseDarkMode;
|
||||
private System.Windows.Forms.Button btnOptionsAdvanced;
|
||||
private System.Windows.Forms.Button btnOptionsLog;
|
||||
private System.Windows.Forms.Button btnOptionsColorProfiles;
|
||||
private System.Windows.Forms.ContextMenuStrip mnuColorProfiles;
|
||||
private System.Windows.Forms.ToolStripMenuItem miCreateHDRColorProfile;
|
||||
private System.Windows.Forms.ToolStripMenuItem miCreateSDRColorProfile;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,363 @@
|
||||
using ColorControl.Services.Common;
|
||||
using ColorControl.Shared.Common;
|
||||
using ColorControl.Shared.Contracts;
|
||||
using ColorControl.Shared.Forms;
|
||||
using ColorControl.Shared.Services;
|
||||
using ColorControl.XForms;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ColorControl.Forms;
|
||||
|
||||
public partial class OptionsPanel : UserControl
|
||||
{
|
||||
private readonly WinApiService _winApiService;
|
||||
private readonly WinApiAdminService _winApiAdminService;
|
||||
private readonly AppContextProvider _appContextProvider;
|
||||
private readonly ElevationService _elevationService;
|
||||
private bool _initialized;
|
||||
private Config _config;
|
||||
|
||||
public OptionsPanel(WinApiService winApiService, WinApiAdminService winApiAdminService, AppContextProvider appContextProvider, ElevationService elevationService)
|
||||
{
|
||||
_winApiService = winApiService;
|
||||
_winApiAdminService = winApiAdminService;
|
||||
_appContextProvider = appContextProvider;
|
||||
_elevationService = elevationService;
|
||||
_config = appContextProvider.GetAppContext().Config;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
if (DarkModeUtils.UseDarkMode)
|
||||
{
|
||||
for (var i = 0; i < Controls.Count; i++)
|
||||
{
|
||||
var control = Controls[i];
|
||||
|
||||
DarkModeUtils.SetControlTheme(control);
|
||||
}
|
||||
}
|
||||
|
||||
Init();
|
||||
|
||||
UpdateServiceInfo();
|
||||
}
|
||||
|
||||
private void Init()
|
||||
{
|
||||
if (chkModules.Items.Count == 0)
|
||||
{
|
||||
foreach (var module in _config.Modules)
|
||||
{
|
||||
chkModules.Items.Add(module.DisplayName, module.IsActive);
|
||||
}
|
||||
}
|
||||
|
||||
chkStartMinimized.Checked = _config.StartMinimized;
|
||||
chkMinimizeOnClose.Checked = _config.MinimizeOnClose;
|
||||
chkMinimizeToSystemTray.Checked = _config.MinimizeToTray;
|
||||
chkCheckForUpdates.Checked = _config.CheckForUpdates;
|
||||
chkAutoInstallUpdates.Checked = _config.AutoInstallUpdates;
|
||||
chkAutoInstallUpdates.Enabled = _config.CheckForUpdates && _config.ElevationMethod == ElevationMethod.UseService;
|
||||
edtBlankScreenSaverShortcut.Text = _config.ScreenSaverShortcut;
|
||||
chkGdiScaling.Checked = _config.UseGdiScaling;
|
||||
chkOptionsUseDarkMode.Checked = _config.UseDarkMode;
|
||||
|
||||
chkStartAfterLogin.Checked = _winApiService.TaskExists(Program.TS_TASKNAME);
|
||||
|
||||
chkFixChromeFonts.Enabled = _winApiService.IsChromeInstalled();
|
||||
if (chkFixChromeFonts.Enabled)
|
||||
{
|
||||
chkFixChromeFonts.Checked = _winApiService.IsChromeFixInstalled();
|
||||
}
|
||||
|
||||
_initialized = false;
|
||||
try
|
||||
{
|
||||
var _ = _config.ElevationMethod switch
|
||||
{
|
||||
ElevationMethod.None => rbElevationNone.Checked = true,
|
||||
ElevationMethod.RunAsAdmin => rbElevationAdmin.Checked = true,
|
||||
ElevationMethod.UseService => rbElevationService.Checked = true,
|
||||
ElevationMethod.UseElevatedProcess => rbElevationProcess.Checked = true,
|
||||
_ => false
|
||||
};
|
||||
}
|
||||
finally
|
||||
{
|
||||
_initialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateServiceInfo()
|
||||
{
|
||||
var text = "Use Windows Service";
|
||||
btnStartStopService.Enabled = true;
|
||||
|
||||
if (_winApiService.IsServiceRunning())
|
||||
{
|
||||
text += " (running)";
|
||||
btnStartStopService.Text = "Stop";
|
||||
}
|
||||
else if (_winApiService.IsServiceInstalled())
|
||||
{
|
||||
text += " (installed, not running)";
|
||||
btnStartStopService.Text = "Start";
|
||||
}
|
||||
else
|
||||
{
|
||||
text += " (not installed)";
|
||||
btnStartStopService.Text = "Start";
|
||||
btnStartStopService.Enabled = false;
|
||||
}
|
||||
|
||||
rbElevationService.Text = text;
|
||||
}
|
||||
|
||||
private void edtShortcut_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
((TextBox)sender).Text = KeyboardShortcutManager.FormatKeyboardShortcut(e);
|
||||
}
|
||||
|
||||
private void edtShortcut_KeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
KeyboardShortcutManager.HandleKeyboardShortcutUp(e);
|
||||
}
|
||||
|
||||
private void btnSetShortcutScreenSaver_Click(object sender, EventArgs e)
|
||||
{
|
||||
var shortcut = edtBlankScreenSaverShortcut.Text.Trim();
|
||||
|
||||
if (!KeyboardShortcutManager.ValidateShortcut(shortcut))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_config.ScreenSaverShortcut = shortcut;
|
||||
|
||||
KeyboardShortcutManager.RegisterShortcut(MainForm.SHORTCUTID_SCREENSAVER, shortcut);
|
||||
}
|
||||
|
||||
private void chkFixChromeFonts_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (_initialized)
|
||||
{
|
||||
_config.FixChromeFonts = chkFixChromeFonts.Checked;
|
||||
|
||||
var folder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
|
||||
|
||||
_winApiAdminService.InstallChromeFix(chkFixChromeFonts.Checked, folder);
|
||||
}
|
||||
}
|
||||
|
||||
private void chkAutoInstallUpdates_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (_initialized)
|
||||
{
|
||||
_config.AutoInstallUpdates = chkAutoInstallUpdates.Checked;
|
||||
}
|
||||
}
|
||||
|
||||
private void chkMinimizeToSystemTray_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (_initialized)
|
||||
{
|
||||
_config.StartMinimized = chkStartMinimized.Checked;
|
||||
Program.GetNotifyIcon().Visible = _config.MinimizeToTray;
|
||||
}
|
||||
}
|
||||
|
||||
private void chkCheckForUpdates_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (_initialized)
|
||||
{
|
||||
_config.CheckForUpdates = chkCheckForUpdates.Checked;
|
||||
chkAutoInstallUpdates.Enabled = _config.CheckForUpdates && _config.ElevationMethod == ElevationMethod.UseService;
|
||||
}
|
||||
}
|
||||
|
||||
private void chkGdiScaling_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
_config.UseGdiScaling = chkGdiScaling.Checked;
|
||||
}
|
||||
|
||||
private void chkStartAfterLogin_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!_initialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var enabled = chkStartAfterLogin.Checked;
|
||||
_elevationService.RegisterScheduledTask(enabled);
|
||||
|
||||
rbElevationAdmin.Enabled = enabled;
|
||||
if (!enabled && rbElevationAdmin.Checked)
|
||||
{
|
||||
rbElevationNone.Checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnElevationInfo_Click(object sender, EventArgs e)
|
||||
{
|
||||
MessageForms.InfoOk(Utils.ELEVATION_MSG + @$"
|
||||
|
||||
NOTE: if ColorControl itself already runs as administrator this is indicated in the title: ColorControl {Application.ProductVersion} (administrator).
|
||||
|
||||
Currently ColorControl is {(_winApiService.IsAdministrator() ? "" : "not ")}running as administrator.
|
||||
");
|
||||
}
|
||||
|
||||
private void rbElevationNone_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!_initialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (sender is not RadioButton button || !button.Checked)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_elevationService.SetElevationMethod((ElevationMethod)Utils.ParseInt((string)button.Tag), chkStartAfterLogin.Checked);
|
||||
|
||||
UpdateServiceInfo();
|
||||
chkAutoInstallUpdates.Enabled = _config.CheckForUpdates && _config.ElevationMethod == ElevationMethod.UseService;
|
||||
}
|
||||
|
||||
private async void btnStartStopService_Click(object sender, EventArgs e)
|
||||
{
|
||||
btnStartStopService.Enabled = false;
|
||||
try
|
||||
{
|
||||
var start = btnStartStopService.Text == "Start";
|
||||
|
||||
if (start)
|
||||
{
|
||||
_winApiAdminService.StartService();
|
||||
}
|
||||
else
|
||||
{
|
||||
_winApiAdminService.StopService();
|
||||
}
|
||||
|
||||
var wait = 1500;
|
||||
|
||||
while (wait > 0)
|
||||
{
|
||||
await Task.Delay(100);
|
||||
|
||||
if (start == _winApiService.IsServiceRunning())
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
wait -= 100;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
btnStartStopService.Enabled = true;
|
||||
}
|
||||
|
||||
UpdateServiceInfo();
|
||||
}
|
||||
|
||||
private void chkMinimizeOnClose_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
_config.MinimizeOnClose = chkMinimizeOnClose.Checked;
|
||||
}
|
||||
|
||||
private void chkOptionsUseDarkMode_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!_initialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_config.UseDarkMode = chkOptionsUseDarkMode.Checked;
|
||||
|
||||
Program.SetTheme(_config.UseDarkMode);
|
||||
}
|
||||
|
||||
private void btnOptionsAdvanced_Click(object sender, EventArgs e)
|
||||
{
|
||||
var processPollingIntervalField = new FieldDefinition
|
||||
{
|
||||
FieldType = FieldType.Numeric,
|
||||
Label = "Polling interval of process monitor (milliseconds).",
|
||||
SubLabel = "Decreasing this delay may execute triggered presets sooner but can cause a higher CPU load",
|
||||
MinValue = 50,
|
||||
MaxValue = 5000,
|
||||
Value = _config.ProcessMonitorPollingInterval
|
||||
};
|
||||
var useRawInputField = new FieldDefinition
|
||||
{
|
||||
FieldType = FieldType.CheckBox,
|
||||
Label = "Use Raw Input for shortcuts (hot keys)",
|
||||
SubLabel = "This enables shortcuts to work during applications/games that block certain keys (like WinKey or Control). NOTE: if the application in the foreground runs with higher privileges than ColorControl, Raw Input does not work and normal hot keys are used",
|
||||
Value = _config.UseRawInput
|
||||
};
|
||||
var setMinTmlAndMaxTmlField = new FieldDefinition
|
||||
{
|
||||
FieldType = FieldType.CheckBox,
|
||||
Label = "Set MinTML and MaxTML when applying color profiles",
|
||||
SubLabel = "When this is enabled MinTML and MaxTML will be automatically be set to respectively the minimum luminance and the maximum luminance of the color profile",
|
||||
Value = _config.SetMinTmlAndMaxTml
|
||||
};
|
||||
|
||||
var values = MessageForms.ShowDialog("Advanced settings", new[] { processPollingIntervalField, useRawInputField, setMinTmlAndMaxTmlField });
|
||||
|
||||
if (values?.Any() != true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_config.ProcessMonitorPollingInterval = processPollingIntervalField.ValueAsInt;
|
||||
_config.UseRawInput = useRawInputField.ValueAsBool;
|
||||
_config.SetMinTmlAndMaxTml = setMinTmlAndMaxTmlField.ValueAsBool;
|
||||
|
||||
KeyboardShortcutManager.SetUseRawInput(_config.UseRawInput);
|
||||
}
|
||||
|
||||
private void btnOptionsLog_Click(object sender, EventArgs e)
|
||||
{
|
||||
LogWindow.CreateAndShow();
|
||||
}
|
||||
|
||||
private void chkModules_ItemCheck(object sender, ItemCheckEventArgs e)
|
||||
{
|
||||
if (chkModules.Items.Count != _config.Modules.Count)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var index = e.Index;
|
||||
|
||||
if (index < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var module = _config.Modules[index];
|
||||
module.IsActive = e.NewValue == CheckState.Checked;
|
||||
}
|
||||
|
||||
private void miCreateHDRColorProfile_Click(object sender, EventArgs e)
|
||||
{
|
||||
ColorProfileWindow.CreateAndShow();
|
||||
}
|
||||
|
||||
private void btnOptionsColorProfiles_Click(object sender, EventArgs e)
|
||||
{
|
||||
mnuColorProfiles.ShowCustom(btnOptionsColorProfiles);
|
||||
}
|
||||
|
||||
private void miCreateSDRColorProfile_Click(object sender, EventArgs e)
|
||||
{
|
||||
ColorProfileWindow.CreateAndShow(isHDR: false);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
<?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">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="mnuColorProfiles.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
Generated
+1
-445
@@ -31,46 +31,11 @@
|
||||
components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
|
||||
tcMain = new System.Windows.Forms.TabControl();
|
||||
tabOptions = new System.Windows.Forms.TabPage();
|
||||
grpOptionsModules = new System.Windows.Forms.GroupBox();
|
||||
label1 = new System.Windows.Forms.Label();
|
||||
chkModules = new System.Windows.Forms.CheckedListBox();
|
||||
grpMiscellaneousOptions = new System.Windows.Forms.GroupBox();
|
||||
btnOptionsColorProfiles = new System.Windows.Forms.Button();
|
||||
btnSetShortcutScreenSaver = new System.Windows.Forms.Button();
|
||||
label11 = new System.Windows.Forms.Label();
|
||||
edtBlankScreenSaverShortcut = new System.Windows.Forms.TextBox();
|
||||
lblFixChromeFontsDescription = new System.Windows.Forms.Label();
|
||||
chkFixChromeFonts = new System.Windows.Forms.CheckBox();
|
||||
grpGeneralOptions = new System.Windows.Forms.GroupBox();
|
||||
btnOptionsLog = new System.Windows.Forms.Button();
|
||||
btnOptionsAdvanced = new System.Windows.Forms.Button();
|
||||
chkOptionsUseDarkMode = new System.Windows.Forms.CheckBox();
|
||||
chkAutoInstallUpdates = new System.Windows.Forms.CheckBox();
|
||||
btnStartStopService = new System.Windows.Forms.Button();
|
||||
btnElevationInfo = new System.Windows.Forms.Button();
|
||||
rbElevationService = new System.Windows.Forms.RadioButton();
|
||||
rbElevationProcess = new System.Windows.Forms.RadioButton();
|
||||
rbElevationAdmin = new System.Windows.Forms.RadioButton();
|
||||
label8 = new System.Windows.Forms.Label();
|
||||
rbElevationNone = new System.Windows.Forms.RadioButton();
|
||||
chkGdiScaling = new System.Windows.Forms.CheckBox();
|
||||
chkCheckForUpdates = new System.Windows.Forms.CheckBox();
|
||||
chkMinimizeToSystemTray = new System.Windows.Forms.CheckBox();
|
||||
chkMinimizeOnClose = new System.Windows.Forms.CheckBox();
|
||||
chkStartMinimized = new System.Windows.Forms.CheckBox();
|
||||
chkStartAfterLogin = new System.Windows.Forms.CheckBox();
|
||||
tabInfo = new System.Windows.Forms.TabPage();
|
||||
tabOptions = new System.Windows.Forms.TabPage();
|
||||
btnUpdate = new System.Windows.Forms.Button();
|
||||
mnuColorProfiles = new System.Windows.Forms.ContextMenuStrip(components);
|
||||
miCreateHDRColorProfile = new System.Windows.Forms.ToolStripMenuItem();
|
||||
miCreateSDRColorProfile = new System.Windows.Forms.ToolStripMenuItem();
|
||||
tcMain.SuspendLayout();
|
||||
tabOptions.SuspendLayout();
|
||||
grpOptionsModules.SuspendLayout();
|
||||
grpMiscellaneousOptions.SuspendLayout();
|
||||
grpGeneralOptions.SuspendLayout();
|
||||
mnuColorProfiles.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// tcMain
|
||||
@@ -88,9 +53,6 @@
|
||||
//
|
||||
// tabOptions
|
||||
//
|
||||
tabOptions.Controls.Add(grpOptionsModules);
|
||||
tabOptions.Controls.Add(grpMiscellaneousOptions);
|
||||
tabOptions.Controls.Add(grpGeneralOptions);
|
||||
tabOptions.Location = new System.Drawing.Point(4, 24);
|
||||
tabOptions.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
tabOptions.Name = "tabOptions";
|
||||
@@ -100,353 +62,6 @@
|
||||
tabOptions.Text = "Options";
|
||||
tabOptions.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// grpOptionsModules
|
||||
//
|
||||
grpOptionsModules.Controls.Add(label1);
|
||||
grpOptionsModules.Controls.Add(chkModules);
|
||||
grpOptionsModules.Location = new System.Drawing.Point(11, 223);
|
||||
grpOptionsModules.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
grpOptionsModules.Name = "grpOptionsModules";
|
||||
grpOptionsModules.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
grpOptionsModules.Size = new System.Drawing.Size(658, 131);
|
||||
grpOptionsModules.TabIndex = 11;
|
||||
grpOptionsModules.TabStop = false;
|
||||
grpOptionsModules.Text = "Modules";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Location = new System.Drawing.Point(7, 19);
|
||||
label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new System.Drawing.Size(511, 15);
|
||||
label1.TabIndex = 7;
|
||||
label1.Text = "Here you can disable modules you do not want. A restart is required for a change to have effect.";
|
||||
//
|
||||
// chkModules
|
||||
//
|
||||
chkModules.ColumnWidth = 200;
|
||||
chkModules.FormattingEnabled = true;
|
||||
chkModules.Location = new System.Drawing.Point(7, 40);
|
||||
chkModules.MultiColumn = true;
|
||||
chkModules.Name = "chkModules";
|
||||
chkModules.Size = new System.Drawing.Size(507, 76);
|
||||
chkModules.TabIndex = 0;
|
||||
chkModules.ItemCheck += chkModules_ItemCheck;
|
||||
//
|
||||
// grpMiscellaneousOptions
|
||||
//
|
||||
grpMiscellaneousOptions.Controls.Add(btnOptionsColorProfiles);
|
||||
grpMiscellaneousOptions.Controls.Add(btnSetShortcutScreenSaver);
|
||||
grpMiscellaneousOptions.Controls.Add(label11);
|
||||
grpMiscellaneousOptions.Controls.Add(edtBlankScreenSaverShortcut);
|
||||
grpMiscellaneousOptions.Controls.Add(lblFixChromeFontsDescription);
|
||||
grpMiscellaneousOptions.Controls.Add(chkFixChromeFonts);
|
||||
grpMiscellaneousOptions.Location = new System.Drawing.Point(11, 360);
|
||||
grpMiscellaneousOptions.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
grpMiscellaneousOptions.Name = "grpMiscellaneousOptions";
|
||||
grpMiscellaneousOptions.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
grpMiscellaneousOptions.Size = new System.Drawing.Size(658, 131);
|
||||
grpMiscellaneousOptions.TabIndex = 5;
|
||||
grpMiscellaneousOptions.TabStop = false;
|
||||
grpMiscellaneousOptions.Text = "Miscellaneous";
|
||||
//
|
||||
// btnOptionsColorProfiles
|
||||
//
|
||||
btnOptionsColorProfiles.Location = new System.Drawing.Point(538, 17);
|
||||
btnOptionsColorProfiles.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnOptionsColorProfiles.Name = "btnOptionsColorProfiles";
|
||||
btnOptionsColorProfiles.Size = new System.Drawing.Size(112, 27);
|
||||
btnOptionsColorProfiles.TabIndex = 12;
|
||||
btnOptionsColorProfiles.Text = "Color Profiles...";
|
||||
btnOptionsColorProfiles.UseVisualStyleBackColor = true;
|
||||
btnOptionsColorProfiles.Click += btnOptionsColorProfiles_Click;
|
||||
//
|
||||
// btnSetShortcutScreenSaver
|
||||
//
|
||||
btnSetShortcutScreenSaver.Location = new System.Drawing.Point(181, 98);
|
||||
btnSetShortcutScreenSaver.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnSetShortcutScreenSaver.Name = "btnSetShortcutScreenSaver";
|
||||
btnSetShortcutScreenSaver.Size = new System.Drawing.Size(40, 27);
|
||||
btnSetShortcutScreenSaver.TabIndex = 10;
|
||||
btnSetShortcutScreenSaver.Text = "Set";
|
||||
btnSetShortcutScreenSaver.UseVisualStyleBackColor = true;
|
||||
btnSetShortcutScreenSaver.Click += btnSetShortcutScreenSaver_Click;
|
||||
//
|
||||
// label11
|
||||
//
|
||||
label11.AutoSize = true;
|
||||
label11.Location = new System.Drawing.Point(7, 80);
|
||||
label11.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
label11.Name = "label11";
|
||||
label11.Size = new System.Drawing.Size(238, 15);
|
||||
label11.TabIndex = 9;
|
||||
label11.Text = "Set a shortcut to start the blank screensaver:";
|
||||
//
|
||||
// edtBlankScreenSaverShortcut
|
||||
//
|
||||
edtBlankScreenSaverShortcut.Location = new System.Drawing.Point(7, 101);
|
||||
edtBlankScreenSaverShortcut.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
edtBlankScreenSaverShortcut.Name = "edtBlankScreenSaverShortcut";
|
||||
edtBlankScreenSaverShortcut.ReadOnly = true;
|
||||
edtBlankScreenSaverShortcut.Size = new System.Drawing.Size(165, 23);
|
||||
edtBlankScreenSaverShortcut.TabIndex = 7;
|
||||
edtBlankScreenSaverShortcut.KeyDown += edtShortcut_KeyDown;
|
||||
edtBlankScreenSaverShortcut.KeyUp += edtShortcut_KeyUp;
|
||||
//
|
||||
// lblFixChromeFontsDescription
|
||||
//
|
||||
lblFixChromeFontsDescription.AutoSize = true;
|
||||
lblFixChromeFontsDescription.Location = new System.Drawing.Point(4, 45);
|
||||
lblFixChromeFontsDescription.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
lblFixChromeFontsDescription.Name = "lblFixChromeFontsDescription";
|
||||
lblFixChromeFontsDescription.Size = new System.Drawing.Size(427, 15);
|
||||
lblFixChromeFontsDescription.TabIndex = 6;
|
||||
lblFixChromeFontsDescription.Text = "This will add the parameter --disable-lcd-text to Chrome and requires elevation.";
|
||||
//
|
||||
// chkFixChromeFonts
|
||||
//
|
||||
chkFixChromeFonts.AutoSize = true;
|
||||
chkFixChromeFonts.Location = new System.Drawing.Point(7, 22);
|
||||
chkFixChromeFonts.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
chkFixChromeFonts.Name = "chkFixChromeFonts";
|
||||
chkFixChromeFonts.Size = new System.Drawing.Size(378, 19);
|
||||
chkFixChromeFonts.TabIndex = 4;
|
||||
chkFixChromeFonts.Text = "ClearType: fix bad fonts in Chrome (turn on grayscale anti-aliasing)";
|
||||
chkFixChromeFonts.UseVisualStyleBackColor = true;
|
||||
chkFixChromeFonts.CheckedChanged += chkFixChromeFonts_CheckedChanged;
|
||||
//
|
||||
// grpGeneralOptions
|
||||
//
|
||||
grpGeneralOptions.Controls.Add(btnOptionsLog);
|
||||
grpGeneralOptions.Controls.Add(btnOptionsAdvanced);
|
||||
grpGeneralOptions.Controls.Add(chkOptionsUseDarkMode);
|
||||
grpGeneralOptions.Controls.Add(chkAutoInstallUpdates);
|
||||
grpGeneralOptions.Controls.Add(btnStartStopService);
|
||||
grpGeneralOptions.Controls.Add(btnElevationInfo);
|
||||
grpGeneralOptions.Controls.Add(rbElevationService);
|
||||
grpGeneralOptions.Controls.Add(rbElevationProcess);
|
||||
grpGeneralOptions.Controls.Add(rbElevationAdmin);
|
||||
grpGeneralOptions.Controls.Add(label8);
|
||||
grpGeneralOptions.Controls.Add(rbElevationNone);
|
||||
grpGeneralOptions.Controls.Add(chkGdiScaling);
|
||||
grpGeneralOptions.Controls.Add(chkCheckForUpdates);
|
||||
grpGeneralOptions.Controls.Add(chkMinimizeToSystemTray);
|
||||
grpGeneralOptions.Controls.Add(chkMinimizeOnClose);
|
||||
grpGeneralOptions.Controls.Add(chkStartMinimized);
|
||||
grpGeneralOptions.Controls.Add(chkStartAfterLogin);
|
||||
grpGeneralOptions.Location = new System.Drawing.Point(7, 6);
|
||||
grpGeneralOptions.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
grpGeneralOptions.Name = "grpGeneralOptions";
|
||||
grpGeneralOptions.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
grpGeneralOptions.Size = new System.Drawing.Size(662, 211);
|
||||
grpGeneralOptions.TabIndex = 2;
|
||||
grpGeneralOptions.TabStop = false;
|
||||
grpGeneralOptions.Text = "General";
|
||||
//
|
||||
// btnOptionsLog
|
||||
//
|
||||
btnOptionsLog.Location = new System.Drawing.Point(103, 172);
|
||||
btnOptionsLog.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnOptionsLog.Name = "btnOptionsLog";
|
||||
btnOptionsLog.Size = new System.Drawing.Size(88, 27);
|
||||
btnOptionsLog.TabIndex = 68;
|
||||
btnOptionsLog.Text = "Logging...";
|
||||
btnOptionsLog.UseVisualStyleBackColor = true;
|
||||
btnOptionsLog.Click += btnOptionsLog_Click;
|
||||
//
|
||||
// btnOptionsAdvanced
|
||||
//
|
||||
btnOptionsAdvanced.Location = new System.Drawing.Point(7, 172);
|
||||
btnOptionsAdvanced.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnOptionsAdvanced.Name = "btnOptionsAdvanced";
|
||||
btnOptionsAdvanced.Size = new System.Drawing.Size(88, 27);
|
||||
btnOptionsAdvanced.TabIndex = 11;
|
||||
btnOptionsAdvanced.Text = "Advanced...";
|
||||
btnOptionsAdvanced.UseVisualStyleBackColor = true;
|
||||
btnOptionsAdvanced.Click += btnOptionsAdvanced_Click;
|
||||
//
|
||||
// chkOptionsUseDarkMode
|
||||
//
|
||||
chkOptionsUseDarkMode.AutoSize = true;
|
||||
chkOptionsUseDarkMode.Location = new System.Drawing.Point(216, 47);
|
||||
chkOptionsUseDarkMode.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
chkOptionsUseDarkMode.Name = "chkOptionsUseDarkMode";
|
||||
chkOptionsUseDarkMode.Size = new System.Drawing.Size(164, 19);
|
||||
chkOptionsUseDarkMode.TabIndex = 67;
|
||||
chkOptionsUseDarkMode.Text = "Dark Mode (experimental)";
|
||||
chkOptionsUseDarkMode.UseVisualStyleBackColor = true;
|
||||
chkOptionsUseDarkMode.CheckedChanged += chkOptionsUseDarkMode_CheckedChanged;
|
||||
//
|
||||
// chkAutoInstallUpdates
|
||||
//
|
||||
chkAutoInstallUpdates.AutoSize = true;
|
||||
chkAutoInstallUpdates.Location = new System.Drawing.Point(7, 147);
|
||||
chkAutoInstallUpdates.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
chkAutoInstallUpdates.Name = "chkAutoInstallUpdates";
|
||||
chkAutoInstallUpdates.Size = new System.Drawing.Size(179, 19);
|
||||
chkAutoInstallUpdates.TabIndex = 66;
|
||||
chkAutoInstallUpdates.Text = "Automatically install updates";
|
||||
chkAutoInstallUpdates.UseVisualStyleBackColor = true;
|
||||
chkAutoInstallUpdates.CheckedChanged += chkAutoInstallUpdates_CheckedChanged;
|
||||
//
|
||||
// btnStartStopService
|
||||
//
|
||||
btnStartStopService.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
btnStartStopService.Location = new System.Drawing.Point(614, 129);
|
||||
btnStartStopService.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnStartStopService.Name = "btnStartStopService";
|
||||
btnStartStopService.Size = new System.Drawing.Size(40, 27);
|
||||
btnStartStopService.TabIndex = 65;
|
||||
btnStartStopService.Text = "Start";
|
||||
btnStartStopService.UseVisualStyleBackColor = true;
|
||||
btnStartStopService.Click += btnStartStopService_Click;
|
||||
//
|
||||
// btnElevationInfo
|
||||
//
|
||||
btnElevationInfo.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
btnElevationInfo.Location = new System.Drawing.Point(329, 67);
|
||||
btnElevationInfo.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnElevationInfo.Name = "btnElevationInfo";
|
||||
btnElevationInfo.Size = new System.Drawing.Size(22, 27);
|
||||
btnElevationInfo.TabIndex = 64;
|
||||
btnElevationInfo.Text = "?";
|
||||
btnElevationInfo.UseVisualStyleBackColor = true;
|
||||
btnElevationInfo.Click += btnElevationInfo_Click;
|
||||
//
|
||||
// rbElevationService
|
||||
//
|
||||
rbElevationService.AutoSize = true;
|
||||
rbElevationService.Location = new System.Drawing.Point(216, 133);
|
||||
rbElevationService.Name = "rbElevationService";
|
||||
rbElevationService.Size = new System.Drawing.Size(136, 19);
|
||||
rbElevationService.TabIndex = 63;
|
||||
rbElevationService.TabStop = true;
|
||||
rbElevationService.Tag = "2";
|
||||
rbElevationService.Text = "Use Windows Service";
|
||||
rbElevationService.UseVisualStyleBackColor = true;
|
||||
rbElevationService.CheckedChanged += rbElevationNone_CheckedChanged;
|
||||
//
|
||||
// rbElevationProcess
|
||||
//
|
||||
rbElevationProcess.AutoSize = true;
|
||||
rbElevationProcess.Location = new System.Drawing.Point(216, 154);
|
||||
rbElevationProcess.Name = "rbElevationProcess";
|
||||
rbElevationProcess.Size = new System.Drawing.Size(189, 19);
|
||||
rbElevationProcess.TabIndex = 62;
|
||||
rbElevationProcess.TabStop = true;
|
||||
rbElevationProcess.Tag = "3";
|
||||
rbElevationProcess.Text = "Use dedicated elevated process";
|
||||
rbElevationProcess.UseVisualStyleBackColor = true;
|
||||
rbElevationProcess.CheckedChanged += rbElevationNone_CheckedChanged;
|
||||
//
|
||||
// rbElevationAdmin
|
||||
//
|
||||
rbElevationAdmin.AutoSize = true;
|
||||
rbElevationAdmin.Location = new System.Drawing.Point(216, 112);
|
||||
rbElevationAdmin.Name = "rbElevationAdmin";
|
||||
rbElevationAdmin.Size = new System.Drawing.Size(97, 19);
|
||||
rbElevationAdmin.TabIndex = 61;
|
||||
rbElevationAdmin.TabStop = true;
|
||||
rbElevationAdmin.Tag = "1";
|
||||
rbElevationAdmin.Text = "Run as admin";
|
||||
rbElevationAdmin.UseVisualStyleBackColor = true;
|
||||
rbElevationAdmin.CheckedChanged += rbElevationNone_CheckedChanged;
|
||||
//
|
||||
// label8
|
||||
//
|
||||
label8.AutoSize = true;
|
||||
label8.Location = new System.Drawing.Point(216, 73);
|
||||
label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
label8.Name = "label8";
|
||||
label8.Size = new System.Drawing.Size(105, 15);
|
||||
label8.TabIndex = 60;
|
||||
label8.Text = "Elevation-method:";
|
||||
//
|
||||
// rbElevationNone
|
||||
//
|
||||
rbElevationNone.AutoSize = true;
|
||||
rbElevationNone.Location = new System.Drawing.Point(216, 91);
|
||||
rbElevationNone.Name = "rbElevationNone";
|
||||
rbElevationNone.Size = new System.Drawing.Size(54, 19);
|
||||
rbElevationNone.TabIndex = 10;
|
||||
rbElevationNone.TabStop = true;
|
||||
rbElevationNone.Tag = "0";
|
||||
rbElevationNone.Text = "None";
|
||||
rbElevationNone.UseVisualStyleBackColor = true;
|
||||
rbElevationNone.CheckedChanged += rbElevationNone_CheckedChanged;
|
||||
//
|
||||
// chkGdiScaling
|
||||
//
|
||||
chkGdiScaling.AutoSize = true;
|
||||
chkGdiScaling.Location = new System.Drawing.Point(216, 22);
|
||||
chkGdiScaling.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
chkGdiScaling.Name = "chkGdiScaling";
|
||||
chkGdiScaling.Size = new System.Drawing.Size(197, 19);
|
||||
chkGdiScaling.TabIndex = 7;
|
||||
chkGdiScaling.Text = "Use GDI Scaling (requires restart)";
|
||||
chkGdiScaling.UseVisualStyleBackColor = true;
|
||||
chkGdiScaling.CheckedChanged += chkGdiScaling_CheckedChanged;
|
||||
//
|
||||
// chkCheckForUpdates
|
||||
//
|
||||
chkCheckForUpdates.AutoSize = true;
|
||||
chkCheckForUpdates.Location = new System.Drawing.Point(7, 122);
|
||||
chkCheckForUpdates.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
chkCheckForUpdates.Name = "chkCheckForUpdates";
|
||||
chkCheckForUpdates.Size = new System.Drawing.Size(197, 19);
|
||||
chkCheckForUpdates.TabIndex = 6;
|
||||
chkCheckForUpdates.Text = "Automatically check for updates";
|
||||
chkCheckForUpdates.UseVisualStyleBackColor = true;
|
||||
chkCheckForUpdates.CheckedChanged += chkCheckForUpdates_CheckedChanged;
|
||||
//
|
||||
// chkMinimizeToSystemTray
|
||||
//
|
||||
chkMinimizeToSystemTray.AutoSize = true;
|
||||
chkMinimizeToSystemTray.Location = new System.Drawing.Point(7, 97);
|
||||
chkMinimizeToSystemTray.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
chkMinimizeToSystemTray.Name = "chkMinimizeToSystemTray";
|
||||
chkMinimizeToSystemTray.Size = new System.Drawing.Size(152, 19);
|
||||
chkMinimizeToSystemTray.TabIndex = 5;
|
||||
chkMinimizeToSystemTray.Text = "Minimize to system tray";
|
||||
chkMinimizeToSystemTray.UseVisualStyleBackColor = true;
|
||||
chkMinimizeToSystemTray.CheckedChanged += chkMinimizeToSystemTray_CheckedChanged;
|
||||
//
|
||||
// chkMinimizeOnClose
|
||||
//
|
||||
chkMinimizeOnClose.AutoSize = true;
|
||||
chkMinimizeOnClose.Location = new System.Drawing.Point(7, 72);
|
||||
chkMinimizeOnClose.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
chkMinimizeOnClose.Name = "chkMinimizeOnClose";
|
||||
chkMinimizeOnClose.Size = new System.Drawing.Size(122, 19);
|
||||
chkMinimizeOnClose.TabIndex = 4;
|
||||
chkMinimizeOnClose.Text = "Minimize on close";
|
||||
chkMinimizeOnClose.UseVisualStyleBackColor = true;
|
||||
chkMinimizeOnClose.CheckedChanged += chkMinimizeOnClose_CheckedChanged;
|
||||
//
|
||||
// chkStartMinimized
|
||||
//
|
||||
chkStartMinimized.AutoSize = true;
|
||||
chkStartMinimized.Location = new System.Drawing.Point(7, 47);
|
||||
chkStartMinimized.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
chkStartMinimized.Name = "chkStartMinimized";
|
||||
chkStartMinimized.Size = new System.Drawing.Size(109, 19);
|
||||
chkStartMinimized.TabIndex = 3;
|
||||
chkStartMinimized.Text = "Start minimized";
|
||||
chkStartMinimized.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// chkStartAfterLogin
|
||||
//
|
||||
chkStartAfterLogin.AutoSize = true;
|
||||
chkStartAfterLogin.Location = new System.Drawing.Point(7, 22);
|
||||
chkStartAfterLogin.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
chkStartAfterLogin.Name = "chkStartAfterLogin";
|
||||
chkStartAfterLogin.Size = new System.Drawing.Size(183, 19);
|
||||
chkStartAfterLogin.TabIndex = 2;
|
||||
chkStartAfterLogin.Text = "Automatically start after login";
|
||||
chkStartAfterLogin.UseVisualStyleBackColor = true;
|
||||
chkStartAfterLogin.CheckedChanged += chkStartAfterLogin_CheckedChanged;
|
||||
//
|
||||
// tabInfo
|
||||
//
|
||||
tabInfo.Location = new System.Drawing.Point(4, 24);
|
||||
@@ -473,27 +88,6 @@
|
||||
btnUpdate.Visible = false;
|
||||
btnUpdate.Click += btnUpdate_Click;
|
||||
//
|
||||
// mnuColorProfiles
|
||||
//
|
||||
mnuColorProfiles.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
mnuColorProfiles.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { miCreateHDRColorProfile, miCreateSDRColorProfile });
|
||||
mnuColorProfiles.Name = "mnuLgButtons";
|
||||
mnuColorProfiles.Size = new System.Drawing.Size(214, 70);
|
||||
//
|
||||
// miCreateHDRColorProfile
|
||||
//
|
||||
miCreateHDRColorProfile.Name = "miCreateHDRColorProfile";
|
||||
miCreateHDRColorProfile.Size = new System.Drawing.Size(213, 22);
|
||||
miCreateHDRColorProfile.Text = "Create HDR Color Profile...";
|
||||
miCreateHDRColorProfile.Click += miCreateHDRColorProfile_Click;
|
||||
//
|
||||
// miCreateSDRColorProfile
|
||||
//
|
||||
miCreateSDRColorProfile.Name = "miCreateSDRColorProfile";
|
||||
miCreateSDRColorProfile.Size = new System.Drawing.Size(213, 22);
|
||||
miCreateSDRColorProfile.Text = "Create SDR Color Profile...";
|
||||
miCreateSDRColorProfile.Click += miCreateSDRColorProfile_Click;
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
@@ -518,13 +112,6 @@
|
||||
Resize += MainForm_Resize;
|
||||
tcMain.ResumeLayout(false);
|
||||
tabOptions.ResumeLayout(false);
|
||||
grpOptionsModules.ResumeLayout(false);
|
||||
grpOptionsModules.PerformLayout();
|
||||
grpMiscellaneousOptions.ResumeLayout(false);
|
||||
grpMiscellaneousOptions.PerformLayout();
|
||||
grpGeneralOptions.ResumeLayout(false);
|
||||
grpGeneralOptions.PerformLayout();
|
||||
mnuColorProfiles.ResumeLayout(false);
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
@@ -532,39 +119,8 @@
|
||||
|
||||
private System.Windows.Forms.TabControl tcMain;
|
||||
private System.Windows.Forms.TabPage tabOptions;
|
||||
private System.Windows.Forms.GroupBox grpGeneralOptions;
|
||||
private System.Windows.Forms.CheckBox chkStartMinimized;
|
||||
private System.Windows.Forms.CheckBox chkStartAfterLogin;
|
||||
private System.Windows.Forms.TabPage tabInfo;
|
||||
private System.Windows.Forms.GroupBox grpMiscellaneousOptions;
|
||||
private System.Windows.Forms.CheckBox chkFixChromeFonts;
|
||||
private System.Windows.Forms.Label lblFixChromeFontsDescription;
|
||||
private System.Windows.Forms.Button btnSetShortcutScreenSaver;
|
||||
private System.Windows.Forms.Label label11;
|
||||
private System.Windows.Forms.TextBox edtBlankScreenSaverShortcut;
|
||||
private System.Windows.Forms.CheckBox chkMinimizeOnClose;
|
||||
private System.Windows.Forms.CheckBox chkMinimizeToSystemTray;
|
||||
private System.Windows.Forms.CheckBox chkCheckForUpdates;
|
||||
private System.Windows.Forms.CheckBox chkGdiScaling;
|
||||
private System.Windows.Forms.RadioButton rbElevationService;
|
||||
private System.Windows.Forms.RadioButton rbElevationProcess;
|
||||
private System.Windows.Forms.RadioButton rbElevationAdmin;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.RadioButton rbElevationNone;
|
||||
private System.Windows.Forms.Button btnElevationInfo;
|
||||
private System.Windows.Forms.Button btnStartStopService;
|
||||
private System.Windows.Forms.CheckBox chkAutoInstallUpdates;
|
||||
private System.Windows.Forms.Button btnUpdate;
|
||||
private System.Windows.Forms.GroupBox grpOptionsModules;
|
||||
private System.Windows.Forms.CheckedListBox chkModules;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.CheckBox chkOptionsUseDarkMode;
|
||||
private System.Windows.Forms.Button btnOptionsAdvanced;
|
||||
private System.Windows.Forms.Button btnOptionsLog;
|
||||
private System.Windows.Forms.Button btnOptionsColorProfiles;
|
||||
private System.Windows.Forms.ContextMenuStrip mnuColorProfiles;
|
||||
private System.Windows.Forms.ToolStripMenuItem miCreateHDRColorProfile;
|
||||
private System.Windows.Forms.ToolStripMenuItem miCreateSDRColorProfile;
|
||||
}
|
||||
}
|
||||
|
||||
+22
-403
@@ -11,7 +11,6 @@ using ColorControl.Shared.Contracts;
|
||||
using ColorControl.Shared.Forms;
|
||||
using ColorControl.Shared.Native;
|
||||
using ColorControl.Shared.Services;
|
||||
using ColorControl.XForms;
|
||||
using Linearstar.Windows.RawInput;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using NLog;
|
||||
@@ -34,7 +33,7 @@ namespace ColorControl
|
||||
{
|
||||
private static bool SystemShutdown = false;
|
||||
private static bool EndSession = false;
|
||||
private static int SHORTCUTID_SCREENSAVER = -100;
|
||||
public static int SHORTCUTID_SCREENSAVER = -100;
|
||||
|
||||
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
||||
private readonly PowerEventDispatcher _powerEventDispatcher;
|
||||
@@ -42,11 +41,12 @@ namespace ColorControl
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
private readonly WinApiAdminService _winApiAdminService;
|
||||
private readonly WinApiService _winApiService;
|
||||
private readonly ElevationService _elevationService;
|
||||
private string _dataDir;
|
||||
|
||||
private NvPanel _nvPanel;
|
||||
|
||||
private NotifyIcon _trayIcon;
|
||||
public NotifyIcon _trayIcon;
|
||||
private bool _initialized = false;
|
||||
private Config _config;
|
||||
private bool _setVisibleCalled = false;
|
||||
@@ -78,7 +78,7 @@ namespace ColorControl
|
||||
private Dictionary<string, Func<UserControl>> _modules = new();
|
||||
|
||||
public MainForm(AppContextProvider appContextProvider, PowerEventDispatcher powerEventDispatcher, ServiceManager serviceManager,
|
||||
IServiceProvider serviceProvider, WinApiAdminService winApiAdminService, WinApiService winApiService)
|
||||
IServiceProvider serviceProvider, WinApiAdminService winApiAdminService, WinApiService winApiService, ElevationService elevationService)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
@@ -92,6 +92,7 @@ namespace ColorControl
|
||||
_serviceProvider = serviceProvider;
|
||||
_winApiAdminService = winApiAdminService;
|
||||
_winApiService = winApiService;
|
||||
_elevationService = elevationService;
|
||||
_dataDir = Program.DataDir;
|
||||
_config = Program.Config;
|
||||
|
||||
@@ -144,23 +145,15 @@ namespace ColorControl
|
||||
_trayIcon.ContextMenuStrip.Opened += trayIconContextMenu_Popup;
|
||||
_trayIcon.BalloonTipClicked += trayIconBalloonTip_Clicked;
|
||||
|
||||
chkStartAfterLogin.Checked = _winApiService.TaskExists(Program.TS_TASKNAME);
|
||||
|
||||
chkFixChromeFonts.Enabled = _winApiService.IsChromeInstalled();
|
||||
if (chkFixChromeFonts.Enabled)
|
||||
{
|
||||
var fixInstalled = _winApiService.IsChromeFixInstalled();
|
||||
if (_config.FixChromeFonts && !fixInstalled)
|
||||
{
|
||||
_winApiAdminService.InstallChromeFix(true, Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData));
|
||||
}
|
||||
chkFixChromeFonts.Checked = _winApiService.IsChromeFixInstalled();
|
||||
}
|
||||
|
||||
InitShortcut(SHORTCUTID_SCREENSAVER, _config.ScreenSaverShortcut, StartScreenSaver);
|
||||
|
||||
InitModules();
|
||||
UpdateServiceInfo();
|
||||
|
||||
// Auto-apply fix if desired but not currently installed
|
||||
if (_config.FixChromeFonts && _winApiService.IsChromeInstalled() && !_winApiService.IsChromeFixInstalled())
|
||||
{
|
||||
_winApiAdminService.InstallChromeFix(true, Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData));
|
||||
}
|
||||
|
||||
_screenStateNotify = WinApi.RegisterPowerSettingNotification(Handle, ref Utils.GUID_CONSOLE_DISPLAY_STATE, 0);
|
||||
|
||||
@@ -236,31 +229,6 @@ namespace ColorControl
|
||||
_serviceManager.NvService?.InstallEventHandlers();
|
||||
}
|
||||
|
||||
private void UpdateServiceInfo()
|
||||
{
|
||||
var text = "Use Windows Service";
|
||||
btnStartStopService.Enabled = true;
|
||||
|
||||
if (_winApiService.IsServiceRunning())
|
||||
{
|
||||
text += " (running)";
|
||||
btnStartStopService.Text = "Stop";
|
||||
}
|
||||
else if (_winApiService.IsServiceInstalled())
|
||||
{
|
||||
text += " (installed, not running)";
|
||||
btnStartStopService.Text = "Start";
|
||||
}
|
||||
else
|
||||
{
|
||||
text += " (not installed)";
|
||||
btnStartStopService.Text = "Start";
|
||||
btnStartStopService.Enabled = false;
|
||||
}
|
||||
|
||||
rbElevationService.Text = text;
|
||||
}
|
||||
|
||||
private UserControl InitNvService()
|
||||
{
|
||||
try
|
||||
@@ -577,11 +545,6 @@ namespace ColorControl
|
||||
Process.Start("explorer.exe", screenSaver);
|
||||
}
|
||||
|
||||
private void edtShortcut_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
((TextBox)sender).Text = KeyboardShortcutManager.FormatKeyboardShortcut(e);
|
||||
}
|
||||
|
||||
private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
|
||||
{
|
||||
// Hide tray icon, otherwise it will remain shown until user mouses over it
|
||||
@@ -615,34 +578,8 @@ namespace ColorControl
|
||||
}
|
||||
}
|
||||
|
||||
private void chkStartAfterLogin_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!_initialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var enabled = chkStartAfterLogin.Checked;
|
||||
RegisterScheduledTask(enabled);
|
||||
|
||||
rbElevationAdmin.Enabled = enabled;
|
||||
if (!enabled && rbElevationAdmin.Checked)
|
||||
{
|
||||
rbElevationNone.Checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadConfig()
|
||||
{
|
||||
chkStartMinimized.Checked = _config.StartMinimized;
|
||||
chkMinimizeOnClose.Checked = _config.MinimizeOnClose;
|
||||
chkMinimizeToSystemTray.Checked = _config.MinimizeToTray;
|
||||
chkCheckForUpdates.Checked = _config.CheckForUpdates;
|
||||
chkAutoInstallUpdates.Checked = _config.AutoInstallUpdates;
|
||||
chkAutoInstallUpdates.Enabled = _config.CheckForUpdates && _config.ElevationMethod == ElevationMethod.UseService;
|
||||
edtBlankScreenSaverShortcut.Text = _config.ScreenSaverShortcut;
|
||||
chkGdiScaling.Checked = _config.UseGdiScaling;
|
||||
chkOptionsUseDarkMode.Checked = _config.UseDarkMode;
|
||||
|
||||
_skipResize = true;
|
||||
try
|
||||
{
|
||||
@@ -657,7 +594,6 @@ namespace ColorControl
|
||||
|
||||
private void SaveConfig()
|
||||
{
|
||||
_config.StartMinimized = chkStartMinimized.Checked;
|
||||
if (WindowState != FormWindowState.Minimized)
|
||||
{
|
||||
_config.FormWidth = Width;
|
||||
@@ -710,7 +646,7 @@ Do you want to install and start the Windows Service now? You can always change
|
||||
NOTE: installing the service may cause a User Account Control popup.");
|
||||
if (result == DialogResult.Yes)
|
||||
{
|
||||
SetElevationMethod(ElevationMethod.UseService);
|
||||
_elevationService.SetElevationMethod(ElevationMethod.UseService);
|
||||
}
|
||||
|
||||
_config.ElevationMethodAsked = true;
|
||||
@@ -736,11 +672,6 @@ NOTE: installing the service may cause a User Account Control popup.");
|
||||
}
|
||||
}
|
||||
|
||||
private void edtShortcut_KeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
KeyboardShortcutManager.HandleKeyboardShortcutUp(e);
|
||||
}
|
||||
|
||||
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
InitSelectedTab();
|
||||
@@ -764,32 +695,17 @@ NOTE: installing the service may cause a User Account Control popup.");
|
||||
|
||||
private void InitOptionsTab()
|
||||
{
|
||||
if (chkModules.Items.Count == 0)
|
||||
if (tabInfo.Controls.Count > 0)
|
||||
{
|
||||
foreach (var module in _config.Modules)
|
||||
{
|
||||
chkModules.Items.Add(module.DisplayName, module.IsActive);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
_initialized = false;
|
||||
try
|
||||
{
|
||||
var _ = _config.ElevationMethod switch
|
||||
{
|
||||
ElevationMethod.None => rbElevationNone.Checked = true,
|
||||
ElevationMethod.RunAsAdmin => rbElevationAdmin.Checked = true,
|
||||
ElevationMethod.UseService => rbElevationService.Checked = true,
|
||||
ElevationMethod.UseElevatedProcess => rbElevationProcess.Checked = true,
|
||||
_ => false
|
||||
};
|
||||
}
|
||||
finally
|
||||
{
|
||||
_initialized = true;
|
||||
}
|
||||
var control = _serviceProvider.GetRequiredService<OptionsPanel>();
|
||||
control.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||
|
||||
UpdateServiceInfo();
|
||||
tabOptions.Controls.Add(control);
|
||||
|
||||
control.Size = tabInfo.ClientSize;
|
||||
}
|
||||
|
||||
private void InitInfoTab()
|
||||
@@ -811,7 +727,7 @@ NOTE: installing the service may cause a User Account Control popup.");
|
||||
{
|
||||
menu.DropDownItems.Clear();
|
||||
|
||||
foreach (var preset in presets)
|
||||
foreach (var preset in presets.OrderBy(p => p.name))
|
||||
{
|
||||
var name = preset.GetTextForMenuItem();
|
||||
var keys = Keys.None;
|
||||
@@ -859,7 +775,7 @@ NOTE: installing the service may cause a User Account Control popup.");
|
||||
_nvTrayMenu.Visible = _serviceManager.NvService != null;
|
||||
if (_nvTrayMenu.Visible)
|
||||
{
|
||||
var presets = _serviceManager.NvService.GetPresets().Where(x => x.applyColorData || x.applyDithering || x.applyHDR || x.applyRefreshRate || x.applyResolution || x.applyDriverSettings);
|
||||
var presets = _serviceManager.NvService.GetPresets().Where(x => x.applyColorData || x.applyDithering || x.applyHDR || x.applyRefreshRate || x.applyResolution || x.applyDriverSettings || x.applyOther || x.applyOverclocking || x.ApplyColorEnhancements || x.applyHdmiSettings);
|
||||
|
||||
UpdateTrayMenu(_nvTrayMenu, presets, TrayMenuItemNv_Click);
|
||||
}
|
||||
@@ -925,29 +841,6 @@ NOTE: installing the service may cause a User Account Control popup.");
|
||||
await _samsungPanel?.ApplyPreset(preset);
|
||||
}
|
||||
|
||||
private void btnRefreshNVIDIAInfo_Click(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
private void btnSetShortcutScreenSaver_Click(object sender, EventArgs e)
|
||||
{
|
||||
var shortcut = edtBlankScreenSaverShortcut.Text.Trim();
|
||||
|
||||
if (!KeyboardShortcutManager.ValidateShortcut(shortcut))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_config.ScreenSaverShortcut = shortcut;
|
||||
|
||||
KeyboardShortcutManager.RegisterShortcut(SHORTCUTID_SCREENSAVER, shortcut);
|
||||
}
|
||||
|
||||
private void chkMinimizeOnClose_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
_config.MinimizeOnClose = chkMinimizeOnClose.Checked;
|
||||
}
|
||||
|
||||
private void MainForm_Activated(object sender, EventArgs e)
|
||||
{
|
||||
if (tcMain.SelectedTab?.Controls.Count > 0 && tcMain.SelectedTab.Controls[0] is IModulePanel panel)
|
||||
@@ -1116,29 +1009,6 @@ NOTE: installing the service may cause a User Account Control popup.");
|
||||
(_serviceManager.LgService?.GetPresets().Any(x => x.id != presetId && shortcut.Equals(x.shortcut)) ?? false);
|
||||
}
|
||||
|
||||
private void chkMinimizeToSystemTray_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (_initialized)
|
||||
{
|
||||
_config.MinimizeToTray = chkMinimizeToSystemTray.Checked;
|
||||
_trayIcon.Visible = _config.MinimizeToTray;
|
||||
}
|
||||
}
|
||||
|
||||
private void chkCheckForUpdates_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (_initialized)
|
||||
{
|
||||
_config.CheckForUpdates = chkCheckForUpdates.Checked;
|
||||
chkAutoInstallUpdates.Enabled = _config.CheckForUpdates && _config.ElevationMethod == ElevationMethod.UseService;
|
||||
}
|
||||
}
|
||||
|
||||
private void chkGdiScaling_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
_config.UseGdiScaling = chkGdiScaling.Checked;
|
||||
}
|
||||
|
||||
private void MainForm_ResizeBegin(object sender, EventArgs e)
|
||||
{
|
||||
SuspendLayout();
|
||||
@@ -1149,143 +1019,6 @@ NOTE: installing the service may cause a User Account Control popup.");
|
||||
ResumeLayout(true);
|
||||
}
|
||||
|
||||
private void rbElevationNone_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!_initialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (sender is not RadioButton button || !button.Checked)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SetElevationMethod((ElevationMethod)Utils.ParseInt((string)button.Tag));
|
||||
}
|
||||
|
||||
private void SetElevationMethod(ElevationMethod elevationMethod)
|
||||
{
|
||||
_config.ElevationMethod = elevationMethod;
|
||||
|
||||
var _ = _config.ElevationMethod switch
|
||||
{
|
||||
ElevationMethod.None => SetElevationMethodNone(),
|
||||
ElevationMethod.RunAsAdmin => SetElevationMethodRunAsAdmin(),
|
||||
ElevationMethod.UseService => SetElevationMethodUseService(),
|
||||
ElevationMethod.UseElevatedProcess => SetElevationMethodUseElevatedProcess(),
|
||||
_ => true
|
||||
};
|
||||
|
||||
UpdateServiceInfo();
|
||||
}
|
||||
|
||||
private bool SetElevationMethodNone()
|
||||
{
|
||||
if (chkStartAfterLogin.Enabled)
|
||||
{
|
||||
RegisterScheduledTask();
|
||||
}
|
||||
|
||||
_winApiAdminService.UninstallService();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool SetElevationMethodRunAsAdmin()
|
||||
{
|
||||
if (chkStartAfterLogin.Enabled)
|
||||
{
|
||||
RegisterScheduledTask(false);
|
||||
RegisterScheduledTask();
|
||||
}
|
||||
|
||||
_winApiAdminService.UninstallService();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool SetElevationMethodUseService()
|
||||
{
|
||||
_winApiAdminService.InstallService();
|
||||
|
||||
if (_winApiService.IsServiceInstalled())
|
||||
{
|
||||
MessageForms.InfoOk("Service installed successfully.");
|
||||
return true;
|
||||
}
|
||||
|
||||
MessageForms.ErrorOk("Service could not be installed. Check the logs.");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool SetElevationMethodUseElevatedProcess()
|
||||
{
|
||||
if (chkStartAfterLogin.Enabled)
|
||||
{
|
||||
RegisterScheduledTask();
|
||||
}
|
||||
|
||||
_winApiAdminService.UninstallService();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void RegisterScheduledTask(bool enabled = true)
|
||||
{
|
||||
_winApiAdminService.RegisterTask(Program.TS_TASKNAME, enabled, _config.ElevationMethod == ElevationMethod.RunAsAdmin ? Microsoft.Win32.TaskScheduler.TaskRunLevel.Highest : Microsoft.Win32.TaskScheduler.TaskRunLevel.LUA);
|
||||
}
|
||||
|
||||
private void btnElevationInfo_Click(object sender, EventArgs e)
|
||||
{
|
||||
MessageForms.InfoOk(Utils.ELEVATION_MSG + @$"
|
||||
|
||||
NOTE: if ColorControl itself already runs as administrator this is indicated in the title: ColorControl {Application.ProductVersion} (administrator).
|
||||
|
||||
Currently ColorControl is {(_winApiService.IsAdministrator() ? "" : "not ")}running as administrator.
|
||||
");
|
||||
}
|
||||
|
||||
private async void btnStartStopService_Click(object sender, EventArgs e)
|
||||
{
|
||||
btnStartStopService.Enabled = false;
|
||||
try
|
||||
{
|
||||
var start = btnStartStopService.Text == "Start";
|
||||
|
||||
if (start)
|
||||
{
|
||||
_winApiAdminService.StartService();
|
||||
}
|
||||
else
|
||||
{
|
||||
_winApiAdminService.StopService();
|
||||
}
|
||||
|
||||
var wait = 1500;
|
||||
|
||||
while (wait > 0)
|
||||
{
|
||||
await Task.Delay(100);
|
||||
|
||||
if (start == _winApiService.IsServiceRunning())
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
wait -= 100;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
btnStartStopService.Enabled = true;
|
||||
}
|
||||
|
||||
UpdateServiceInfo();
|
||||
}
|
||||
|
||||
private async void MainForm_Click(object sender, EventArgs e)
|
||||
{
|
||||
//_powerEventDispatcher.SendEvent(PowerEventDispatcher.Event_Shutdown);
|
||||
@@ -1298,11 +1031,7 @@ Currently ColorControl is {(_winApiService.IsAdministrator() ? "" : "not ")}runn
|
||||
_serviceManager.NvService?.TestResolution();
|
||||
}
|
||||
|
||||
private async Task Test()
|
||||
{
|
||||
}
|
||||
|
||||
private void SetTheme(bool toDark)
|
||||
public void SetTheme(bool toDark)
|
||||
{
|
||||
this.UpdateTheme(toDark);
|
||||
|
||||
@@ -1315,14 +1044,6 @@ Currently ColorControl is {(_winApiService.IsAdministrator() ? "" : "not ")}runn
|
||||
InitSelectedTab();
|
||||
}
|
||||
|
||||
private void chkAutoInstallUpdates_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (_initialized)
|
||||
{
|
||||
_config.AutoInstallUpdates = chkAutoInstallUpdates.Checked;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (_downloadUrl != null)
|
||||
@@ -1341,18 +1062,6 @@ Currently ColorControl is {(_winApiService.IsAdministrator() ? "" : "not ")}runn
|
||||
_trayIcon.Visible = false;
|
||||
}
|
||||
|
||||
private void chkFixChromeFonts_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (_initialized)
|
||||
{
|
||||
_config.FixChromeFonts = chkFixChromeFonts.Checked;
|
||||
|
||||
var folder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
|
||||
|
||||
_winApiAdminService.InstallChromeFix(chkFixChromeFonts.Checked, folder);
|
||||
}
|
||||
}
|
||||
|
||||
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
|
||||
{
|
||||
if ((keyData == (Keys.Control | Keys.PageUp) || keyData == (Keys.Control | Keys.PageDown)) && IsShortcutControlFocused())
|
||||
@@ -1370,95 +1079,5 @@ Currently ColorControl is {(_winApiService.IsAdministrator() ? "" : "not ")}runn
|
||||
}
|
||||
return base.ProcessCmdKey(ref msg, keyData);
|
||||
}
|
||||
|
||||
private void chkOptionsUseDarkMode_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!_initialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_config.UseDarkMode = chkOptionsUseDarkMode.Checked;
|
||||
|
||||
SetTheme(_config.UseDarkMode);
|
||||
}
|
||||
|
||||
private void btnOptionsAdvanced_Click(object sender, EventArgs e)
|
||||
{
|
||||
var processPollingIntervalField = new FieldDefinition
|
||||
{
|
||||
FieldType = FieldType.Numeric,
|
||||
Label = "Polling interval of process monitor (milliseconds).",
|
||||
SubLabel = "Decreasing this delay may execute triggered presets sooner but can cause a higher CPU load",
|
||||
MinValue = 50,
|
||||
MaxValue = 5000,
|
||||
Value = _config.ProcessMonitorPollingInterval
|
||||
};
|
||||
var useRawInputField = new FieldDefinition
|
||||
{
|
||||
FieldType = FieldType.CheckBox,
|
||||
Label = "Use Raw Input for shortcuts (hot keys)",
|
||||
SubLabel = "This enables shortcuts to work during applications/games that block certain keys (like WinKey or Control). NOTE: if the application in the foreground runs with higher privileges than ColorControl, Raw Input does not work and normal hot keys are used",
|
||||
Value = _config.UseRawInput
|
||||
};
|
||||
var setMinTmlAndMaxTmlField = new FieldDefinition
|
||||
{
|
||||
FieldType = FieldType.CheckBox,
|
||||
Label = "Set MinTML and MaxTML when applying color profiles",
|
||||
SubLabel = "When this is enabled MinTML and MaxTML will be automatically be set to respectively the minimum luminance and the maximum luminance of the color profile",
|
||||
Value = _config.SetMinTmlAndMaxTml
|
||||
};
|
||||
|
||||
var values = MessageForms.ShowDialog("Advanced settings", new[] { processPollingIntervalField, useRawInputField, setMinTmlAndMaxTmlField });
|
||||
|
||||
if (values?.Any() != true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_config.ProcessMonitorPollingInterval = processPollingIntervalField.ValueAsInt;
|
||||
_config.UseRawInput = useRawInputField.ValueAsBool;
|
||||
_config.SetMinTmlAndMaxTml = setMinTmlAndMaxTmlField.ValueAsBool;
|
||||
|
||||
KeyboardShortcutManager.SetUseRawInput(_config.UseRawInput);
|
||||
}
|
||||
|
||||
private void btnOptionsLog_Click(object sender, EventArgs e)
|
||||
{
|
||||
LogWindow.CreateAndShow();
|
||||
}
|
||||
|
||||
private void chkModules_ItemCheck(object sender, ItemCheckEventArgs e)
|
||||
{
|
||||
if (chkModules.Items.Count != _config.Modules.Count)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var index = e.Index;
|
||||
|
||||
if (index < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var module = _config.Modules[index];
|
||||
module.IsActive = e.NewValue == CheckState.Checked;
|
||||
}
|
||||
|
||||
private void miCreateHDRColorProfile_Click(object sender, EventArgs e)
|
||||
{
|
||||
ColorProfileWindow.CreateAndShow();
|
||||
}
|
||||
|
||||
private void btnOptionsColorProfiles_Click(object sender, EventArgs e)
|
||||
{
|
||||
mnuColorProfiles.ShowCustom(btnOptionsColorProfiles);
|
||||
}
|
||||
|
||||
private void miCreateSDRColorProfile_Click(object sender, EventArgs e)
|
||||
{
|
||||
ColorProfileWindow.CreateAndShow(isHDR: false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -259,6 +259,8 @@ namespace ColorControl
|
||||
services.AddTransient<ColorProfileWindow>();
|
||||
services.AddSingleton<RestartDetector>();
|
||||
services.AddSingleton<InfoPanel>();
|
||||
services.AddSingleton<OptionsPanel>();
|
||||
services.AddSingleton<ElevationService>();
|
||||
});
|
||||
}
|
||||
private static async Task RunService(string[] args)
|
||||
@@ -335,5 +337,15 @@ namespace ColorControl
|
||||
|
||||
MessageBox.Show(message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
|
||||
internal static void SetTheme(bool useDarkMode)
|
||||
{
|
||||
_mainForm?.SetTheme(useDarkMode);
|
||||
}
|
||||
|
||||
internal static NotifyIcon GetNotifyIcon()
|
||||
{
|
||||
return _mainForm?._trayIcon;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
using ColorControl.Shared.Contracts;
|
||||
using ColorControl.Shared.Forms;
|
||||
using ColorControl.Shared.Services;
|
||||
|
||||
namespace ColorControl.Services.Common;
|
||||
|
||||
public class ElevationService
|
||||
{
|
||||
private readonly WinApiService _winApiService;
|
||||
private readonly WinApiAdminService _winApiAdminService;
|
||||
private readonly AppContextProvider _appContextProvider;
|
||||
|
||||
private readonly Config _config;
|
||||
|
||||
public ElevationService(WinApiService winApiService, WinApiAdminService winApiAdminService, AppContextProvider appContextProvider)
|
||||
{
|
||||
_winApiService = winApiService;
|
||||
_winApiAdminService = winApiAdminService;
|
||||
_appContextProvider = appContextProvider;
|
||||
|
||||
_config = appContextProvider.GetAppContext().Config;
|
||||
}
|
||||
|
||||
public void SetElevationMethod(ElevationMethod elevationMethod, bool startAfterLoginChecked = false)
|
||||
{
|
||||
_config.ElevationMethod = elevationMethod;
|
||||
|
||||
var _ = _config.ElevationMethod switch
|
||||
{
|
||||
ElevationMethod.None => SetElevationMethodNone(startAfterLoginChecked),
|
||||
ElevationMethod.RunAsAdmin => SetElevationMethodRunAsAdmin(startAfterLoginChecked),
|
||||
ElevationMethod.UseService => SetElevationMethodUseService(),
|
||||
ElevationMethod.UseElevatedProcess => SetElevationMethodUseElevatedProcess(startAfterLoginChecked),
|
||||
_ => true
|
||||
};
|
||||
}
|
||||
|
||||
public void RegisterScheduledTask(bool enabled = true)
|
||||
{
|
||||
_winApiAdminService.RegisterTask(Program.TS_TASKNAME, enabled, _config.ElevationMethod == ElevationMethod.RunAsAdmin ? Microsoft.Win32.TaskScheduler.TaskRunLevel.Highest : Microsoft.Win32.TaskScheduler.TaskRunLevel.LUA);
|
||||
}
|
||||
|
||||
private bool SetElevationMethodNone(bool startAfterLoginChecked = false)
|
||||
{
|
||||
if (startAfterLoginChecked)
|
||||
{
|
||||
RegisterScheduledTask();
|
||||
}
|
||||
|
||||
_winApiAdminService.UninstallService();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool SetElevationMethodRunAsAdmin(bool startAfterLoginChecked = false)
|
||||
{
|
||||
if (startAfterLoginChecked)
|
||||
{
|
||||
RegisterScheduledTask(false);
|
||||
RegisterScheduledTask();
|
||||
}
|
||||
|
||||
_winApiAdminService.UninstallService();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool SetElevationMethodUseService()
|
||||
{
|
||||
_winApiAdminService.InstallService();
|
||||
|
||||
if (_winApiService.IsServiceInstalled())
|
||||
{
|
||||
MessageForms.InfoOk("Service installed successfully.");
|
||||
return true;
|
||||
}
|
||||
|
||||
MessageForms.ErrorOk("Service could not be installed. Check the logs.");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool SetElevationMethodUseElevatedProcess(bool startAfterLoginChecked = false)
|
||||
{
|
||||
if (startAfterLoginChecked)
|
||||
{
|
||||
RegisterScheduledTask();
|
||||
}
|
||||
|
||||
_winApiAdminService.UninstallService();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -96,7 +96,7 @@ namespace ColorControl.Services.Common
|
||||
}
|
||||
else
|
||||
{
|
||||
active = context.Triggers.Contains(Trigger);
|
||||
active = active && context.Triggers.Contains(Trigger);
|
||||
}
|
||||
|
||||
return active;
|
||||
|
||||
@@ -38,6 +38,7 @@ namespace ColorControl.Services.LG
|
||||
public int Contrast { get; set; }
|
||||
public int Brightness { get; set; }
|
||||
public int Color { get; set; }
|
||||
public int Volume { get; set; }
|
||||
}
|
||||
|
||||
public enum PowerState
|
||||
@@ -199,7 +200,7 @@ namespace ColorControl.Services.LG
|
||||
AddGenericPictureAction("blackLevel", typeof(BlackLevel), title: "HDMI Black Level");
|
||||
AddGenericPictureAction("dolbyPrecisionDetail", typeof(OffToOn), title: "Dolby Precision Detail", fromModelYear: ModelYear.Series2022);
|
||||
|
||||
AddGenericPictureAction("ai_Brightness", typeof(OffToOn), title: "AI Brightness", fromModelYear: ModelYear.Series2021, category: "aiPicture");
|
||||
AddGenericPictureAction("ai_Brightness", typeof(OffToOn), title: "AI Brightness", fromModelYear: ModelYear.Series2019, category: "aiPicture");
|
||||
AddGenericPictureAction("ai_Genre", typeof(OffToOn), title: "AI Genre Selection", fromModelYear: ModelYear.Series2021, category: "aiPicture");
|
||||
AddGenericPictureAction("ai_Picture", typeof(OffToOn), title: "AI Picture Pro", fromModelYear: ModelYear.Series2021, category: "aiPicture");
|
||||
|
||||
@@ -225,6 +226,8 @@ namespace ColorControl.Services.LG
|
||||
AddGenericPictureAction("blackStabilizer", minValue: -30, maxValue: 30, category: "other", title: "Black Stabilizer", fromModelYear: ModelYear.Series2021);
|
||||
AddGenericPictureAction("whiteStabilizer", minValue: -30, maxValue: 30, category: "other", title: "White Stabilizer", fromModelYear: ModelYear.Series2021);
|
||||
AddGenericPictureAction("blueLight", typeof(BlueLight), category: "other", title: "Reduce Blue Light", fromModelYear: ModelYear.Series2021);
|
||||
AddGenericPictureAction("noiseReduction", typeof(OffToHigh), title: "Noise Reduction");
|
||||
AddGenericPictureAction("mpegNoiseReduction", typeof(OffToHigh), title: "MPEG Noise Reduction");
|
||||
|
||||
AddHdmiPictureAction("gameMode_hdmi", typeof(OffToOn), category: "other", title: "Game Optimizer HDMI1", fromModelYear: ModelYear.Series2021);
|
||||
AddGenericPictureAction("gameOptimization", typeof(OffToOn), category: "other", title: "VRR & G-Sync", fromModelYear: ModelYear.Series2021);
|
||||
@@ -262,6 +265,7 @@ namespace ColorControl.Services.LG
|
||||
AddSetDeviceConfigAction("HDMI_3_icon", typeof(HdmiIcon), "HDMI 3 icon");
|
||||
AddSetDeviceConfigAction("HDMI_4_icon", typeof(HdmiIcon), "HDMI 4 icon");
|
||||
|
||||
AddVolumeAction("audioVolume", "Volume");
|
||||
AddGenericPictureAction("soundMode", typeof(SoundMode), category: "sound", title: "Sound Mode");
|
||||
AddGenericPictureAction("smartSoundMode", typeof(OffToOn), category: "sound", title: "Adaptive Sound Control");
|
||||
AddGenericPictureAction("soundOutput", typeof(SoundOutput), category: "sound", title: "Sound Output");
|
||||
@@ -378,6 +382,22 @@ namespace ColorControl.Services.LG
|
||||
_invokableActions.Add(action);
|
||||
}
|
||||
|
||||
private void AddVolumeAction(string name, string title, ModelYear fromModelYear = ModelYear.None)
|
||||
{
|
||||
var action = new InvokableAction
|
||||
{
|
||||
Name = name,
|
||||
AsyncFunction = GenericVolumeAction,
|
||||
MinValue = 0,
|
||||
MaxValue = 100,
|
||||
Title = title == null ? Utils.FirstCharUpperCase(name) : title,
|
||||
Category = "sound",
|
||||
FromModelYear = fromModelYear
|
||||
};
|
||||
|
||||
_invokableActions.Add(action);
|
||||
}
|
||||
|
||||
public void AddGameBarAction(string name)
|
||||
{
|
||||
if (!ActionsOnGameBar.Contains(name))
|
||||
@@ -424,7 +444,7 @@ namespace ColorControl.Services.LG
|
||||
SetModelYear();
|
||||
}
|
||||
|
||||
//await _lgTvApi.SubscribeVolume(VolumeChanged);
|
||||
await _lgTvApi.SubscribeVolume(VolumeChanged);
|
||||
await _lgTvApi.SubscribePowerState(PowerStateChanged);
|
||||
await _lgTvApi.SubscribePictureSettings(PictureSettingsChanged);
|
||||
await _lgTvApi.SubscribeForegroundApp(ForegroundAppChanged);
|
||||
@@ -493,6 +513,20 @@ namespace ColorControl.Services.LG
|
||||
|
||||
public bool VolumeChanged(dynamic payload)
|
||||
{
|
||||
if (payload.volume != null)
|
||||
{
|
||||
PictureSettings.Volume = Utils.ParseDynamicAsInt(payload.volume, PictureSettings.Volume);
|
||||
}
|
||||
|
||||
var volumeAction = _invokableActions.FirstOrDefault(a => a.Name == "audioVolume");
|
||||
|
||||
if (volumeAction != null)
|
||||
{
|
||||
volumeAction.CurrentValue = PictureSettings.Volume;
|
||||
}
|
||||
|
||||
PictureSettingsChangedEvent?.Invoke(this, EventArgs.Empty);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -985,7 +1019,11 @@ namespace ColorControl.Services.LG
|
||||
public List<InvokableAction> GetInvokableActionsForGameBar()
|
||||
{
|
||||
var actions = GetInvokableActions();
|
||||
return actions.Where(a => a.Category == "picture" && (a.EnumType != null && a.EnumType != typeof(PictureMode) || a.MinValue >= 0 && a.MaxValue > 0)).ToList();
|
||||
return actions.Where(a =>
|
||||
a.Category == "picture" && (a.EnumType != null && a.EnumType != typeof(PictureMode) || a.MinValue >= 0 && a.MaxValue > 0) ||
|
||||
a.Name == "audioVolume"
|
||||
)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public List<InvokableAction> GetActionsForGameBar()
|
||||
@@ -1176,6 +1214,25 @@ namespace ColorControl.Services.LG
|
||||
return true;
|
||||
}
|
||||
|
||||
private async Task<bool> GenericVolumeAction(Dictionary<string, object> parameters)
|
||||
{
|
||||
await CheckConnectionAsync();
|
||||
|
||||
var values = parameters["value"] as object[];
|
||||
var value = values[0];
|
||||
|
||||
var volume = Utils.ParseInt(value.ToString(), 0);
|
||||
|
||||
await _lgTvApi.SetVolume(volume);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public Task SetVolume(int value)
|
||||
{
|
||||
return _lgTvApi.SetVolume(value);
|
||||
}
|
||||
|
||||
private void UpdateCurrentValueOfAction(string settingName, string value)
|
||||
{
|
||||
if (settingName == "backlight" || settingName == "contrast" || settingName == "brightness" || settingName == "color")
|
||||
|
||||
+80
-79
@@ -29,103 +29,104 @@ namespace ColorControl.Services.LG
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.flowPanel = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.btnClose = new System.Windows.Forms.Button();
|
||||
this.lblTvName = new System.Windows.Forms.Label();
|
||||
this.tmrHide = new System.Windows.Forms.Timer(this.components);
|
||||
this.lblProcessName = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
components = new System.ComponentModel.Container();
|
||||
flowPanel = new System.Windows.Forms.FlowLayoutPanel();
|
||||
btnClose = new System.Windows.Forms.Button();
|
||||
lblTvName = new System.Windows.Forms.Label();
|
||||
tmrHide = new System.Windows.Forms.Timer(components);
|
||||
lblProcessName = new System.Windows.Forms.Label();
|
||||
SuspendLayout();
|
||||
//
|
||||
// flowPanel
|
||||
//
|
||||
this.flowPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.flowPanel.Location = new System.Drawing.Point(14, 47);
|
||||
this.flowPanel.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
this.flowPanel.Name = "flowPanel";
|
||||
this.flowPanel.Size = new System.Drawing.Size(270, 325);
|
||||
this.flowPanel.TabIndex = 0;
|
||||
this.flowPanel.MouseDown += new System.Windows.Forms.MouseEventHandler(this.RemoteControlForm_MouseDown);
|
||||
this.flowPanel.MouseMove += new System.Windows.Forms.MouseEventHandler(this.flowPanel_MouseMove);
|
||||
this.flowPanel.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.flowPanel_PreviewKeyDown);
|
||||
flowPanel.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||
flowPanel.Location = new System.Drawing.Point(14, 47);
|
||||
flowPanel.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
flowPanel.Name = "flowPanel";
|
||||
flowPanel.Size = new System.Drawing.Size(270, 325);
|
||||
flowPanel.TabIndex = 0;
|
||||
flowPanel.MouseDown += RemoteControlForm_MouseDown;
|
||||
flowPanel.MouseEnter += flowPanel_MouseEnter;
|
||||
flowPanel.MouseMove += flowPanel_MouseMove;
|
||||
flowPanel.PreviewKeyDown += flowPanel_PreviewKeyDown;
|
||||
//
|
||||
// btnClose
|
||||
//
|
||||
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnClose.FlatAppearance.BorderColor = System.Drawing.Color.DarkGray;
|
||||
this.btnClose.FlatAppearance.BorderSize = 0;
|
||||
this.btnClose.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.btnClose.ForeColor = System.Drawing.Color.White;
|
||||
this.btnClose.Location = new System.Drawing.Point(280, 0);
|
||||
this.btnClose.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
this.btnClose.Name = "btnClose";
|
||||
this.btnClose.Size = new System.Drawing.Size(16, 27);
|
||||
this.btnClose.TabIndex = 1;
|
||||
this.btnClose.TabStop = false;
|
||||
this.btnClose.Text = "x";
|
||||
this.btnClose.UseVisualStyleBackColor = true;
|
||||
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
|
||||
btnClose.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
btnClose.FlatAppearance.BorderColor = System.Drawing.Color.DarkGray;
|
||||
btnClose.FlatAppearance.BorderSize = 0;
|
||||
btnClose.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
btnClose.ForeColor = System.Drawing.Color.White;
|
||||
btnClose.Location = new System.Drawing.Point(280, 0);
|
||||
btnClose.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnClose.Name = "btnClose";
|
||||
btnClose.Size = new System.Drawing.Size(16, 27);
|
||||
btnClose.TabIndex = 1;
|
||||
btnClose.TabStop = false;
|
||||
btnClose.Text = "x";
|
||||
btnClose.UseVisualStyleBackColor = true;
|
||||
btnClose.Click += btnClose_Click;
|
||||
//
|
||||
// lblTvName
|
||||
//
|
||||
this.lblTvName.AutoSize = true;
|
||||
this.lblTvName.ForeColor = System.Drawing.Color.White;
|
||||
this.lblTvName.Location = new System.Drawing.Point(14, 0);
|
||||
this.lblTvName.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.lblTvName.Name = "lblTvName";
|
||||
this.lblTvName.Size = new System.Drawing.Size(25, 15);
|
||||
this.lblTvName.TabIndex = 0;
|
||||
this.lblTvName.Text = " ";
|
||||
lblTvName.AutoSize = true;
|
||||
lblTvName.ForeColor = System.Drawing.Color.White;
|
||||
lblTvName.Location = new System.Drawing.Point(14, 0);
|
||||
lblTvName.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
lblTvName.Name = "lblTvName";
|
||||
lblTvName.Size = new System.Drawing.Size(25, 15);
|
||||
lblTvName.TabIndex = 0;
|
||||
lblTvName.Text = " ";
|
||||
//
|
||||
// tmrHide
|
||||
//
|
||||
this.tmrHide.Interval = 5000;
|
||||
this.tmrHide.Tick += new System.EventHandler(this.tmrHide_Tick);
|
||||
tmrHide.Interval = 5000;
|
||||
tmrHide.Tick += tmrHide_Tick;
|
||||
//
|
||||
// lblProcessName
|
||||
//
|
||||
this.lblProcessName.AutoSize = true;
|
||||
this.lblProcessName.ForeColor = System.Drawing.Color.White;
|
||||
this.lblProcessName.Location = new System.Drawing.Point(14, 23);
|
||||
this.lblProcessName.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.lblProcessName.Name = "lblProcessName";
|
||||
this.lblProcessName.Size = new System.Drawing.Size(25, 15);
|
||||
this.lblProcessName.TabIndex = 2;
|
||||
this.lblProcessName.Text = " ";
|
||||
lblProcessName.AutoSize = true;
|
||||
lblProcessName.ForeColor = System.Drawing.Color.White;
|
||||
lblProcessName.Location = new System.Drawing.Point(14, 23);
|
||||
lblProcessName.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
lblProcessName.Name = "lblProcessName";
|
||||
lblProcessName.Size = new System.Drawing.Size(25, 15);
|
||||
lblProcessName.TabIndex = 2;
|
||||
lblProcessName.Text = " ";
|
||||
//
|
||||
// LgGameBar
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.Black;
|
||||
this.ClientSize = new System.Drawing.Size(298, 387);
|
||||
this.Controls.Add(this.lblProcessName);
|
||||
this.Controls.Add(this.lblTvName);
|
||||
this.Controls.Add(this.btnClose);
|
||||
this.Controls.Add(this.flowPanel);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.KeyPreview = true;
|
||||
this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "LgGameBar";
|
||||
this.Opacity = 0.7D;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
|
||||
this.Text = "RemoteControlForm";
|
||||
this.TopMost = true;
|
||||
this.Activated += new System.EventHandler(this.LgGameBar_Activated);
|
||||
this.Deactivate += new System.EventHandler(this.LgGameBar_Deactivate);
|
||||
this.Load += new System.EventHandler(this.RemoteControlForm_Load);
|
||||
this.Shown += new System.EventHandler(this.RemoteControlForm_Shown);
|
||||
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.RemoteControlForm_KeyDown);
|
||||
this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.RemoteControlForm_KeyUp);
|
||||
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.RemoteControlForm_MouseDown);
|
||||
this.Move += new System.EventHandler(this.LgGameBar_Move);
|
||||
this.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.RemoteControlForm_PreviewKeyDown);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
BackColor = System.Drawing.Color.Black;
|
||||
ClientSize = new System.Drawing.Size(298, 387);
|
||||
Controls.Add(lblProcessName);
|
||||
Controls.Add(lblTvName);
|
||||
Controls.Add(btnClose);
|
||||
Controls.Add(flowPanel);
|
||||
FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
KeyPreview = true;
|
||||
Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
MaximizeBox = false;
|
||||
MinimizeBox = false;
|
||||
Name = "LgGameBar";
|
||||
Opacity = 0.7D;
|
||||
StartPosition = System.Windows.Forms.FormStartPosition.Manual;
|
||||
Text = "RemoteControlForm";
|
||||
TopMost = true;
|
||||
Activated += LgGameBar_Activated;
|
||||
Deactivate += LgGameBar_Deactivate;
|
||||
Load += RemoteControlForm_Load;
|
||||
Shown += RemoteControlForm_Shown;
|
||||
KeyDown += RemoteControlForm_KeyDown;
|
||||
KeyUp += RemoteControlForm_KeyUp;
|
||||
MouseDown += RemoteControlForm_MouseDown;
|
||||
MouseEnter += LgGameBar_MouseEnter;
|
||||
MouseLeave += LgGameBar_MouseLeave;
|
||||
Move += LgGameBar_Move;
|
||||
PreviewKeyDown += RemoteControlForm_PreviewKeyDown;
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace ColorControl.Services.LG
|
||||
private LgDevice _lgDevice;
|
||||
private ToolTip _toolTip;
|
||||
private bool _settingChanged = false;
|
||||
private bool _mouseHovering = false;
|
||||
private List<TrackBar> _trackBars = new List<TrackBar>();
|
||||
private List<string> _lastActions = new List<string>();
|
||||
|
||||
@@ -279,6 +280,12 @@ namespace ColorControl.Services.LG
|
||||
{
|
||||
_lgService.Config.GameBarLeft = Left;
|
||||
_lgService.Config.GameBarTop = Top;
|
||||
|
||||
if (_mouseHovering)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Hide();
|
||||
}
|
||||
|
||||
@@ -301,7 +308,18 @@ namespace ColorControl.Services.LG
|
||||
value = enumValue.ToString();
|
||||
}
|
||||
|
||||
await _lgDevice.SetSystemSettings(setting.Name, value);
|
||||
try
|
||||
{
|
||||
if (setting.Name == "audioVolume")
|
||||
{
|
||||
await _lgDevice.SetVolume(Utils.ParseInt(value));
|
||||
}
|
||||
else
|
||||
{
|
||||
await _lgDevice.SetSystemSettings(setting.Name, value);
|
||||
}
|
||||
}
|
||||
catch (Exception) { }
|
||||
|
||||
if (_toolTip != null)
|
||||
{
|
||||
@@ -324,7 +342,23 @@ namespace ColorControl.Services.LG
|
||||
private void ResetAutoHide()
|
||||
{
|
||||
tmrHide.Enabled = false;
|
||||
tmrHide.Interval = _lgService.Config.GameBarShowingTime;
|
||||
tmrHide.Enabled = true;
|
||||
}
|
||||
|
||||
private void LgGameBar_MouseEnter(object sender, EventArgs e)
|
||||
{
|
||||
_mouseHovering = true;
|
||||
}
|
||||
|
||||
private void LgGameBar_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
_mouseHovering = false;
|
||||
}
|
||||
|
||||
private void flowPanel_MouseEnter(object sender, EventArgs e)
|
||||
{
|
||||
_mouseHovering = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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">
|
||||
|
||||
@@ -1173,59 +1173,76 @@ Do you want to continue?";
|
||||
{
|
||||
var advancedWasEnabled = _lgService.Config.ShowAdvancedActions;
|
||||
|
||||
var retriesField = new FieldDefinition
|
||||
{
|
||||
FieldType = FieldType.Numeric,
|
||||
Label = "Maximum number of retries powering on after startup/resume.",
|
||||
SubLabel = "Retries are necessary to wait for the network link of your pc to be established.",
|
||||
MinValue = 1,
|
||||
MaxValue = 40,
|
||||
Value = _lgService.Config.PowerOnRetries
|
||||
};
|
||||
|
||||
var restartDelayField = new FieldDefinition
|
||||
{
|
||||
FieldType = FieldType.Numeric,
|
||||
Label = "Delay when shutting down/restarting PC (milliseconds).",
|
||||
SubLabel = "This delay may prevent the tv from powering off when restarting the pc.",
|
||||
MinValue = 0,
|
||||
MaxValue = 5000,
|
||||
Value = _lgService.Config.ShutdownDelay
|
||||
};
|
||||
|
||||
var quickAccessField = new FieldDefinition
|
||||
{
|
||||
FieldType = FieldType.Shortcut,
|
||||
Label = "Quick Access shortcut",
|
||||
Value = _lgService.Config.QuickAccessShortcut
|
||||
};
|
||||
|
||||
var gameBarShortcutField = new FieldDefinition
|
||||
{
|
||||
FieldType = FieldType.Shortcut,
|
||||
Label = "Game Bar shortcut",
|
||||
Value = _lgService.Config.GameBarShortcut
|
||||
};
|
||||
|
||||
var gameBarTimeoutField = new FieldDefinition
|
||||
{
|
||||
FieldType = FieldType.Numeric,
|
||||
Label = "Game Bar showing time (milliseconds)",
|
||||
MinValue = 1000,
|
||||
MaxValue = 60000,
|
||||
Value = _lgService.Config.GameBarShowingTime
|
||||
};
|
||||
|
||||
var advancedField = new FieldDefinition
|
||||
{
|
||||
FieldType = FieldType.CheckBox,
|
||||
Label = "Show advanced actions under the Expert-button (InStart, EzAdjust, Software Update)",
|
||||
Value = _lgService.Config.ShowAdvancedActions
|
||||
};
|
||||
|
||||
var setSelectedDeviceField = new FieldDefinition
|
||||
{
|
||||
FieldType = FieldType.CheckBox,
|
||||
Label = "Automatically set selected device to last powered on",
|
||||
Value = _lgService.Config.SetSelectedDeviceByPowerOn
|
||||
};
|
||||
|
||||
var buttonDelayField = new FieldDefinition
|
||||
{
|
||||
FieldType = FieldType.Numeric,
|
||||
Label = "Default delay between remote control button presses (milliseconds).",
|
||||
SubLabel = "Increasing this delay may prevent skipped button presses.",
|
||||
MinValue = 100,
|
||||
MaxValue = 2000,
|
||||
Value = _lgService.Config.DefaultButtonDelay
|
||||
};
|
||||
|
||||
var fields = new FieldDefinition[]
|
||||
{
|
||||
new()
|
||||
{
|
||||
FieldType = FieldType.Numeric,
|
||||
Label = "Maximum number of retries powering on after startup/resume.",
|
||||
SubLabel = "Retries are necessary to wait for the network link of your pc to be established.",
|
||||
MinValue = 1,
|
||||
MaxValue = 40,
|
||||
Value = _lgService.Config.PowerOnRetries
|
||||
},
|
||||
new()
|
||||
{
|
||||
FieldType = FieldType.Numeric,
|
||||
Label = "Delay when shutting down/restarting PC (milliseconds).",
|
||||
SubLabel = "This delay may prevent the tv from powering off when restarting the pc.",
|
||||
MinValue = 0,
|
||||
MaxValue = 5000,
|
||||
Value = _lgService.Config.ShutdownDelay
|
||||
},
|
||||
new()
|
||||
{
|
||||
FieldType = FieldType.Shortcut,
|
||||
Label = "Quick Access shortcut",
|
||||
Value = _lgService.Config.QuickAccessShortcut
|
||||
},
|
||||
new()
|
||||
{
|
||||
FieldType = FieldType.Shortcut,
|
||||
Label = "Game Bar shortcut",
|
||||
Value = _lgService.Config.GameBarShortcut
|
||||
},
|
||||
new()
|
||||
{
|
||||
FieldType = FieldType.CheckBox,
|
||||
Label = "Show advanced actions under the Expert-button (InStart, EzAdjust, Software Update)",
|
||||
Value = _lgService.Config.ShowAdvancedActions
|
||||
},
|
||||
new()
|
||||
{
|
||||
FieldType = FieldType.CheckBox,
|
||||
Label = "Automatically set selected device to last powered on",
|
||||
Value = _lgService.Config.SetSelectedDeviceByPowerOn
|
||||
},
|
||||
new()
|
||||
{
|
||||
FieldType = FieldType.Numeric,
|
||||
Label = "Default delay between remote control button presses (milliseconds).",
|
||||
SubLabel = "Increasing this delay may prevent skipped button presses.",
|
||||
MinValue = 100,
|
||||
MaxValue = 2000,
|
||||
Value = _lgService.Config.DefaultButtonDelay
|
||||
}
|
||||
retriesField, restartDelayField, quickAccessField, gameBarShortcutField, gameBarTimeoutField, advancedField, setSelectedDeviceField, buttonDelayField
|
||||
};
|
||||
|
||||
var values = MessageForms.ShowDialog("LG controller settings", fields);
|
||||
@@ -1235,17 +1252,18 @@ Do you want to continue?";
|
||||
return;
|
||||
}
|
||||
|
||||
_lgService.Config.PowerOnRetries = values[0].ValueAsInt;
|
||||
_lgService.Config.ShutdownDelay = values[1].ValueAsInt;
|
||||
_lgService.Config.PowerOnRetries = retriesField.ValueAsInt;
|
||||
_lgService.Config.ShutdownDelay = restartDelayField.ValueAsInt;
|
||||
|
||||
var shortcutQA = values[2].Value.ToString();
|
||||
var shortcutQA = quickAccessField.Value.ToString();
|
||||
|
||||
_lgService.Config.QuickAccessShortcut = shortcutQA;
|
||||
|
||||
KeyboardShortcutManager.RegisterShortcut(SHORTCUTID_LGQA, _lgService.Config.QuickAccessShortcut);
|
||||
|
||||
var shortcutGB = values[3].Value.ToString();
|
||||
var shortcutGB = gameBarShortcutField.Value.ToString();
|
||||
_lgService.Config.GameBarShortcut = shortcutGB;
|
||||
_lgService.Config.GameBarShowingTime = gameBarTimeoutField.ValueAsInt;
|
||||
|
||||
if (string.IsNullOrEmpty(shortcutGB))
|
||||
{
|
||||
@@ -1256,9 +1274,9 @@ Do you want to continue?";
|
||||
KeyboardShortcutManager.RegisterShortcut(SHORTCUTID_GAMEBAR, shortcutGB);
|
||||
}
|
||||
|
||||
_lgService.Config.ShowAdvancedActions = values[4].ValueAsBool;
|
||||
_lgService.Config.SetSelectedDeviceByPowerOn = values[5].ValueAsBool;
|
||||
_lgService.Config.DefaultButtonDelay = values[6].ValueAsInt;
|
||||
_lgService.Config.ShowAdvancedActions = advancedField.ValueAsBool;
|
||||
_lgService.Config.SetSelectedDeviceByPowerOn = setSelectedDeviceField.ValueAsBool;
|
||||
_lgService.Config.DefaultButtonDelay = buttonDelayField.ValueAsInt;
|
||||
|
||||
if (!advancedWasEnabled && _lgService.Config.ShowAdvancedActions)
|
||||
{
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace ColorControl.Services.LG
|
||||
public bool SetSelectedDeviceByPowerOn { get; set; }
|
||||
public string QuickAccessShortcut { get; set; }
|
||||
public int DefaultButtonDelay { get; set; }
|
||||
public int GameBarShowingTime { get; set; }
|
||||
|
||||
public LgServiceConfig()
|
||||
{
|
||||
@@ -30,6 +31,7 @@ namespace ColorControl.Services.LG
|
||||
GameBarTop = 100;
|
||||
GameBarLeft = 100;
|
||||
DefaultButtonDelay = 200;
|
||||
GameBarShowingTime = 5000;
|
||||
}
|
||||
}
|
||||
}
|
||||
+146
-109
@@ -28,145 +28,179 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.grpNvidiaOptions = new System.Windows.Forms.GroupBox();
|
||||
this.lblDitheringDisplay = new System.Windows.Forms.Label();
|
||||
this.cbxDitheringDisplay = new System.Windows.Forms.ComboBox();
|
||||
this.lblDitheringMode = new System.Windows.Forms.Label();
|
||||
this.cbxDitheringMode = new System.Windows.Forms.ComboBox();
|
||||
this.lblDitheringBitDepth = new System.Windows.Forms.Label();
|
||||
this.cbxDitheringBitDepth = new System.Windows.Forms.ComboBox();
|
||||
this.chkDitheringEnabled = new System.Windows.Forms.CheckBox();
|
||||
this.pbGradient = new System.Windows.Forms.PictureBox();
|
||||
this.grpNvidiaOptions.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pbGradient)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NvDitherPanel));
|
||||
grpNvidiaOptions = new System.Windows.Forms.GroupBox();
|
||||
btnSetRegistryKey = new System.Windows.Forms.Button();
|
||||
btnRestartDriver = new System.Windows.Forms.Button();
|
||||
lblDitherRegistry = new System.Windows.Forms.Label();
|
||||
lblDitheringDisplay = new System.Windows.Forms.Label();
|
||||
cbxDitheringDisplay = new System.Windows.Forms.ComboBox();
|
||||
lblDitheringMode = new System.Windows.Forms.Label();
|
||||
cbxDitheringMode = new System.Windows.Forms.ComboBox();
|
||||
lblDitheringBitDepth = new System.Windows.Forms.Label();
|
||||
cbxDitheringBitDepth = new System.Windows.Forms.ComboBox();
|
||||
chkDitheringEnabled = new System.Windows.Forms.CheckBox();
|
||||
pbGradient = new System.Windows.Forms.PictureBox();
|
||||
grpNvidiaOptions.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)pbGradient).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// grpNvidiaOptions
|
||||
//
|
||||
this.grpNvidiaOptions.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.grpNvidiaOptions.Controls.Add(this.lblDitheringDisplay);
|
||||
this.grpNvidiaOptions.Controls.Add(this.cbxDitheringDisplay);
|
||||
this.grpNvidiaOptions.Controls.Add(this.lblDitheringMode);
|
||||
this.grpNvidiaOptions.Controls.Add(this.cbxDitheringMode);
|
||||
this.grpNvidiaOptions.Controls.Add(this.lblDitheringBitDepth);
|
||||
this.grpNvidiaOptions.Controls.Add(this.cbxDitheringBitDepth);
|
||||
this.grpNvidiaOptions.Controls.Add(this.chkDitheringEnabled);
|
||||
this.grpNvidiaOptions.Controls.Add(this.pbGradient);
|
||||
this.grpNvidiaOptions.Location = new System.Drawing.Point(4, 3);
|
||||
this.grpNvidiaOptions.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
this.grpNvidiaOptions.Name = "grpNvidiaOptions";
|
||||
this.grpNvidiaOptions.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
this.grpNvidiaOptions.Size = new System.Drawing.Size(856, 479);
|
||||
this.grpNvidiaOptions.TabIndex = 6;
|
||||
this.grpNvidiaOptions.TabStop = false;
|
||||
this.grpNvidiaOptions.Text = "NVIDIA options - test dithering";
|
||||
grpNvidiaOptions.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||
grpNvidiaOptions.Controls.Add(btnSetRegistryKey);
|
||||
grpNvidiaOptions.Controls.Add(btnRestartDriver);
|
||||
grpNvidiaOptions.Controls.Add(lblDitherRegistry);
|
||||
grpNvidiaOptions.Controls.Add(lblDitheringDisplay);
|
||||
grpNvidiaOptions.Controls.Add(cbxDitheringDisplay);
|
||||
grpNvidiaOptions.Controls.Add(lblDitheringMode);
|
||||
grpNvidiaOptions.Controls.Add(cbxDitheringMode);
|
||||
grpNvidiaOptions.Controls.Add(lblDitheringBitDepth);
|
||||
grpNvidiaOptions.Controls.Add(cbxDitheringBitDepth);
|
||||
grpNvidiaOptions.Controls.Add(chkDitheringEnabled);
|
||||
grpNvidiaOptions.Controls.Add(pbGradient);
|
||||
grpNvidiaOptions.Location = new System.Drawing.Point(4, 3);
|
||||
grpNvidiaOptions.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
grpNvidiaOptions.MinimumSize = new System.Drawing.Size(300, 100);
|
||||
grpNvidiaOptions.Name = "grpNvidiaOptions";
|
||||
grpNvidiaOptions.Padding = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
grpNvidiaOptions.Size = new System.Drawing.Size(856, 479);
|
||||
grpNvidiaOptions.TabIndex = 6;
|
||||
grpNvidiaOptions.TabStop = false;
|
||||
grpNvidiaOptions.Text = "NVIDIA options - test dithering";
|
||||
//
|
||||
// btnSetRegistryKey
|
||||
//
|
||||
btnSetRegistryKey.Location = new System.Drawing.Point(381, 17);
|
||||
btnSetRegistryKey.Name = "btnSetRegistryKey";
|
||||
btnSetRegistryKey.Size = new System.Drawing.Size(150, 23);
|
||||
btnSetRegistryKey.TabIndex = 13;
|
||||
btnSetRegistryKey.Text = "Set dither registry key";
|
||||
btnSetRegistryKey.UseVisualStyleBackColor = true;
|
||||
btnSetRegistryKey.Click += btnSetRegistryKey_Click;
|
||||
//
|
||||
// btnRestartDriver
|
||||
//
|
||||
btnRestartDriver.Location = new System.Drawing.Point(539, 16);
|
||||
btnRestartDriver.Name = "btnRestartDriver";
|
||||
btnRestartDriver.Size = new System.Drawing.Size(150, 23);
|
||||
btnRestartDriver.TabIndex = 12;
|
||||
btnRestartDriver.Text = "Restart driver";
|
||||
btnRestartDriver.UseVisualStyleBackColor = true;
|
||||
btnRestartDriver.Click += btnRestartDriver_Click;
|
||||
//
|
||||
// lblDitherRegistry
|
||||
//
|
||||
lblDitherRegistry.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||
lblDitherRegistry.Location = new System.Drawing.Point(381, 47);
|
||||
lblDitherRegistry.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
lblDitherRegistry.Name = "lblDitherRegistry";
|
||||
lblDitherRegistry.Size = new System.Drawing.Size(467, 78);
|
||||
lblDitherRegistry.TabIndex = 11;
|
||||
lblDitherRegistry.Text = resources.GetString("lblDitherRegistry.Text");
|
||||
//
|
||||
// lblDitheringDisplay
|
||||
//
|
||||
this.lblDitheringDisplay.AutoSize = true;
|
||||
this.lblDitheringDisplay.Location = new System.Drawing.Point(8, 23);
|
||||
this.lblDitheringDisplay.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.lblDitheringDisplay.Name = "lblDitheringDisplay";
|
||||
this.lblDitheringDisplay.Size = new System.Drawing.Size(48, 15);
|
||||
this.lblDitheringDisplay.TabIndex = 9;
|
||||
this.lblDitheringDisplay.Text = "Display:";
|
||||
lblDitheringDisplay.AutoSize = true;
|
||||
lblDitheringDisplay.Location = new System.Drawing.Point(8, 23);
|
||||
lblDitheringDisplay.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
lblDitheringDisplay.Name = "lblDitheringDisplay";
|
||||
lblDitheringDisplay.Size = new System.Drawing.Size(48, 15);
|
||||
lblDitheringDisplay.TabIndex = 9;
|
||||
lblDitheringDisplay.Text = "Display:";
|
||||
//
|
||||
// cbxDitheringDisplay
|
||||
//
|
||||
this.cbxDitheringDisplay.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbxDitheringDisplay.FormattingEnabled = true;
|
||||
this.cbxDitheringDisplay.Location = new System.Drawing.Point(75, 17);
|
||||
this.cbxDitheringDisplay.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
this.cbxDitheringDisplay.Name = "cbxDitheringDisplay";
|
||||
this.cbxDitheringDisplay.Size = new System.Drawing.Size(212, 23);
|
||||
this.cbxDitheringDisplay.TabIndex = 8;
|
||||
this.cbxDitheringDisplay.SelectedIndexChanged += new System.EventHandler(this.cbxDitheringDisplay_SelectedIndexChanged);
|
||||
cbxDitheringDisplay.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
cbxDitheringDisplay.DropDownWidth = 300;
|
||||
cbxDitheringDisplay.FormattingEnabled = true;
|
||||
cbxDitheringDisplay.Location = new System.Drawing.Point(75, 17);
|
||||
cbxDitheringDisplay.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
cbxDitheringDisplay.Name = "cbxDitheringDisplay";
|
||||
cbxDitheringDisplay.Size = new System.Drawing.Size(298, 23);
|
||||
cbxDitheringDisplay.TabIndex = 8;
|
||||
cbxDitheringDisplay.SelectedIndexChanged += cbxDitheringDisplay_SelectedIndexChanged;
|
||||
//
|
||||
// lblDitheringMode
|
||||
//
|
||||
this.lblDitheringMode.AutoSize = true;
|
||||
this.lblDitheringMode.Location = new System.Drawing.Point(8, 105);
|
||||
this.lblDitheringMode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.lblDitheringMode.Name = "lblDitheringMode";
|
||||
this.lblDitheringMode.Size = new System.Drawing.Size(41, 15);
|
||||
this.lblDitheringMode.TabIndex = 7;
|
||||
this.lblDitheringMode.Text = "Mode:";
|
||||
lblDitheringMode.AutoSize = true;
|
||||
lblDitheringMode.Location = new System.Drawing.Point(8, 105);
|
||||
lblDitheringMode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
lblDitheringMode.Name = "lblDitheringMode";
|
||||
lblDitheringMode.Size = new System.Drawing.Size(41, 15);
|
||||
lblDitheringMode.TabIndex = 7;
|
||||
lblDitheringMode.Text = "Mode:";
|
||||
//
|
||||
// cbxDitheringMode
|
||||
//
|
||||
this.cbxDitheringMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbxDitheringMode.FormattingEnabled = true;
|
||||
this.cbxDitheringMode.Location = new System.Drawing.Point(75, 99);
|
||||
this.cbxDitheringMode.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
this.cbxDitheringMode.Name = "cbxDitheringMode";
|
||||
this.cbxDitheringMode.Size = new System.Drawing.Size(136, 23);
|
||||
this.cbxDitheringMode.TabIndex = 6;
|
||||
this.cbxDitheringMode.SelectedIndexChanged += new System.EventHandler(this.cbxDitheringMode_SelectedIndexChanged);
|
||||
cbxDitheringMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
cbxDitheringMode.FormattingEnabled = true;
|
||||
cbxDitheringMode.Location = new System.Drawing.Point(75, 99);
|
||||
cbxDitheringMode.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
cbxDitheringMode.Name = "cbxDitheringMode";
|
||||
cbxDitheringMode.Size = new System.Drawing.Size(136, 23);
|
||||
cbxDitheringMode.TabIndex = 6;
|
||||
cbxDitheringMode.SelectedIndexChanged += cbxDitheringMode_SelectedIndexChanged;
|
||||
//
|
||||
// lblDitheringBitDepth
|
||||
//
|
||||
this.lblDitheringBitDepth.AutoSize = true;
|
||||
this.lblDitheringBitDepth.Location = new System.Drawing.Point(8, 74);
|
||||
this.lblDitheringBitDepth.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.lblDitheringBitDepth.Name = "lblDitheringBitDepth";
|
||||
this.lblDitheringBitDepth.Size = new System.Drawing.Size(60, 15);
|
||||
this.lblDitheringBitDepth.TabIndex = 5;
|
||||
this.lblDitheringBitDepth.Text = "Bit-depth:";
|
||||
lblDitheringBitDepth.AutoSize = true;
|
||||
lblDitheringBitDepth.Location = new System.Drawing.Point(8, 74);
|
||||
lblDitheringBitDepth.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
lblDitheringBitDepth.Name = "lblDitheringBitDepth";
|
||||
lblDitheringBitDepth.Size = new System.Drawing.Size(60, 15);
|
||||
lblDitheringBitDepth.TabIndex = 5;
|
||||
lblDitheringBitDepth.Text = "Bit-depth:";
|
||||
//
|
||||
// cbxDitheringBitDepth
|
||||
//
|
||||
this.cbxDitheringBitDepth.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbxDitheringBitDepth.FormattingEnabled = true;
|
||||
this.cbxDitheringBitDepth.Location = new System.Drawing.Point(75, 68);
|
||||
this.cbxDitheringBitDepth.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
this.cbxDitheringBitDepth.Name = "cbxDitheringBitDepth";
|
||||
this.cbxDitheringBitDepth.Size = new System.Drawing.Size(136, 23);
|
||||
this.cbxDitheringBitDepth.TabIndex = 4;
|
||||
this.cbxDitheringBitDepth.SelectedIndexChanged += new System.EventHandler(this.cbxDitheringBitDepth_SelectedIndexChanged);
|
||||
cbxDitheringBitDepth.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
cbxDitheringBitDepth.FormattingEnabled = true;
|
||||
cbxDitheringBitDepth.Location = new System.Drawing.Point(75, 68);
|
||||
cbxDitheringBitDepth.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
cbxDitheringBitDepth.Name = "cbxDitheringBitDepth";
|
||||
cbxDitheringBitDepth.Size = new System.Drawing.Size(136, 23);
|
||||
cbxDitheringBitDepth.TabIndex = 4;
|
||||
cbxDitheringBitDepth.SelectedIndexChanged += cbxDitheringBitDepth_SelectedIndexChanged;
|
||||
//
|
||||
// chkDitheringEnabled
|
||||
//
|
||||
this.chkDitheringEnabled.AutoSize = true;
|
||||
this.chkDitheringEnabled.Checked = true;
|
||||
this.chkDitheringEnabled.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.chkDitheringEnabled.Location = new System.Drawing.Point(8, 46);
|
||||
this.chkDitheringEnabled.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
this.chkDitheringEnabled.Name = "chkDitheringEnabled";
|
||||
this.chkDitheringEnabled.Size = new System.Drawing.Size(120, 19);
|
||||
this.chkDitheringEnabled.TabIndex = 3;
|
||||
this.chkDitheringEnabled.Text = "Dithering enabled";
|
||||
this.chkDitheringEnabled.ThreeState = true;
|
||||
this.chkDitheringEnabled.UseVisualStyleBackColor = true;
|
||||
this.chkDitheringEnabled.CheckStateChanged += new System.EventHandler(this.chkDitheringEnabled_CheckStateChanged);
|
||||
chkDitheringEnabled.AutoSize = true;
|
||||
chkDitheringEnabled.Checked = true;
|
||||
chkDitheringEnabled.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
chkDitheringEnabled.Location = new System.Drawing.Point(8, 46);
|
||||
chkDitheringEnabled.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
chkDitheringEnabled.Name = "chkDitheringEnabled";
|
||||
chkDitheringEnabled.Size = new System.Drawing.Size(120, 19);
|
||||
chkDitheringEnabled.TabIndex = 3;
|
||||
chkDitheringEnabled.Text = "Dithering enabled";
|
||||
chkDitheringEnabled.ThreeState = true;
|
||||
chkDitheringEnabled.UseVisualStyleBackColor = true;
|
||||
chkDitheringEnabled.CheckStateChanged += chkDitheringEnabled_CheckStateChanged;
|
||||
//
|
||||
// pbGradient
|
||||
//
|
||||
this.pbGradient.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.pbGradient.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.pbGradient.Location = new System.Drawing.Point(8, 128);
|
||||
this.pbGradient.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
this.pbGradient.Name = "pbGradient";
|
||||
this.pbGradient.Size = new System.Drawing.Size(840, 345);
|
||||
this.pbGradient.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||
this.pbGradient.TabIndex = 0;
|
||||
this.pbGradient.TabStop = false;
|
||||
pbGradient.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||
pbGradient.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
pbGradient.Location = new System.Drawing.Point(8, 128);
|
||||
pbGradient.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
pbGradient.Name = "pbGradient";
|
||||
pbGradient.Size = new System.Drawing.Size(840, 345);
|
||||
pbGradient.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||
pbGradient.TabIndex = 0;
|
||||
pbGradient.TabStop = false;
|
||||
//
|
||||
// NvDitherPanel
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.grpNvidiaOptions);
|
||||
this.Name = "NvDitherPanel";
|
||||
this.Size = new System.Drawing.Size(864, 485);
|
||||
this.grpNvidiaOptions.ResumeLayout(false);
|
||||
this.grpNvidiaOptions.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pbGradient)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
Controls.Add(grpNvidiaOptions);
|
||||
Name = "NvDitherPanel";
|
||||
Size = new System.Drawing.Size(864, 485);
|
||||
grpNvidiaOptions.ResumeLayout(false);
|
||||
grpNvidiaOptions.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)pbGradient).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -180,5 +214,8 @@
|
||||
private System.Windows.Forms.CheckBox chkDitheringEnabled;
|
||||
private System.Windows.Forms.Label lblDitheringDisplay;
|
||||
private System.Windows.Forms.ComboBox cbxDitheringDisplay;
|
||||
private System.Windows.Forms.Label lblDitherRegistry;
|
||||
private System.Windows.Forms.Button btnRestartDriver;
|
||||
private System.Windows.Forms.Button btnSetRegistryKey;
|
||||
}
|
||||
}
|
||||
@@ -93,11 +93,11 @@ namespace ColorControl.Services.NVIDIA
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplyDitheringOptions()
|
||||
private bool ApplyDitheringOptions(bool setRegistry = false, bool restartDriver = false)
|
||||
{
|
||||
if (_updatingDitherSettings)
|
||||
{
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
var state = chkDitheringEnabled.CheckState switch { CheckState.Checked => NvDitherState.Enabled, CheckState.Unchecked => NvDitherState.Disabled, _ => NvDitherState.Auto };
|
||||
@@ -105,10 +105,14 @@ namespace ColorControl.Services.NVIDIA
|
||||
var mode = cbxDitheringMode.SelectedIndex;
|
||||
var display = ((NvDisplayInfo)cbxDitheringDisplay.SelectedItem)?.Display;
|
||||
|
||||
if (_nvService.SetDithering(state, (uint)bitDepth, (uint)(mode > -1 ? mode : (int)NvDitherMode.Temporal), currentDisplay: display) && state == NvDitherState.Auto)
|
||||
var result = _nvService.SetDithering(state, (uint)bitDepth, (uint)(mode > -1 ? mode : (int)NvDitherMode.Temporal), currentDisplay: display, setRegistryKey: setRegistry, restartDriver: restartDriver);
|
||||
|
||||
if (result && state == NvDitherState.Auto)
|
||||
{
|
||||
UpdateDitherSettings();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private void cbxDitheringBitDepth_SelectedIndexChanged(object sender, EventArgs e)
|
||||
@@ -144,5 +148,22 @@ namespace ColorControl.Services.NVIDIA
|
||||
RefreshDisplays();
|
||||
UpdateDitherSettings();
|
||||
}
|
||||
|
||||
private void btnRestartDriver_Click(object sender, EventArgs e)
|
||||
{
|
||||
_nvService.RestartDriver();
|
||||
}
|
||||
|
||||
private void btnSetRegistryKey_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (ApplyDitheringOptions(true))
|
||||
{
|
||||
MessageForms.InfoOk("Dither settings successfully written to the registry.");
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageForms.ErrorOk("There was an error writing the dither settings to the registry. See the log for more details.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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">
|
||||
@@ -57,4 +117,7 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="lblDitherRegistry.Text" xml:space="preserve">
|
||||
<value>Setting the dither registry key saves current settings to the registry. Changing the settings should normally do this already, but this provides a way to force it. Setting the registry key and then restarting the driver is workaround for high bandwidth displays (which use DSC) where the normal dither settings have an effect on only half the screen.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -662,7 +662,7 @@ namespace ColorControl.Services.NVIDIA
|
||||
subItemUnchanged.Font = _menuItemFonts[subItemUnchanged.Checked];
|
||||
}
|
||||
|
||||
if (driverSetting.SettingId == NvService.DRS_FRAME_RATE_LIMITER_V3)
|
||||
if (NvService.RangeDriverSettings.Contains(driverSetting.SettingId))
|
||||
{
|
||||
var value = settingMeta.DwordValues.FirstOrDefault(v => v.ValueName == driverSetting.ValueText);
|
||||
|
||||
@@ -670,7 +670,7 @@ namespace ColorControl.Services.NVIDIA
|
||||
var subItem = FormUtils.BuildMenuItem(item.DropDownItems, subItemName, "", onClick: driverSettingFrameRateNvMenuItem_Click);
|
||||
|
||||
var metaValue = settingMeta.DwordValues.FirstOrDefault(v => v.Value == presetSetting);
|
||||
subItem.Text = $"{metaValue?.ValueName ?? "??FPS"} (click to change)";
|
||||
subItem.Text = $"{metaValue?.ValueName ?? (driverSetting.SettingId == NvService.DRS_FRAME_RATE_LIMITER_V3 ? "??FPS" : "default")} (click to change)";
|
||||
|
||||
subItem.Tag = value?.Value ?? 0;
|
||||
subItem.Checked = presetSetting != defaultValue;
|
||||
|
||||
@@ -7,6 +7,7 @@ using ColorControl.Shared.Forms;
|
||||
using ColorControl.Shared.Native;
|
||||
using ColorControl.Shared.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Win32;
|
||||
using Newtonsoft.Json;
|
||||
using novideo_srgb;
|
||||
using nspector.Common;
|
||||
@@ -29,6 +30,8 @@ using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.AccessControl;
|
||||
using System.Security.Principal;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using static ColorControl.Shared.Contracts.NVIDIA.NvHdrSettings;
|
||||
@@ -78,7 +81,7 @@ namespace ColorControl.Services.NVIDIA
|
||||
PreserveSig = true)]
|
||||
private static extern IntPtr NvAPI64_QueryInterface(uint interfaceId);
|
||||
|
||||
[FunctionId(FunctionId.NvAPI_Disp_SetDitherControl)]
|
||||
[FunctionId(FunctionId.NvAPI_GPU_SetDitherControl)]
|
||||
public delegate int NvAPI_Disp_SetDitherControl(
|
||||
[In] PhysicalGPUHandle physicalGpu,
|
||||
[In] uint OutputId,
|
||||
@@ -87,7 +90,7 @@ namespace ColorControl.Services.NVIDIA
|
||||
[In] uint mode
|
||||
);
|
||||
|
||||
[FunctionId(FunctionId.NvAPI_Disp_GetDitherControl)]
|
||||
[FunctionId(FunctionId.NvAPI_GPU_GetDitherControl)]
|
||||
public delegate int NvAPI_Disp_GetDitherControl(
|
||||
[In] uint DisplayId,
|
||||
[MarshalAs(UnmanagedType.Struct)] ref NV_GPU_DITHER_CONTROL_V1 ditherControl);
|
||||
@@ -115,6 +118,11 @@ namespace ColorControl.Services.NVIDIA
|
||||
ref NV_DISPLAY_OUTPUT_MODE pDisplayMode
|
||||
);
|
||||
|
||||
[FunctionId(FunctionId.NvAPI_RestartDisplayDriver)]
|
||||
public delegate void NvAPI_RestartDisplayDriver();
|
||||
|
||||
// NvAPI_RestartDisplayDriver B4B26B65
|
||||
|
||||
//public struct NV_HDR_METADATA_V1
|
||||
//{
|
||||
// public uint version; //!< Version of this structure
|
||||
@@ -168,6 +176,12 @@ namespace ColorControl.Services.NVIDIA
|
||||
//public const uint DRS_ULTRA_LOW_LATENCY = 0x10835000;
|
||||
public const uint DRS_PRERENDERED_FRAMES = 8102046;
|
||||
public const uint DRS_FRAME_RATE_LIMITER_V3 = 277041154;
|
||||
public const uint DRS_RTX_HDR_PEAK_BRIGHTNESS = 0x00DD48FC;
|
||||
public const uint DRS_RTX_HDR_MIDDLE_GREY = 0x00DD48FD;
|
||||
public const uint DRS_RTX_HDR_CONTRAST = 0x00DD48FE;
|
||||
public const uint DRS_RTX_HDR_SATURATION = 0x00DD48FF;
|
||||
public const uint DRS_RTX_DYNAMIC_VIBRANCE_INTENSITY = 0x00ABAB22;
|
||||
public const uint DRS_RTX_DYNAMIC_VIBRANCE_SATURATION_BOOST = 0x00ABAB13;
|
||||
|
||||
public const uint DRS_ANISOTROPIC_FILTERING_SETTING = 0x101E61A9;
|
||||
public const uint DRS_ANISOTROPIC_FILTER_OPTIMIZATION = 0x0084CD70;
|
||||
@@ -179,6 +193,8 @@ namespace ColorControl.Services.NVIDIA
|
||||
public const uint DRS_RBAR_OPTIONS = 0X000F00BB;
|
||||
public const uint DRS_RBAR_SIZE_LIMIT = 0X000F00FF;
|
||||
|
||||
public static uint[] RangeDriverSettings = [DRS_FRAME_RATE_LIMITER_V3, DRS_RTX_HDR_PEAK_BRIGHTNESS, DRS_RTX_HDR_MIDDLE_GREY, DRS_RTX_HDR_CONTRAST, DRS_RTX_HDR_SATURATION, DRS_RTX_DYNAMIC_VIBRANCE_INTENSITY, DRS_RTX_DYNAMIC_VIBRANCE_SATURATION_BOOST];
|
||||
|
||||
public uint DriverVersion { get; private set; }
|
||||
public bool OutputModeAvailable => DriverVersion >= 52500;
|
||||
|
||||
@@ -798,15 +814,88 @@ namespace ColorControl.Services.NVIDIA
|
||||
return resultValue == 0 ? outputMode : null;
|
||||
}
|
||||
|
||||
public bool SetDithering(NvDitherState state, uint bits = 1, uint mode = 4, NvPreset preset = null, Display currentDisplay = null)
|
||||
public bool SetDitherRegistryKey(string displayRegId, uint state, uint bits = 1, uint mode = 4)
|
||||
{
|
||||
var delegateValue = DelegateFactory.GetDelegate<NvAPI_Disp_SetDitherControl>();
|
||||
|
||||
if (delegateValue == null)
|
||||
if (!_winApiService.IsAdministrator())
|
||||
{
|
||||
return false;
|
||||
var result = _rpcClientService.Call<bool>(nameof(SetDitherRegistryKey), displayRegId, state, bits, mode);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
const string DOMAIN_ALIAS_RID_ADMINS = "S-1-5-32-544";
|
||||
|
||||
var registryPath = "SYSTEM\\CurrentControlSet\\Services\\nvlddmkm\\State\\DisplayDatabase";
|
||||
|
||||
var displayDbKey = Registry.LocalMachine.OpenSubKey(registryPath);
|
||||
|
||||
var subKeyNames = displayDbKey.GetSubKeyNames().Where(n => n.Contains(displayRegId)).ToList();
|
||||
|
||||
foreach (var subKeyName in subKeyNames)
|
||||
{
|
||||
var keyPath = $"{registryPath}\\{subKeyName}";
|
||||
|
||||
try
|
||||
{
|
||||
var subKey = Registry.LocalMachine.OpenSubKey(keyPath);
|
||||
|
||||
var ditherValueName = subKey.GetValueNames().FirstOrDefault(n => n == "DitherRegistryKey");
|
||||
|
||||
if (ditherValueName == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
subKey = Registry.LocalMachine.OpenSubKey(keyPath, RegistryKeyPermissionCheck.ReadWriteSubTree, RegistryRights.ChangePermissions);
|
||||
|
||||
var accessControl = subKey.GetAccessControl();
|
||||
|
||||
var rules = accessControl.GetAccessRules(true, true, typeof(SecurityIdentifier));
|
||||
var accessRules = new RegistryAccessRule[rules.Count];
|
||||
rules.CopyTo(accessRules, 0);
|
||||
|
||||
if (!accessRules.Any(r => r.RegistryRights == RegistryRights.FullControl && r.IdentityReference.Value == DOMAIN_ALIAS_RID_ADMINS && r.AccessControlType == AccessControlType.Allow))
|
||||
{
|
||||
var ownerIdentity = accessControl.GetOwner(typeof(SecurityIdentifier));
|
||||
|
||||
var adminFullControlRule = new RegistryAccessRule(ownerIdentity, RegistryRights.FullControl, InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, PropagationFlags.None, AccessControlType.Allow);
|
||||
|
||||
accessControl.SetAccessRule(adminFullControlRule);
|
||||
|
||||
subKey.SetAccessControl(accessControl);
|
||||
}
|
||||
|
||||
subKey = Registry.LocalMachine.OpenSubKey(keyPath, true);
|
||||
|
||||
var value = subKey.GetValue(ditherValueName) as byte[];
|
||||
|
||||
if (value == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
value[9] = (byte)state;
|
||||
value[10] = (byte)bits;
|
||||
value[11] = (byte)mode;
|
||||
|
||||
// Checksum
|
||||
value[12] = (byte)value.Take(12).Sum(v => (uint)v);
|
||||
|
||||
subKey.SetValue(ditherValueName, value, RegistryValueKind.Binary);
|
||||
|
||||
break;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Debug($"Cannot get access to registry key: {keyPath} because: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool SetDithering(NvDitherState state, uint bits = 1, uint mode = 4, NvPreset preset = null, Display currentDisplay = null, bool setRegistryKey = false, bool restartDriver = false)
|
||||
{
|
||||
var result = true;
|
||||
|
||||
var display = currentDisplay ?? GetCurrentDisplay();
|
||||
@@ -832,16 +921,73 @@ namespace ColorControl.Services.NVIDIA
|
||||
mode = preset.ditheringMode;
|
||||
}
|
||||
|
||||
var resultValue = delegateValue(gpuHandle, displayId, (uint)state, bits, mode);
|
||||
if (resultValue != 0)
|
||||
if (setRegistryKey)
|
||||
{
|
||||
Logger.Error($"Could not set dithering because NvAPI_Disp_SetDitherControl returned a non-zero return code: {resultValue}");
|
||||
result = false;
|
||||
var displays = WindowsDisplayAPI.Display.GetDisplays();
|
||||
var path = displays.FirstOrDefault(x => x.DisplayName == display.Name)?.DevicePath;
|
||||
|
||||
if (path == null)
|
||||
{
|
||||
Logger.Debug($"Cannot find path for display {display.Name}");
|
||||
return false;
|
||||
}
|
||||
|
||||
var parts = path.Split('#');
|
||||
|
||||
if (parts.Length < 2)
|
||||
{
|
||||
Logger.Debug($"Incorrect path for display {display.Name}");
|
||||
return false;
|
||||
}
|
||||
|
||||
var regId = parts[1];
|
||||
|
||||
result = SetDitherRegistryKey(regId, (uint)state, bits, mode);
|
||||
|
||||
if (restartDriver)
|
||||
{
|
||||
RestartDriver();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var delegateValue = DelegateFactory.GetDelegate<NvAPI_Disp_SetDitherControl>();
|
||||
|
||||
if (delegateValue == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var resultValue = delegateValue(gpuHandle, displayId, (uint)state, bits, mode);
|
||||
if (resultValue != 0)
|
||||
{
|
||||
Logger.Error($"Could not set dithering because NvAPI_Disp_SetDitherControl returned a non-zero return code: {resultValue}");
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public bool RestartDriver()
|
||||
{
|
||||
if (!_winApiService.IsAdministrator())
|
||||
{
|
||||
return _rpcClientService.Call<bool>(nameof(RestartDriver));
|
||||
}
|
||||
|
||||
var restartDelegate = DelegateFactory.GetDelegate<NvAPI_RestartDisplayDriver>();
|
||||
|
||||
if (restartDelegate != null)
|
||||
{
|
||||
restartDelegate();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public NV_GPU_DITHER_CONTROL_V1 GetDithering(Display currentDisplay = null)
|
||||
{
|
||||
var version = MAKE_NVAPI_VERSION<NV_GPU_DITHER_CONTROL_V1>(1);
|
||||
@@ -1136,6 +1282,8 @@ namespace ColorControl.Services.NVIDIA
|
||||
|
||||
public void TestResolution()
|
||||
{
|
||||
SetDithering(NvDitherState.Enabled, 1, 4, setRegistryKey: true);
|
||||
|
||||
//GetHdrMetaData();
|
||||
|
||||
//SetOutputMode(NV_DISPLAY_OUTPUT_MODE.NV_DISPLAY_OUTPUT_MODE_HDR10PLUS_GAMING);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
KEY_CHDOWN,
|
||||
KEY_ENTER,
|
||||
KEY_RETURN,
|
||||
KEY_HOME,
|
||||
KEY_CH_LIST,
|
||||
KEY_MENU,
|
||||
KEY_SOURCE,
|
||||
@@ -44,5 +45,6 @@
|
||||
KEY_AD,
|
||||
KEY_PMODE,
|
||||
KEY_ASPECT,
|
||||
KEY_AMBIENT
|
||||
}
|
||||
}
|
||||
@@ -104,7 +104,7 @@ internal class ColorProfileViewModel : BaseViewModel
|
||||
public double WhiteLuminance { get; set; } = 1000;
|
||||
[Range(0, 10)]
|
||||
public double SDRMinBrightness { get; set; } = 0;
|
||||
[Range(11, 1000)]
|
||||
[Range(11, 10000)]
|
||||
public double SDRMaxBrightness { get; set; } = 100;
|
||||
[Range(-50, 50)]
|
||||
public double SDRBrightnessBoost { get; set; }
|
||||
|
||||
@@ -65,8 +65,8 @@
|
||||
<TextBox IsEnabled="{Binding SDRSettingsEnabled}" Grid.Column="1" HorizontalAlignment="Left" Margin="69,41,0,0" TextWrapping="Wrap" Text="{Binding SDRMinBrightness, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" VerticalAlignment="Top" Width="120" x:Name="tbSDRMinBrightness" Height="18" InputScope="Number"/>
|
||||
<Label Content="SDR maximum brightness (nits):" HorizontalAlignment="Left" Margin="197,37,0,0" VerticalAlignment="Top" Width="208" Height="26" Grid.Column="1"/>
|
||||
<TextBox IsEnabled="{Binding SDRSettingsEnabled}" Grid.Column="1" HorizontalAlignment="Left" Margin="405,41,0,0" TextWrapping="Wrap" Text="{Binding SDRMaxBrightness, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" VerticalAlignment="Top" Width="120" x:Name="tbSDRMaxBrightness" Height="18" InputScope="Number"/>
|
||||
<Label Content="SDR brightness boost (%):" HorizontalAlignment="Left" Margin="-5,64,0,0" VerticalAlignment="Top" Width="208" Height="26" Grid.ColumnSpan="2"/>
|
||||
<TextBox IsEnabled="{Binding SDRSettingsEnabled}" Grid.Column="1" HorizontalAlignment="Left" Margin="69,68,0,0" TextWrapping="Wrap" Text="{Binding SDRBrightnessBoost, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" VerticalAlignment="Top" Width="120" x:Name="tbSDRMinBrightness_Copy6" Height="18" InputScope="Number"/>
|
||||
<Label Content="Brightness boost (%):" HorizontalAlignment="Left" Margin="-5,64,0,0" VerticalAlignment="Top" Width="208" Height="26" Grid.ColumnSpan="2"/>
|
||||
<TextBox Grid.Column="1" HorizontalAlignment="Left" Margin="69,68,0,0" TextWrapping="Wrap" Text="{Binding SDRBrightnessBoost, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" VerticalAlignment="Top" Width="120" x:Name="tbSDRMinBrightness_Copy6" Height="18" InputScope="Number"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="Advanced Profile Settings" Padding="6" Height="71" Width="734" HorizontalAlignment="Left">
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
<LangVersion>9</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -112,6 +112,23 @@ namespace MHC2Gen
|
||||
}
|
||||
}
|
||||
|
||||
public void ApplyGamma()
|
||||
{
|
||||
var lutSize = 1024;
|
||||
|
||||
RegammaLUT = new double[3, lutSize];
|
||||
|
||||
for (var i = 0; i < lutSize; i++)
|
||||
{
|
||||
var value = CmsFunctions.RgbToLinear((double)i / (lutSize - 1), 1.0);
|
||||
|
||||
for (var c = 0; c < 3; c++)
|
||||
{
|
||||
RegammaLUT[c, i] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int EncodeS15F16(double value)
|
||||
{
|
||||
var x = (int)Math.Round(value * 65536);
|
||||
@@ -937,6 +954,10 @@ namespace MHC2Gen
|
||||
MaxCLL = command.MaxCLL
|
||||
};
|
||||
|
||||
//if (!command.IsHDRProfile)
|
||||
//{
|
||||
// MHC2.ApplyGamma();
|
||||
//}
|
||||
if (!command.IsHDRProfile || command.SDRTransferFunction == SDRTransferFunction.Piecewise)
|
||||
{
|
||||
MHC2.ApplyPiecewise();
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Platforms>x64</Platforms>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MathNet.Numerics" Version="4.15.0" />
|
||||
<PackageReference Include="MathNet.Numerics" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup Condition="$([MSBuild]::VersionGreaterThanOrEquals('$(NETCoreSdkVersion)', '7.0'))">
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<PropertyGroup Condition="$([MSBuild]::VersionGreaterThanOrEquals('$(NETCoreSdkVersion)', '8.0'))">
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<UseNativeAot Condition="$(PublishDir) != ''">true</UseNativeAot>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0-windows10.0.20348.0</TargetFramework>
|
||||
<TargetFramework>net8.0-windows10.0.20348.0</TargetFramework>
|
||||
<UseWPF>true</UseWPF>
|
||||
<RootNamespace>DJ</RootNamespace>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
@@ -18,7 +18,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NLog" Version="5.1.2" />
|
||||
<PackageReference Include="NLog" Version="5.2.8" />
|
||||
<PackageReference Include="System.Reactive" Version="6.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using nspector.Common.Helper;
|
||||
using System.Text;
|
||||
using nspector.Common.Helper;
|
||||
|
||||
namespace nspector.Common.CustomSettings
|
||||
{
|
||||
@@ -17,7 +15,27 @@ namespace nspector.Common.CustomSettings
|
||||
|
||||
public static CustomSettingNames FactoryLoadFromFile(string filename)
|
||||
{
|
||||
return XMLHelper<CustomSettingNames>.DeserializeFromXMLFile(filename);
|
||||
var settings = XMLHelper<CustomSettingNames>.DeserializeFromXMLFile(filename);
|
||||
|
||||
var interpolatedSettings = settings.Settings.Where(s => s.SettingValues.Count == 2 && s.SettingValues[1].SettingValue <= 1200 && (s.SettingValues[1].SettingValue - s.SettingValues[0].SettingValue) >= 50).ToList();
|
||||
|
||||
foreach (var setting in interpolatedSettings)
|
||||
{
|
||||
var maxSetting = setting.SettingValues[1].SettingValue;
|
||||
|
||||
setting.SettingValues.RemoveAt(1);
|
||||
|
||||
for (var i = setting.SettingValues[0].SettingValue + 1; i <= maxSetting; i++)
|
||||
{
|
||||
setting.SettingValues.Add(new CustomSettingValue
|
||||
{
|
||||
HexValue = i.ToString("X"),
|
||||
UserfriendlyName = i.ToString(),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return settings;
|
||||
}
|
||||
|
||||
public static CustomSettingNames FactoryLoadFromString(string xml)
|
||||
|
||||
@@ -212,9 +212,9 @@ namespace nspector.Common
|
||||
var profileHandles = EnumProfileHandles(hSession);
|
||||
foreach (IntPtr hProfile in profileHandles)
|
||||
{
|
||||
var apps = GetProfileApplications(hSession, hProfile);
|
||||
var apps = GetProfileApplications(hSession, hProfile, true);
|
||||
|
||||
if (apps.Any(a => a.appName.Equals(appName, StringComparison.OrdinalIgnoreCase)))
|
||||
if (apps?.Any(a => a.appName.Equals(appName, StringComparison.OrdinalIgnoreCase)) == true)
|
||||
{
|
||||
var profile = GetProfileInfo(hSession, hProfile);
|
||||
name = profile.profileName;
|
||||
@@ -227,7 +227,7 @@ namespace nspector.Common
|
||||
return name;
|
||||
}
|
||||
|
||||
public void CreateProfile(string profileName, string applicationName = null)
|
||||
public void CreateProfile(string profileName, string? applicationName = null)
|
||||
{
|
||||
DrsSession((hSession) =>
|
||||
{
|
||||
|
||||
@@ -240,7 +240,7 @@ namespace nspector.Common
|
||||
|
||||
protected List<IntPtr> EnumProfileHandles(IntPtr hSession)
|
||||
{
|
||||
var profileHandles = new List<IntPtr>();
|
||||
var profileHandles = new List<IntPtr>(5000);
|
||||
var hProfile = IntPtr.Zero;
|
||||
uint index = 0;
|
||||
|
||||
@@ -295,7 +295,7 @@ namespace nspector.Common
|
||||
return settings.ToList();
|
||||
}
|
||||
|
||||
protected List<NVDRS_APPLICATION_V3> GetProfileApplications(IntPtr hSession, IntPtr hProfile)
|
||||
protected List<NVDRS_APPLICATION_V3>? GetProfileApplications(IntPtr hSession, IntPtr hProfile, bool returnNullIfNotFound = false)
|
||||
{
|
||||
uint appCount = 8;
|
||||
|
||||
@@ -307,7 +307,7 @@ namespace nspector.Common
|
||||
var esRes = NvapiDrsWrapper.DRS_EnumApplications(hSession, hProfile, 0, ref appCount, out apps);
|
||||
|
||||
if (esRes == NvAPI_Status.NVAPI_END_ENUMERATION)
|
||||
return new List<NVDRS_APPLICATION_V3>();
|
||||
return returnNullIfNotFound ? null : new List<NVDRS_APPLICATION_V3>();
|
||||
|
||||
if (esRes != NvAPI_Status.NVAPI_OK)
|
||||
throw new NvapiException("DRS_EnumApplications", esRes);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0-windows10.0.20348.0</TargetFramework>
|
||||
<TargetFramework>net8.0-windows10.0.20348.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<Nullable>enable</Nullable>
|
||||
@@ -14,7 +14,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Resources.Extensions" Version="7.0.0" />
|
||||
<PackageReference Include="System.Resources.Extensions" Version="8.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace nspector
|
||||
|
||||
private List<SettingItem> _currentProfileSettingItems = new List<SettingItem>();
|
||||
private static bool _alreadyScannedForPredefinedSettings = false;
|
||||
private static object[] _baseProfileNames;
|
||||
private static object[]? _baseProfileNames;
|
||||
private IntPtr _taskbarParent = IntPtr.Zero;
|
||||
private bool _activated = false;
|
||||
private bool _isStartup = true;
|
||||
@@ -993,7 +993,7 @@ namespace nspector
|
||||
ShowCreateProfileDialog("");
|
||||
}
|
||||
|
||||
private void ShowCreateProfileDialog(string nameProposal, string applicationName = null)
|
||||
private void ShowCreateProfileDialog(string nameProposal, string? applicationName = null)
|
||||
{
|
||||
var ignoreList = cbProfiles.Items.Cast<string>().ToList();
|
||||
string result = nameProposal;
|
||||
@@ -1003,6 +1003,7 @@ namespace nspector
|
||||
try
|
||||
{
|
||||
_drs.CreateProfile(result, applicationName);
|
||||
_baseProfileNames = null;
|
||||
RefreshProfilesCombo();
|
||||
cbProfiles.SelectedIndex = cbProfiles.Items.IndexOf(result);
|
||||
AddToModifiedProfiles(result, true);
|
||||
|
||||
@@ -7706,5 +7706,110 @@
|
||||
</CustomSettingValue>
|
||||
</SettingValues>
|
||||
</CustomSetting>-->
|
||||
|
||||
<CustomSetting>
|
||||
<UserfriendlyName>RTX HDR - Peak Brightness</UserfriendlyName>
|
||||
<HexSettingID>0x00DD48FC</HexSettingID>
|
||||
<GroupName>9 - RTX</GroupName>
|
||||
<MinRequiredDriverVersion>0</MinRequiredDriverVersion>
|
||||
<SettingValues>
|
||||
<CustomSettingValue>
|
||||
<UserfriendlyName>400</UserfriendlyName>
|
||||
<HexValue>0x00000190</HexValue>
|
||||
</CustomSettingValue>
|
||||
<CustomSettingValue>
|
||||
<UserfriendlyName>1200</UserfriendlyName>
|
||||
<HexValue>0x000004B0</HexValue>
|
||||
</CustomSettingValue>
|
||||
</SettingValues>
|
||||
<SettingMasks />
|
||||
</CustomSetting>
|
||||
<CustomSetting>
|
||||
<UserfriendlyName>RTX HDR - Middle Grey</UserfriendlyName>
|
||||
<HexSettingID>0x00DD48FD</HexSettingID>
|
||||
<GroupName>9 - RTX</GroupName>
|
||||
<MinRequiredDriverVersion>0</MinRequiredDriverVersion>
|
||||
<SettingValues>
|
||||
<CustomSettingValue>
|
||||
<UserfriendlyName>0</UserfriendlyName>
|
||||
<HexValue>0x00000000</HexValue>
|
||||
</CustomSettingValue>
|
||||
<CustomSettingValue>
|
||||
<UserfriendlyName>100</UserfriendlyName>
|
||||
<HexValue>0x00000064</HexValue>
|
||||
</CustomSettingValue>
|
||||
</SettingValues>
|
||||
<SettingMasks />
|
||||
</CustomSetting>
|
||||
<CustomSetting>
|
||||
<UserfriendlyName>RTX HDR - Contrast</UserfriendlyName>
|
||||
<HexSettingID>0x00DD48FE</HexSettingID>
|
||||
<GroupName>9 - RTX</GroupName>
|
||||
<MinRequiredDriverVersion>0</MinRequiredDriverVersion>
|
||||
<SettingValues>
|
||||
<CustomSettingValue>
|
||||
<UserfriendlyName>0</UserfriendlyName>
|
||||
<HexValue>0x00000000</HexValue>
|
||||
</CustomSettingValue>
|
||||
<CustomSettingValue>
|
||||
<UserfriendlyName>200</UserfriendlyName>
|
||||
<HexValue>0x000000C8</HexValue>
|
||||
</CustomSettingValue>
|
||||
</SettingValues>
|
||||
<SettingMasks />
|
||||
</CustomSetting>
|
||||
<CustomSetting>
|
||||
<UserfriendlyName>RTX HDR - Saturation</UserfriendlyName>
|
||||
<HexSettingID>0x00DD48FF</HexSettingID>
|
||||
<GroupName>9 - RTX</GroupName>
|
||||
<MinRequiredDriverVersion>0</MinRequiredDriverVersion>
|
||||
<SettingValues>
|
||||
<CustomSettingValue>
|
||||
<UserfriendlyName>0</UserfriendlyName>
|
||||
<HexValue>0x00000000</HexValue>
|
||||
</CustomSettingValue>
|
||||
<CustomSettingValue>
|
||||
<UserfriendlyName>200</UserfriendlyName>
|
||||
<HexValue>0x000000C8</HexValue>
|
||||
</CustomSettingValue>
|
||||
</SettingValues>
|
||||
<SettingMasks />
|
||||
</CustomSetting>
|
||||
|
||||
<CustomSetting>
|
||||
<UserfriendlyName>RTX Dynamic Vibrance - Intensity</UserfriendlyName>
|
||||
<HexSettingID>0x00ABAB22</HexSettingID>
|
||||
<GroupName>9 - RTX</GroupName>
|
||||
<MinRequiredDriverVersion>0</MinRequiredDriverVersion>
|
||||
<SettingValues>
|
||||
<CustomSettingValue>
|
||||
<UserfriendlyName>0</UserfriendlyName>
|
||||
<HexValue>0x00000000</HexValue>
|
||||
</CustomSettingValue>
|
||||
<CustomSettingValue>
|
||||
<UserfriendlyName>100</UserfriendlyName>
|
||||
<HexValue>0x00000064</HexValue>
|
||||
</CustomSettingValue>
|
||||
</SettingValues>
|
||||
<SettingMasks />
|
||||
</CustomSetting>
|
||||
<CustomSetting>
|
||||
<UserfriendlyName>RTX Dynamic Vibrance - Saturation Boost</UserfriendlyName>
|
||||
<HexSettingID>0x00ABAB13</HexSettingID>
|
||||
<GroupName>9 - RTX</GroupName>
|
||||
<MinRequiredDriverVersion>0</MinRequiredDriverVersion>
|
||||
<SettingValues>
|
||||
<CustomSettingValue>
|
||||
<UserfriendlyName>0</UserfriendlyName>
|
||||
<HexValue>0x00000000</HexValue>
|
||||
</CustomSettingValue>
|
||||
<CustomSettingValue>
|
||||
<UserfriendlyName>100</UserfriendlyName>
|
||||
<HexValue>0x00000064</HexValue>
|
||||
</CustomSettingValue>
|
||||
</SettingValues>
|
||||
<SettingMasks />
|
||||
</CustomSetting>
|
||||
|
||||
</Settings>
|
||||
</CustomSettingNames>
|
||||
@@ -4983,5 +4983,152 @@
|
||||
<Description />
|
||||
<GroupName>8 - Extra</GroupName>
|
||||
</CustomSetting>
|
||||
<CustomSetting>
|
||||
<UserfriendlyName>RTX HDR - Flags</UserfriendlyName>
|
||||
<HexSettingID>0x00432F84</HexSettingID>
|
||||
<GroupName>9 - RTX</GroupName>
|
||||
<MinRequiredDriverVersion>0</MinRequiredDriverVersion>
|
||||
<SettingValues>
|
||||
<CustomSettingValue>
|
||||
<UserfriendlyName>Off (0x00)</UserfriendlyName>
|
||||
<HexValue>0x00000000</HexValue>
|
||||
</CustomSettingValue>
|
||||
<CustomSettingValue>
|
||||
<UserfriendlyName>Enable (0x02)</UserfriendlyName>
|
||||
<HexValue>0x00000002</HexValue>
|
||||
</CustomSettingValue>
|
||||
<CustomSettingValue>
|
||||
<UserfriendlyName>Enable + Indicator (0x03)</UserfriendlyName>
|
||||
<HexValue>0x00000003</HexValue>
|
||||
</CustomSettingValue>
|
||||
<CustomSettingValue>
|
||||
<UserfriendlyName>Enable + Indicator + Debug (0x23)</UserfriendlyName>
|
||||
<HexValue>0x00000023</HexValue>
|
||||
</CustomSettingValue>
|
||||
</SettingValues>
|
||||
<SettingMasks />
|
||||
</CustomSetting>
|
||||
<CustomSetting>
|
||||
<UserfriendlyName>RTX HDR - Unknown</UserfriendlyName>
|
||||
<HexSettingID>0x1077A11A</HexSettingID>
|
||||
<GroupName>9 - RTX</GroupName>
|
||||
<MinRequiredDriverVersion>0</MinRequiredDriverVersion>
|
||||
<SettingValues>
|
||||
<CustomSettingValue>
|
||||
<UserfriendlyName>Off</UserfriendlyName>
|
||||
<HexValue>0x00000000</HexValue>
|
||||
</CustomSettingValue>
|
||||
<CustomSettingValue>
|
||||
<UserfriendlyName>On</UserfriendlyName>
|
||||
<HexValue>0x00000001</HexValue>
|
||||
</CustomSettingValue>
|
||||
</SettingValues>
|
||||
<SettingMasks />
|
||||
</CustomSetting>
|
||||
<CustomSetting>
|
||||
<UserfriendlyName>RTX HDR - Game Filters</UserfriendlyName>
|
||||
<HexSettingID>0x00980896</HexSettingID>
|
||||
<GroupName>9 - RTX</GroupName>
|
||||
<MinRequiredDriverVersion>0</MinRequiredDriverVersion>
|
||||
<SettingValues>
|
||||
<CustomSettingValue>
|
||||
<UserfriendlyName>Off</UserfriendlyName>
|
||||
<HexValue>0x00000000</HexValue>
|
||||
</CustomSettingValue>
|
||||
<CustomSettingValue>
|
||||
<UserfriendlyName>On</UserfriendlyName>
|
||||
<HexValue>0x00000001</HexValue>
|
||||
</CustomSettingValue>
|
||||
</SettingValues>
|
||||
<SettingMasks />
|
||||
</CustomSetting>
|
||||
<CustomSetting>
|
||||
<UserfriendlyName>RTX HDR - Enable</UserfriendlyName>
|
||||
<HexSettingID>0x00DD48FB</HexSettingID>
|
||||
<GroupName>9 - RTX</GroupName>
|
||||
<MinRequiredDriverVersion>0</MinRequiredDriverVersion>
|
||||
<SettingValues>
|
||||
<CustomSettingValue>
|
||||
<UserfriendlyName>Off</UserfriendlyName>
|
||||
<HexValue>0x00000000</HexValue>
|
||||
</CustomSettingValue>
|
||||
<CustomSettingValue>
|
||||
<UserfriendlyName>On</UserfriendlyName>
|
||||
<HexValue>0x00000001</HexValue>
|
||||
</CustomSettingValue>
|
||||
</SettingValues>
|
||||
<SettingMasks />
|
||||
</CustomSetting>
|
||||
<CustomSetting>
|
||||
<UserfriendlyName>RTX HDR - Peak Brightness</UserfriendlyName>
|
||||
<HexSettingID>0x00DD48FC</HexSettingID>
|
||||
<GroupName>9 - RTX</GroupName>
|
||||
<MinRequiredDriverVersion>0</MinRequiredDriverVersion>
|
||||
<SettingValues>
|
||||
</SettingValues>
|
||||
<SettingMasks />
|
||||
</CustomSetting>
|
||||
<CustomSetting>
|
||||
<UserfriendlyName>RTX HDR - Middle Grey</UserfriendlyName>
|
||||
<HexSettingID>0x00DD48FD</HexSettingID>
|
||||
<GroupName>9 - RTX</GroupName>
|
||||
<MinRequiredDriverVersion>0</MinRequiredDriverVersion>
|
||||
<SettingValues>
|
||||
</SettingValues>
|
||||
<SettingMasks />
|
||||
</CustomSetting>
|
||||
<CustomSetting>
|
||||
<UserfriendlyName>RTX HDR - Contrast</UserfriendlyName>
|
||||
<HexSettingID>0x00DD48FE</HexSettingID>
|
||||
<GroupName>9 - RTX</GroupName>
|
||||
<MinRequiredDriverVersion>0</MinRequiredDriverVersion>
|
||||
<SettingValues>
|
||||
</SettingValues>
|
||||
<SettingMasks />
|
||||
</CustomSetting>
|
||||
<CustomSetting>
|
||||
<UserfriendlyName>RTX HDR - Saturation</UserfriendlyName>
|
||||
<HexSettingID>0x00DD48FF</HexSettingID>
|
||||
<GroupName>9 - RTX</GroupName>
|
||||
<MinRequiredDriverVersion>0</MinRequiredDriverVersion>
|
||||
<SettingValues>
|
||||
</SettingValues>
|
||||
<SettingMasks />
|
||||
</CustomSetting>
|
||||
<CustomSetting>
|
||||
<UserfriendlyName>RTX Dynamic Vibrance - Enable</UserfriendlyName>
|
||||
<HexSettingID>0x00980880</HexSettingID>
|
||||
<GroupName>9 - RTX</GroupName>
|
||||
<MinRequiredDriverVersion>0</MinRequiredDriverVersion>
|
||||
<SettingValues>
|
||||
<CustomSettingValue>
|
||||
<UserfriendlyName>Off</UserfriendlyName>
|
||||
<HexValue>0x00000000</HexValue>
|
||||
</CustomSettingValue>
|
||||
<CustomSettingValue>
|
||||
<UserfriendlyName>On</UserfriendlyName>
|
||||
<HexValue>0x00000001</HexValue>
|
||||
</CustomSettingValue>
|
||||
</SettingValues>
|
||||
<SettingMasks />
|
||||
</CustomSetting>
|
||||
<CustomSetting>
|
||||
<UserfriendlyName>RTX Dynamic Vibrance - Intensity</UserfriendlyName>
|
||||
<HexSettingID>0x00ABAB22</HexSettingID>
|
||||
<GroupName>9 - RTX</GroupName>
|
||||
<MinRequiredDriverVersion>0</MinRequiredDriverVersion>
|
||||
<SettingValues>
|
||||
</SettingValues>
|
||||
<SettingMasks />
|
||||
</CustomSetting>
|
||||
<CustomSetting>
|
||||
<UserfriendlyName>RTX Dynamic Vibrance - Saturation Boost</UserfriendlyName>
|
||||
<HexSettingID>0x00ABAB13</HexSettingID>
|
||||
<GroupName>9 - RTX</GroupName>
|
||||
<MinRequiredDriverVersion>0</MinRequiredDriverVersion>
|
||||
<SettingValues>
|
||||
</SettingValues>
|
||||
<SettingMasks />
|
||||
</CustomSetting>
|
||||
</Settings>
|
||||
</CustomSettingNames>
|
||||
@@ -705,8 +705,6 @@ namespace NvAPIWrapper.Native.Helpers
|
||||
// CC: added functions
|
||||
NvAPI_Disp_SetOutputMode = 0x98E7661A,
|
||||
NvAPI_Disp_GetOutputMode = 0x81FED88D,
|
||||
NvAPI_Disp_SetDitherControl = 0xDF0DFCDD,
|
||||
NvAPI_Disp_GetDitherControl = 0x932AC8FB,
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0-windows10.0.20348.0</TargetFramework>
|
||||
<TargetFramework>net8.0-windows10.0.20348.0</TargetFramework>
|
||||
<Version>0.8.1.106</Version>
|
||||
<Company>falahati.net</Company>
|
||||
<Description>NvAPIWrapper is a .Net wrapper for NVIDIA public API</Description>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0-windows10.0.20348.0</TargetFramework>
|
||||
<TargetFramework>net8.0-windows10.0.20348.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>disable</Nullable>
|
||||
<UseWPF>true</UseWPF>
|
||||
@@ -25,15 +25,15 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="NLog" Version="5.1.2" />
|
||||
<PackageReference Include="NStandard" Version="0.24.0" />
|
||||
<PackageReference Include="NLog" Version="5.2.8" />
|
||||
<PackageReference Include="NStandard" Version="0.59.0" />
|
||||
<PackageReference Include="NWin32" Version="1.2.6" />
|
||||
<PackageReference Include="System.Management" Version="7.0.0" />
|
||||
<PackageReference Include="System.Management" Version="8.0.0" />
|
||||
<PackageReference Include="TaskScheduler" Version="2.10.1" />
|
||||
<PackageReference Include="Vanara.PInvoke.IpHlpApi" Version="3.4.13" />
|
||||
<PackageReference Include="RawInput.Sharp" Version="0.1.1" />
|
||||
<PackageReference Include="Vanara.PInvoke.IpHlpApi" Version="3.4.17" />
|
||||
<PackageReference Include="RawInput.Sharp" Version="0.1.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -32,11 +32,11 @@ namespace novideo_srgb
|
||||
}
|
||||
|
||||
var hdrPaths = DisplayConfigManager.GetHdrDisplayPaths();
|
||||
var displays = WindowsDisplayAPI.Display.GetDisplays();
|
||||
|
||||
var number = 1;
|
||||
foreach (var display in Display.GetDisplays())
|
||||
foreach (var display in GetDisplays())
|
||||
{
|
||||
var displays = WindowsDisplayAPI.Display.GetDisplays();
|
||||
var path = displays.FirstOrDefault(x => x.DisplayName == display.Name)?.DevicePath;
|
||||
if (path == null)
|
||||
{
|
||||
@@ -74,6 +74,18 @@ namespace novideo_srgb
|
||||
}
|
||||
}
|
||||
|
||||
private static Display[] GetDisplays()
|
||||
{
|
||||
try
|
||||
{
|
||||
return Display.GetDisplays();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return Array.Empty<Display>();
|
||||
}
|
||||
}
|
||||
|
||||
public async void OnDisplaySettingsChanged(object sender, EventArgs e)
|
||||
{
|
||||
await Task.Delay(1000);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0-windows10.0.20348.0</TargetFramework>
|
||||
<TargetFramework>net8.0-windows10.0.20348.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
@@ -16,8 +16,8 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NLog" Version="5.1.2" />
|
||||
<PackageReference Include="System.Resources.Extensions" Version="7.0.0" />
|
||||
<PackageReference Include="NLog" Version="5.2.8" />
|
||||
<PackageReference Include="System.Resources.Extensions" Version="8.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in new issue
Block a user