Пример #1
0
        /// <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));
        }
Пример #2
0
        /// <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);
        }
Пример #3
0
        /// <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));
        }
Пример #4
0
        /// <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);
        }
Пример #5
0
 /// <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());
 }
Пример #6
0
        /// <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());
        }
Пример #7
0
        /// <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);
        }
Пример #8
0
        /// <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)));
        }
Пример #9
0
        /// <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));
        }
Пример #10
0
 /// <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());
 }
Пример #11
0
 /// <summary>
 ///     Enables the current topology
 /// </summary>
 public static void EnableCurrent()
 {
     MosaicApi.EnableCurrentTopology(true);
 }
Пример #12
0
 /// <summary>
 ///     Disables the current topology
 /// </summary>
 public static void DisableCurrent()
 {
     MosaicApi.EnableCurrentTopology(false);
 }
Пример #13
0
 /// <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());
 }