/// <summary> /// Retrieve the topology overlap limits /// </summary> /// <returns></returns> public OverlapLimit GetOverlapLimits() { int minX; int maxX; int minY; int maxY; var brief = GetTopologyBrief(); var displaySettingsV2 = GetDisplaySettingsV2(); try { MosaicApi.GetOverlapLimits(brief, displaySettingsV2, out minX, out maxX, out minY, out maxY); return(new OverlapLimit(minX, maxX, minY, maxY)); } catch (NVIDIAApiException ex) { if (ex.Status != Status.IncompatibleStructureVersion) { throw; } } catch (NVIDIANotSupportedException) { // ignore } var displaySettingsV1 = GetDisplaySettingsV1(); MosaicApi.GetOverlapLimits(brief, displaySettingsV1, out minX, out maxX, out minY, out maxY); return(new OverlapLimit(minX, maxX, minY, maxY)); }
/// <summary> /// Sets this topology as the current topology /// </summary> /// <param name="apply">if true, will apply the topology right now</param> public void SetAsCurrentTopology(bool apply = false) { var brief = GetTopologyBrief(); var displaySettingsV2 = GetDisplaySettingsV2(); try { MosaicApi.SetCurrentTopology(brief, displaySettingsV2, Overlap.HorizontalOverlap, Overlap.VerticalOverlap, apply); } catch (NVIDIAApiException ex) { if (ex.Status != Status.IncompatibleStructureVersion) { throw; } } catch (NVIDIANotSupportedException) { // ignore } var displaySettingsV1 = GetDisplaySettingsV1(); MosaicApi.SetCurrentTopology(brief, displaySettingsV1, Overlap.HorizontalOverlap, Overlap.VerticalOverlap, apply); }
/// <summary> /// Validates a list of grid topologies /// </summary> /// <param name="grids">An array of grid topologies to validate</param> /// <param name="flags">SetDisplayTopologyFlag flag</param> /// <returns>An array of DisplayTopologyStatus object containing the result of the validation</returns> public static DisplayTopologyStatus[] ValidateGridTopologies( GridTopology[] grids, SetDisplayTopologyFlag flags = SetDisplayTopologyFlag.AllowInvalid) { var gridTopologyV2 = grids.Select(grid => grid.GetGridTopologyV2()).Cast <IGridTopology>().ToArray(); try { return(MosaicApi.ValidateDisplayGrids(gridTopologyV2, flags)); } catch (NVIDIAApiException ex) { if (ex.Status != Status.IncompatibleStructureVersion) { throw; } } catch (NVIDIANotSupportedException) { // ignore } var gridTopologyV1 = grids.Select(grid => grid.GetGridTopologyV1()).Cast <IGridTopology>().ToArray(); return(MosaicApi.ValidateDisplayGrids(gridTopologyV1, flags)); }
/// <summary> /// Applies the requested grid topologies /// </summary> /// <param name="grids">An array of grid topologies to apply</param> /// <param name="flags">SetDisplayTopologyFlag flag</param> public static void SetGridTopologies( GridTopology[] grids, SetDisplayTopologyFlag flags = SetDisplayTopologyFlag.NoFlag) { var gridTopologyV2 = grids.Select(grid => grid.GetGridTopologyV2()).Cast <IGridTopology>().ToArray(); try { MosaicApi.SetDisplayGrids(gridTopologyV2, flags); } catch (NVIDIAApiException ex) { if (ex.Status != Status.IncompatibleStructureVersion) { throw; } } catch (NVIDIANotSupportedException) { // ignore } var gridTopologyV1 = grids.Select(grid => grid.GetGridTopologyV1()).Cast <IGridTopology>().ToArray(); MosaicApi.SetDisplayGrids(gridTopologyV1, flags); }
/// <summary> /// Retrieves all the supported topology modes that are now possible to apply /// </summary> /// <param name="type">The type of the topology mode to limit quary</param> /// <returns>An array of Topology modes</returns> public static Native.Mosaic.Topology[] GetSupportedTopologyModes(TopologyType type = TopologyType.All) { return (MosaicApi.GetSupportedTopologiesInfo(type) .TopologyBriefs.Where(topologyBrief => topologyBrief.IsPossible) .Select(topologyBrief => topologyBrief.Topology) .ToArray()); }
/// <summary> /// Retrieves topology details /// </summary> /// <returns>An array of TopologyDetails</returns> public TopologyDetails[] GetDetails() { var brief = GetTopologyBrief(); return (MosaicApi.GetTopologyGroup(brief) .TopologyDetails.Select(detail => new TopologyDetails(detail)) .ToArray()); }
/// <summary> /// Indicates if the current topology is possible to apply /// </summary> /// <returns>true if the current topology is possible to apply, otherwise false</returns> public static bool IsCurrentTopologyPossible() { TopologyBrief brief; IDisplaySettings displaySettings; int overlapX; int overlapY; MosaicApi.GetCurrentTopology(out brief, out displaySettings, out overlapX, out overlapY); return(brief.IsPossible); }
/// <summary> /// Returns the current topology settings /// </summary> /// <returns>The current Topology object</returns> public static Topology GetCurrentTopology() { TopologyBrief brief; IDisplaySettings displaySettings; int overlapX; int overlapY; MosaicApi.GetCurrentTopology(out brief, out displaySettings, out overlapX, out overlapY); return (new Topology( new Resolution(displaySettings.Width, displaySettings.Height, displaySettings.BitsPerPixel), displaySettings.Frequency, displaySettings.FrequencyInMillihertz, brief.Topology, new Overlap(overlapX, overlapY))); }
/// <summary> /// Retrieves a list of possible display settings for this topology /// </summary> /// <returns>An array of IDisplaySettings implamented objects</returns> public IDisplaySettings[] GetPossibleDisplaySettings() { var gridTopologyV2 = GetGridTopologyV2(); try { return(MosaicApi.EnumDisplayModes(gridTopologyV2)); } catch (NVIDIAApiException ex) { if (ex.Status != Status.IncompatibleStructureVersion) { throw; } } catch (NVIDIANotSupportedException) { // ignore } var gridTopologyV1 = GetGridTopologyV1(); return(MosaicApi.EnumDisplayModes(gridTopologyV1)); }
/// <summary> /// Retrieves all the supported display settings /// </summary> /// <param name="type">The type of the topology mode to limit quary</param> /// <returns>An array of IDisplaySettings implamented objects</returns> public static IDisplaySettings[] GetSupportedTopologySettings(TopologyType type = TopologyType.All) { return(MosaicApi.GetSupportedTopologiesInfo(type).DisplaySettings.ToArray()); }
/// <summary> /// Enables the current topology /// </summary> public static void EnableCurrent() { MosaicApi.EnableCurrentTopology(true); }
/// <summary> /// Disables the current topology /// </summary> public static void DisableCurrent() { MosaicApi.EnableCurrentTopology(false); }
/// <summary> /// Retrieves a list of currently active mosaic grid topologies /// </summary> /// <returns>An array of GridTopology objects</returns> public static GridTopology[] GetGridTopologies() { return(MosaicApi.EnumDisplayGrids().Select(topology => new GridTopology(topology)).ToArray()); }