From 46b42aae13ba56c5a9c000e09d4165169638f410 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 24 Feb 2014 19:55:13 +0100 Subject: m + info: add section: hardware detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- TODO | 4 ++-- info/blueshift.texinfo | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ src/monitor.py | 1 + 3 files changed, 52 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index ef04ba3..5cff61b 100644 --- a/TODO +++ b/TODO @@ -1,12 +1,12 @@ High priority: - Document and add to examples: list_screens, Screens, Screen and Output + Add to examples: list_screens, Screens, Screen and Output Do all transitions form current settings and include that in fade time calculation, unless we have stored settings handled by the configuration script that are correct Medium priority: Small examples -r support in the comperhensive example - Complete support for EDID + Finish support for EDID Low priority: Fix errors caused by SIGUSR2 diff --git a/info/blueshift.texinfo b/info/blueshift.texinfo index 0851413..1d37bbd 100644 --- a/info/blueshift.texinfo +++ b/info/blueshift.texinfo @@ -284,6 +284,7 @@ Disables or enables Blueshift. * Custom colour curve manipulators:: Creating custom colour adjustment functions * Preexisting adjustments:: Using preexisting adjustment, in use and ICC * Applying colour curves:: Appying colour adjustments to the video drivers +* Hardware detection:: Detecting connected monitors * Continuous mode:: Creating continuous mode configurations * Solar time:: Solar functions, such as elevation calcuation @end menu @@ -634,6 +635,54 @@ that were applied at the time of invokation of working curves. +@node Hardware detection +@section Hardware detection + +To support multiple monitors in a dynamic way, +the function @code{list_screens} can be used. +@code{list_screens} is parameterless and returns +the an instance of the class @code{Screens}. +Instances of @code{Screens} have one varible: +@code{screens}, a list of instances of the class +@code{Screen}. The index of each screens is their +index in @code{screens}. + +Instances of the class @code{Screen} have two +varibles: @code{crtc_count}, the number of CRT +controllers used within the screen, and +@code{outputs}, a list of all output ports as +instances of the class @code{Output}. Instances +of @code{Output} have six variables: + +@table @code +@item name +The name of the output port. + +@item connected +Whether the output is known to be connected +to a monitor. + +@item widthmm +The physical width of the monitor, measured +in millimetres. @code{None} if unknown or if +not connected. + +@item heightmm +The physical height of the monitor, measured +in millimetres. @code{None} if unknown or if +not connected. + +@item crtc +The CRT controller index. @code{none} if not +connected. + +@item screen +The screen index. @code{none} if not +used. + +@end table + + @node Applying colour curves @section Applying colour curves diff --git a/src/monitor.py b/src/monitor.py index 67c2c16..f09db6d 100644 --- a/src/monitor.py +++ b/src/monitor.py @@ -365,6 +365,7 @@ class Output: @variable widthmm:int? The physical width of the monitor, measured in millimetres, `None` if unknown or not connected @variable heigthmm:int? The physical height of the monitor, measured in millimetres, `None` if unknown or not connected @variable crtc:int? The CRTC index, `None` if not connected + @variable screen:int? The screen index, `None` if none ''' def __init__(self): ''' -- cgit v1.2.3-70-g09d2