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 DisplayMagicianShared;
|
||||
using System.Threading;
|
||||
using static DisplayMagicianShared.AMD.AMDProfileData;
|
||||
|
||||
namespace DisplayMagicianShared.AMD
|
||||
{
|
||||
public class AMDLibrary : IDisposable
|
||||
internal class AMDLibrary : IDisposable
|
||||
{
|
||||
// Static members are 'eagerly initialized', that is,
|
||||
// immediately when class is loaded for the first time.
|
||||
@ -27,26 +28,6 @@ namespace DisplayMagicianShared.AMD
|
||||
private SafeHandle _safeHandle = new SafeFileHandle(IntPtr.Zero, true);
|
||||
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() { }
|
||||
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>
|
||||
<Compile Include="AMD\ADL.cs" />
|
||||
<Compile Include="AMD\AMDLibrary.cs" />
|
||||
<Compile Include="AMD\AMDProfileData.cs" />
|
||||
<Compile Include="SharedLogger.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
@ -87,6 +88,7 @@
|
||||
<Compile Include="UserControls\DisplayView.Designer.cs">
|
||||
<DependentUpon>DisplayView.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="VideoLibraryProfileData.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
|
@ -156,6 +156,8 @@ namespace DisplayMagicianShared
|
||||
|
||||
public Topology.Path[] Paths { get; set; } = new Topology.Path[0];
|
||||
|
||||
internal VideoLibraryProfileData ProfileData { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public ProfileIcon ProfileIcon
|
||||
{
|
||||
|
@ -14,6 +14,7 @@ using System.Text.RegularExpressions;
|
||||
using NvAPIWrapper.Native.GPU;
|
||||
using DisplayMagicianShared.AMD;
|
||||
using System.Windows.Forms;
|
||||
using static DisplayMagicianShared.AMD.AMDProfileData;
|
||||
|
||||
namespace DisplayMagicianShared
|
||||
{
|
||||
@ -563,12 +564,12 @@ namespace DisplayMagicianShared
|
||||
AMDLibrary amdLibrary = AMDLibrary.GetLibrary();
|
||||
if (amdLibrary.IsInstalled)
|
||||
{
|
||||
AMDLibrary.AMDProfile thisOne = amdLibrary.GetActiveProfile();
|
||||
AMDProfile thisOne = amdLibrary.GetActiveProfile();
|
||||
activeProfile = new ProfileItem
|
||||
{
|
||||
Name = "Current Display Profile",
|
||||
//Driver = "AMD",
|
||||
//ProfileData = amdLibrary.GetActiveProfile()
|
||||
ProfileData = amdLibrary.GetActiveProfile()
|
||||
//ProfileDisplayIdentifiers = ProfileRepository.GenerateProfileDisplayIdentifiers()
|
||||
};
|
||||
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