mirror of
https://github.com/terrymacdonald/DisplayMagician.git
synced 2024-08-30 18:32:20 +00:00
[WIP] saving a copy for later
This commit is contained in:
@ -8,10 +8,11 @@ using ATI.ADL;
|
|||||||
using Microsoft.Win32.SafeHandles;
|
using Microsoft.Win32.SafeHandles;
|
||||||
using DisplayMagicianShared;
|
using DisplayMagicianShared;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using static DisplayMagicianShared.AMD.AMDProfileData;
|
||||||
|
|
||||||
namespace DisplayMagicianShared.AMD
|
namespace DisplayMagicianShared.AMD
|
||||||
{
|
{
|
||||||
public class AMDLibrary : IDisposable
|
internal class AMDLibrary : IDisposable
|
||||||
{
|
{
|
||||||
// Static members are 'eagerly initialized', that is,
|
// Static members are 'eagerly initialized', that is,
|
||||||
// immediately when class is loaded for the first time.
|
// immediately when class is loaded for the first time.
|
||||||
@ -25,27 +26,7 @@ namespace DisplayMagicianShared.AMD
|
|||||||
|
|
||||||
// Instantiate a SafeHandle instance.
|
// Instantiate a SafeHandle instance.
|
||||||
private SafeHandle _safeHandle = new SafeFileHandle(IntPtr.Zero, true);
|
private SafeHandle _safeHandle = new SafeFileHandle(IntPtr.Zero, true);
|
||||||
private IntPtr _adlContextHandle = IntPtr.Zero;
|
private IntPtr _adlContextHandle = IntPtr.Zero;
|
||||||
|
|
||||||
// Struct to be used as the AMD Profile
|
|
||||||
internal struct AMDProfile
|
|
||||||
{
|
|
||||||
internal List<AMDAdapter> Adapters;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Struct to store the Display
|
|
||||||
internal struct AMDAdapter
|
|
||||||
{
|
|
||||||
internal ADLAdapterInfoX2 AdapterInfoX2;
|
|
||||||
internal List<AMDDisplay> Displays;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Struct to store the Display
|
|
||||||
internal struct AMDDisplay
|
|
||||||
{
|
|
||||||
internal List<ADLMode> DisplayModes;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static AMDLibrary() { }
|
static AMDLibrary() { }
|
||||||
public AMDLibrary()
|
public AMDLibrary()
|
||||||
|
35
DisplayMagicianShared/AMD/AMDProfileData.cs
Normal file
35
DisplayMagicianShared/AMD/AMDProfileData.cs
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using ATI.ADL;
|
||||||
|
|
||||||
|
namespace DisplayMagicianShared.AMD
|
||||||
|
{
|
||||||
|
internal class AMDProfileData : VideoLibraryProfileData
|
||||||
|
{
|
||||||
|
|
||||||
|
// Struct to be used as the AMD Profile
|
||||||
|
internal struct AMDProfile
|
||||||
|
{
|
||||||
|
public List<AMDAdapter> Adapters;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Struct to store the Display
|
||||||
|
internal struct AMDAdapter
|
||||||
|
{
|
||||||
|
internal ADLAdapterInfoX2 AdapterInfoX2;
|
||||||
|
internal List<AMDDisplay> Displays;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Struct to store the Display
|
||||||
|
internal struct AMDDisplay
|
||||||
|
{
|
||||||
|
internal List<ADLMode> DisplayModes;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal AMDProfile ProfileData {get; set;}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -53,6 +53,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="AMD\ADL.cs" />
|
<Compile Include="AMD\ADL.cs" />
|
||||||
<Compile Include="AMD\AMDLibrary.cs" />
|
<Compile Include="AMD\AMDLibrary.cs" />
|
||||||
|
<Compile Include="AMD\AMDProfileData.cs" />
|
||||||
<Compile Include="SharedLogger.cs" />
|
<Compile Include="SharedLogger.cs" />
|
||||||
<Compile Include="Properties\Resources.Designer.cs">
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
@ -87,6 +88,7 @@
|
|||||||
<Compile Include="UserControls\DisplayView.Designer.cs">
|
<Compile Include="UserControls\DisplayView.Designer.cs">
|
||||||
<DependentUpon>DisplayView.cs</DependentUpon>
|
<DependentUpon>DisplayView.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="VideoLibraryProfileData.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="Properties\Resources.resx">
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
@ -155,6 +155,8 @@ namespace DisplayMagicianShared
|
|||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
public Topology.Path[] Paths { get; set; } = new Topology.Path[0];
|
public Topology.Path[] Paths { get; set; } = new Topology.Path[0];
|
||||||
|
|
||||||
|
internal VideoLibraryProfileData ProfileData { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public ProfileIcon ProfileIcon
|
public ProfileIcon ProfileIcon
|
||||||
|
@ -14,6 +14,7 @@ using System.Text.RegularExpressions;
|
|||||||
using NvAPIWrapper.Native.GPU;
|
using NvAPIWrapper.Native.GPU;
|
||||||
using DisplayMagicianShared.AMD;
|
using DisplayMagicianShared.AMD;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using static DisplayMagicianShared.AMD.AMDProfileData;
|
||||||
|
|
||||||
namespace DisplayMagicianShared
|
namespace DisplayMagicianShared
|
||||||
{
|
{
|
||||||
@ -563,12 +564,12 @@ namespace DisplayMagicianShared
|
|||||||
AMDLibrary amdLibrary = AMDLibrary.GetLibrary();
|
AMDLibrary amdLibrary = AMDLibrary.GetLibrary();
|
||||||
if (amdLibrary.IsInstalled)
|
if (amdLibrary.IsInstalled)
|
||||||
{
|
{
|
||||||
AMDLibrary.AMDProfile thisOne = amdLibrary.GetActiveProfile();
|
AMDProfile thisOne = amdLibrary.GetActiveProfile();
|
||||||
activeProfile = new ProfileItem
|
activeProfile = new ProfileItem
|
||||||
{
|
{
|
||||||
Name = "Current Display Profile",
|
Name = "Current Display Profile",
|
||||||
//Driver = "AMD",
|
//Driver = "AMD",
|
||||||
//ProfileData = amdLibrary.GetActiveProfile()
|
ProfileData = amdLibrary.GetActiveProfile()
|
||||||
//ProfileDisplayIdentifiers = ProfileRepository.GenerateProfileDisplayIdentifiers()
|
//ProfileDisplayIdentifiers = ProfileRepository.GenerateProfileDisplayIdentifiers()
|
||||||
};
|
};
|
||||||
activeProfile.ProfileIcon = new ProfileIcon(activeProfile);
|
activeProfile.ProfileIcon = new ProfileIcon(activeProfile);
|
||||||
|
14
DisplayMagicianShared/VideoLibraryProfileData.cs
Normal file
14
DisplayMagicianShared/VideoLibraryProfileData.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace DisplayMagicianShared
|
||||||
|
{
|
||||||
|
class VideoLibraryProfileData
|
||||||
|
{
|
||||||
|
// Empty Class
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user