Fixed Video mode detection without forced parameter

Accidentally broke the auto detection when no forced video command line option given. Now works again.
This commit is contained in:
Terry MacDonald 2021-09-03 22:15:23 +12:00
parent eef92abebf
commit 964d982bd1
2 changed files with 52 additions and 6 deletions

View File

@ -277,6 +277,16 @@ namespace DisplayMagician {
Console.WriteLine($"Forcing Windows CCD Video Library as '--force-video-library Windows' was provided on the commandline.");
logger.Info($"Forcing Windows CCD Video Library as '--force-video-library Windows' was provided on the commandline.");
}
else
{
ProfileRepository.ForcedVideoMode = FORCED_VIDEO_MODE.DETECT;
logger.Info($"Leaving DisplayMagician to detect the best Video Library to use.");
}
}
else
{
ProfileRepository.ForcedVideoMode = FORCED_VIDEO_MODE.DETECT;
logger.Info($"Leaving DisplayMagician to detect the best Video Library to use.");
}
var argumentShortcut = runShortcutCmd.Argument("\"SHORTCUT_UUID\"", "(required) The UUID of the shortcut to run from those stored in the shortcut library.").IsRequired();
@ -335,6 +345,16 @@ namespace DisplayMagician {
Console.WriteLine($"Forcing Windows CCD Video Library as '--force-video-library Windows' was provided on the commandline.");
logger.Info($"Forcing Windows CCD Video Library as '--force-video-library Windows' was provided on the commandline.");
}
else
{
ProfileRepository.ForcedVideoMode = FORCED_VIDEO_MODE.DETECT;
logger.Info($"Leaving DisplayMagician to detect the best Video Library to use.");
}
}
else
{
ProfileRepository.ForcedVideoMode = FORCED_VIDEO_MODE.DETECT;
logger.Info($"Leaving DisplayMagician to detect the best Video Library to use.");
}
var argumentProfile = runProfileCmd.Argument("\"Profile_UUID\"", "(required) The UUID of the profile to run from those stored in the profile file.").IsRequired();
@ -400,8 +420,17 @@ namespace DisplayMagician {
Console.WriteLine($"Forcing Windows CCD Video Library as '--force-video-library Windows' was provided on the commandline.");
logger.Info($"Forcing Windows CCD Video Library as '--force-video-library Windows' was provided on the commandline.");
}
else
{
ProfileRepository.ForcedVideoMode = FORCED_VIDEO_MODE.DETECT;
logger.Info($"Leaving DisplayMagician to detect the best Video Library to use.");
}
}
else
{
ProfileRepository.ForcedVideoMode = FORCED_VIDEO_MODE.DETECT;
logger.Info($"Leaving DisplayMagician to detect the best Video Library to use.");
}
//description and help text of the command.
createProfileCmd.Description = "Use this command to go directly to the create display profile screen.";
@ -453,6 +482,16 @@ namespace DisplayMagician {
Console.WriteLine($"Forcing Windows CCD Video Library as '--force-video-library Windows' was provided on the commandline.");
logger.Info($"Forcing Windows CCD Video Library as '--force-video-library Windows' was provided on the commandline.");
}
else
{
ProfileRepository.ForcedVideoMode = FORCED_VIDEO_MODE.DETECT;
logger.Info($"Leaving DisplayMagician to detect the best Video Library to use.");
}
}
else
{
ProfileRepository.ForcedVideoMode = FORCED_VIDEO_MODE.DETECT;
logger.Info($"Leaving DisplayMagician to detect the best Video Library to use.");
}
logger.Debug($"No commandline command was invoked, so starting up normally");

View File

@ -152,6 +152,8 @@ namespace DisplayMagicianShared.Windows
public override void RefreshPossbility()
{
// Check whether this profile is possible
if (ProfileRepository.CurrentVideoMode == VIDEO_MODE.WINDOWS && WinLibrary.GetLibrary().IsInstalled)
{
if (WinLibrary.GetLibrary().IsPossibleConfig(_windowsDisplayConfig))
{
@ -164,8 +166,13 @@ namespace DisplayMagicianShared.Windows
SharedLogger.logger.Debug($"ProfileRepository/IsPossibleRefresh: The Windows CCD profile {Name} is NOT possible!");
_isPossible = false;
}
}
else
{
_isPossible = false;
}
}
// Actually set this profile active
public override bool SetActive()