Renamed ADLWrapper to AMDLibrary

It better reflects the purpose of the class.
This commit is contained in:
Terry MacDonald 2021-06-20 10:45:45 +12:00
parent d2c8c67d44
commit 484b6d86b4
4 changed files with 316 additions and 324 deletions

View File

@ -52,7 +52,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="AMD\ADL.cs" />
<Compile Include="AMD\ADLWrapper.cs" />
<Compile Include="AMD\AMDLibrary.cs" />
<Compile Include="SharedLogger.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>

View File

@ -30,7 +30,7 @@ namespace DisplayMagicianShared
private static ProfileItem _currentProfile;
private static List<string> _connectedDisplayIdentifiers = new List<string>();
private static bool notifiedEDIDErrorToUser = false;
private static ADLWrapper AMDLibrary;
private static AMDLibrary AMDLibrary;
// Other constants that are useful
public static string AppDataPath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "DisplayMagician");
@ -61,7 +61,7 @@ namespace DisplayMagicianShared
try
{
SharedLogger.logger.Debug($"ProfileRepository/ProfileRepository: Initialising the AMD ADL library.");
AMDLibrary = new ADLWrapper();
AMDLibrary = new AMDLibrary();
}
catch (Exception ex)
{
@ -556,6 +556,13 @@ namespace DisplayMagicianShared
public static void UpdateActiveProfile()
{
AMDLibrary amdLibrary = AMDLibrary.GetLibrary();
if (amdLibrary.IsInstalled)
{
amdLibrary.GetActiveProfile();
}
SharedLogger.logger.Debug($"ProfileRepository/UpdateActiveProfile: Updating the profile currently active (in use now).");
ProfileItem activeProfile = new ProfileItem
@ -1156,7 +1163,7 @@ namespace DisplayMagicianShared
}
// If the Video Card is an AMD, then we should generate specific AMD displayIdentifiers
AMD.ADLWrapper thingy = new AMD.ADLWrapper();
AMD.AMDLibrary thingy = new AMD.AMDLibrary();
if (isNvidia && myPhysicalGPUs != null && myPhysicalGPUs.Length > 0)
//if (false)

View File

@ -77,32 +77,17 @@ namespace DisplayMagicianShared.Topology
// Check whether the Profile Viewport properties are equal
// Two profiles are equal only when they have the same viewport data exactly
/*if (PixelFormat == other.PixelFormat &&
Position.Equals(other.Position) &&
Resolution.Equals(other.Resolution) &&
SourceId == other.SourceId)*/
// Note: Removed the source ID as it changes on boot sometimes!
// It can change and the profiles can still be the same
if (PixelFormat == other.PixelFormat &&
Position.Equals(other.Position) &&
Resolution.Equals(other.Resolution) &&
SourceId == other.SourceId)
{
/*// If the above all match, then we need to check the DisplayTargets
if (other.TargetDisplays.SequenceEqual(TargetDisplays))
return true;
else
return false;*/
// If the above all match, then we need to check the DisplayTargets
foreach (PathTarget myTargetDisplay in TargetDisplays)
{
if (!other.TargetDisplays.Contains(myTargetDisplay))
return false;
}
/*foreach (PathTarget theirTargetDisplay in other.TargetDisplays)
{
if (!TargetDisplays.Contains(theirTargetDisplay))
return false;
}*/
return true;
}
else