Skip to content

Commit 1b2d874

Browse files
committed
1.5.6
- Fix: HDRProfile cannot identify monitors for some users
1 parent 240b33a commit 1b2d874

File tree

14 files changed

+362
-62
lines changed

14 files changed

+362
-62
lines changed

Source/HDRController/HDRController/HDRController.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ static void showError(std::string msg)
2727
MessageBox(NULL, lmsg, L"HDRController Error", MB_OK | MB_ICONWARNING);
2828
}
2929

30-
3130
static void SetGlobalHDR(bool enabled)
3231
{
3332
uint32_t pathCount, modeCount;
0 Bytes
Binary file not shown.

Source/HDRProfile/HDRController.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace HDRProfile
1010
{
11-
public static class HDRController
11+
public static class HDRController
1212
{
1313

1414
readonly static object _dllLock = new object();
@@ -24,6 +24,5 @@ public static class HDRController
2424

2525
[DllImport("HDRController.dll", CallingConvention = CallingConvention.Cdecl)]
2626
public static extern bool GetHDRState(UInt32 uid);
27-
2827
}
2928
}

Source/HDRProfile/HDRProfile.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@
9898
<Prefer32Bit>true</Prefer32Bit>
9999
</PropertyGroup>
100100
<ItemGroup>
101+
<Reference Include="CCDWrapper, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
102+
<HintPath>..\packages\CCDWrapper.1.0.1\lib\net35\CCDWrapper.dll</HintPath>
103+
</Reference>
101104
<Reference Include="CodectoryCore.Logging, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
102105
<SpecificVersion>False</SpecificVersion>
103106
<HintPath>Externals\CodectoryCore.Logging.dll</HintPath>
@@ -169,6 +172,7 @@
169172
<DesignTime>True</DesignTime>
170173
<DependentUpon>Locale_Texts.resx</DependentUpon>
171174
</Compile>
175+
<Compile Include="NightLightManager.cs" />
172176
<Compile Include="Tools.cs" />
173177
<Compile Include="TrayMenuHelper.cs" />
174178
<Page Include="MonitorManagerView.xaml">

Source/HDRProfile/HDRProfileHandler.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ public string Version
8080

8181
public HDRProfileHandler()
8282
{
83+
//NightLightManager nightLightManager = new NightLightManager();
84+
//bool value = nightLightManager.GetNightLightState();
85+
//nightLightManager.SetNightLightState(false);
86+
//value = nightLightManager.GetNightLightState();
87+
//nightLightManager.SetNightLightState(false);
88+
8389
Logs.LoggingEnabled = true;
8490
//ChangeLanguage( new System.Globalization.CultureInfo("en-US"));
8591
Initialize();
@@ -497,7 +503,7 @@ private void RestartProcess(ApplicationItem application)
497503
return;
498504
}
499505
Process.GetProcessesByName(application.ApplicationName).ToList().ForEach(p => p.Kill());
500-
506+
System.Threading.Thread.Sleep(2000);
501507
Process proc = new Process();
502508
StartApplication(application);
503509
}

Source/HDRProfile/Locale_Texts.Designer.cs

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/HDRProfile/Locale_Texts.de.resx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@
171171
<data name="FilePath" xml:space="preserve">
172172
<value>Dateipfad</value>
173173
</data>
174+
<data name="GlobalAutoHDR" xml:space="preserve">
175+
<value>Auto HDR für alle Monitore</value>
176+
</data>
174177
<data name="HDR" xml:space="preserve">
175178
<value>HDR</value>
176179
</data>
@@ -207,9 +210,15 @@
207210
<data name="Open" xml:space="preserve">
208211
<value>Öffnen</value>
209212
</data>
213+
<data name="RefreshRate" xml:space="preserve">
214+
<value>Bildwiederholrate [Hz]</value>
215+
</data>
210216
<data name="RemoveApplication" xml:space="preserve">
211217
<value>Anwendung entfernen</value>
212218
</data>
219+
<data name="Resolution" xml:space="preserve">
220+
<value>Auflösung</value>
221+
</data>
213222
<data name="RestartProccessOnFirstOccurence" xml:space="preserve">
214223
<value>Kompatibilitätsmodus</value>
215224
</data>

Source/HDRProfile/Locale_Texts.resx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,15 @@
214214
<data name="Open" xml:space="preserve">
215215
<value>Open</value>
216216
</data>
217+
<data name="RefreshRate" xml:space="preserve">
218+
<value>Refresh rate [Hz]</value>
219+
</data>
217220
<data name="RemoveApplication" xml:space="preserve">
218221
<value>Remove application</value>
219222
</data>
223+
<data name="Resolution" xml:space="preserve">
224+
<value>Resolution</value>
225+
</data>
220226
<data name="RestartProccessOnFirstOccurence" xml:space="preserve">
221227
<value>Compatibility mode</value>
222228
</data>

Source/HDRProfile/Monitor.cs

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using CodectoryCore.UI.Wpf;
22
using System;
33
using System.Collections.Generic;
4+
using System.Drawing;
45
using System.Linq;
56
using System.Text;
67
using System.Threading.Tasks;
@@ -17,11 +18,6 @@ public class Monitor : BaseViewModel
1718
private string _name;
1819
public string Name { get => _name; set { _name = value; OnPropertyChanged(); } }
1920

20-
private string _caption;
21-
public string Caption { get => _caption; set { _caption = value; OnPropertyChanged(); } }
22-
23-
private string _deviceID;
24-
public string DeviceID { get => _deviceID; set { _deviceID = value; OnPropertyChanged(); } }
2521

2622
private UInt32 _uid;
2723
public UInt32 UID { get => _uid; set { _uid = value; OnPropertyChanged(); } }
@@ -30,21 +26,29 @@ public class Monitor : BaseViewModel
3026

3127
public bool HDRState { get => _hdrState; set { _hdrState = value; OnPropertyChanged(); } }
3228

33-
public Monitor(string name, string caption, string deviceID, UInt32 uid)
34-
{
35-
Name = name ?? throw new ArgumentNullException(nameof(name));
36-
Caption = caption ?? throw new ArgumentNullException(nameof(caption));
37-
DeviceID = deviceID ?? throw new ArgumentNullException(nameof(deviceID));
38-
UID = uid;
39-
UpdateHDRState();
40-
}
29+
30+
private Size _resolution;
31+
public Size Resolution { get => _resolution; set { _resolution = value; OnPropertyChanged(); } }
32+
33+
34+
private int _refreshRate;
35+
36+
public int RefreshRate { get => _refreshRate; set { _refreshRate = value; OnPropertyChanged(); } }
4137

4238
private Monitor()
4339
{
4440

4541

4642
}
4743

44+
public Monitor(string name, uint uID, Size resolution, int refreshRate)
45+
{
46+
Name = name ?? throw new ArgumentNullException(nameof(name));
47+
UID = uID;
48+
Resolution = resolution;
49+
RefreshRate = refreshRate;
50+
}
51+
4852
public void UpdateHDRState()
4953
{
5054
HDRState= HDRController.GetHDRState(UID);

0 commit comments

Comments
 (0)