[WIP] Basic working DisplayProfile writing and reading

Now have the DisplayProfile storing the minimal set of
data that it needs. It also recreates the Screens list (used
for creating profile bitmaps and icons) and recreates the
DisplayProfileBitmaps each time at present. I will add some
logic to deerialise the bitmaps again at a later date once
I've compeleted actually applying the AMD display confs.
This commit is contained in:
Terry MacDonald
2021-06-27 13:53:00 +12:00
parent 240c69fcdb
commit 04a0b56b59
6 changed files with 736 additions and 656 deletions

View File

@ -25,14 +25,17 @@ namespace DisplayMagicianShared
public string Library;
public bool IsPrimary;
public Color Colour;
public string DisplayConnector;
internal bool HDRSupported;
internal bool HDREnabled;
public List<string> Features;
// If the screen is AMD Eyefinity or NVIDIA Surround or similar, it has screens that are part of it
// These two fields indicate this. THe spanned screens are added to the SpannedScreens field
// These fields indicate this. THe spanned screens are added to the SpannedScreens field
public bool IsSpanned;
public string SpannedName;
public List<SpannedScreenPosition> SpannedScreens;
public int SpannedColumns;
public int SpannedRows;
public string DisplayConnector;
}
public struct SpannedScreenPosition
@ -178,7 +181,7 @@ namespace DisplayMagicianShared
}
}
public virtual string Driver { get; } = "Unknown";
public virtual string Driver { get; } = "Unknown";
public Keys Hotkey {
get
@ -195,7 +198,7 @@ namespace DisplayMagicianShared
//public Topology.Path[] Paths { get; set; } = new Topology.Path[0];
//public virtual object ProfileData { get; set; }
//public virtual ProfileData { get; set; }
[JsonIgnore]
public virtual ProfileIcon ProfileIcon
@ -217,7 +220,6 @@ namespace DisplayMagicianShared
}
[JsonIgnore]
public virtual List<ScreenPosition> Screens
{
@ -229,6 +231,10 @@ namespace DisplayMagicianShared
}
return _screens;
}
set
{
_screens = value;
}
}
public string SavedProfileIconCacheFilename { get; set; }
@ -250,7 +256,8 @@ namespace DisplayMagicianShared
}
}
[JsonConverter(typeof(CustomBitmapConverter))]
//[JsonConverter(typeof(CustomBitmapConverter))]
[JsonIgnore]
public virtual Bitmap ProfileBitmap
{
get
@ -270,8 +277,9 @@ namespace DisplayMagicianShared
}
[JsonConverter(typeof(CustomBitmapConverter))]
public Bitmap ProfileTightestBitmap
//[JsonConverter(typeof(CustomBitmapConverter))]
[JsonIgnore]
public virtual Bitmap ProfileTightestBitmap
{
get
{
@ -368,6 +376,11 @@ namespace DisplayMagicianShared
return false;
}
public virtual bool PerformPostLoadingTasks()
{
return false;
}
// The public override for the Object.Equals
public override bool Equals(object obj)