MythTV
master
|
#include <mythdisplay.h>
Public Slots | |
virtual void | ScreenChanged (QScreen *qScreen) |
The actual screen in use has changed. We must use it. More... | |
static void | PrimaryScreenChanged (QScreen *qScreen) |
void | ScreenAdded (QScreen *qScreen) |
void | ScreenRemoved (QScreen *qScreen) |
void | PhysicalDPIChanged (qreal DPI) |
static void | GeometryChanged (QRect Geometry) |
Signals | |
void | CurrentScreenChanged (QScreen *qScreen) |
void | ScreenCountChanged (int Screens) |
void | CurrentDPIChanged (qreal DPI) |
Public Member Functions | |
virtual bool | VideoModesAvailable () |
virtual bool | UsingVideoModes () |
virtual bool | IsPlanar () |
virtual const MythDisplayModes & | GetVideoModes () |
QStringList | GetDescription () |
QRect | GetScreenBounds () |
QScreen * | GetCurrentScreen () |
Return a pointer to the screen to use. More... | |
double | GetPixelAspectRatio () |
QSize | GetGUIResolution () |
bool | NextModeIsLarger (QSize Size) |
Check whether the next mode is larger in size than the current mode. More... | |
void | SwitchToDesktop () |
Return the screen to the original desktop video mode. More... | |
bool | SwitchToGUI (bool Wait=false) |
Switches to the GUI resolution. More... | |
bool | SwitchToVideo (QSize Size, double Rate=0.0) |
Switches to the resolution and refresh rate defined in the database for the specified video resolution and frame rate. More... | |
QSize | GetResolution () |
QSize | GetPhysicalSize () |
double | GetRefreshRate () const |
std::chrono::microseconds | GetRefreshInterval (std::chrono::microseconds Fallback) const |
double | GetAspectRatio (QString &Source, bool IgnoreModeOverride=false) |
Returns current screen aspect ratio. More... | |
double | EstimateVirtualAspectRatio () |
Estimate the overall display aspect ratio for multi screen setups. More... | |
MythEDID & | GetEDID () |
MythDisplayRates | GetRefreshRates (QSize Size) |
MythHDRPtr | GetHDRState () |
Static Public Member Functions | |
static void | ConfigureQtGUI (int SwapInterval, const MythCommandLineParser &CmdLine) |
Shared static initialistaion code for all MythTV GUI applications. More... | |
static bool | SpanAllScreens () |
Return true if the MythTV windows should span all screens. More... | |
static QString | GetExtraScreenInfo (QScreen *qScreen) |
static int | GetScreenCount () |
Protected Member Functions | |
MythDisplay () | |
~MythDisplay () override | |
virtual void | UpdateCurrentMode () |
Retrieve screen details. More... | |
virtual bool | SwitchToVideoMode (QSize Size, double Framerate) |
void | DebugModes () const |
void | SetWidget (QWidget *MainWindow) |
Set the QWidget and QWindow in use. More... | |
void | Initialise () |
void | InitScreenBounds () |
Get screen size from Qt while respecting the user's multiscreen settings. More... | |
void | WaitForScreenChange () |
void | WaitForNewScreen () |
void | InitHDR () |
Static Protected Member Functions | |
static MythDisplay * | Create (MythMainWindow *MainWindow) |
Create a MythDisplay object appropriate for the current platform. More... | |
static QScreen * | GetDesiredScreen () |
static void | DebugScreen (QScreen *qScreen, const QString &Message) |
Protected Attributes | |
bool | m_waitForModeChanges { true } |
bool | m_modeComplete { false } |
double | m_refreshRate { 0.0 } |
double | m_aspectRatioOverride { 0.0 } |
QSize | m_resolution { 0, 0 } |
QSize | m_physicalSize { 0, 0 } |
MythEDID | m_edid { } |
QWidget * | m_widget { nullptr } |
QWindow * | m_window { nullptr } |
QScreen * | m_screen { nullptr } |
MythDisplayModes | m_videoModes { } |
MythHDRPtr | m_hdrState { nullptr } |
MythVRRPtr | m_vrrState { nullptr } |
Static Private Member Functions | |
static void | PauseForModeSwitch () |
Private Attributes | |
bool | m_initialised { false } |
bool | m_firstScreenChange { true } |
QRect | m_screenBounds { } |
MythDisplayMode | m_desktopMode { } |
MythDisplayMode | m_guiMode { } |
MythDisplayMode | m_videoMode { } |
DisplayModeMap | m_overrideVideoModes { } |
Friends | |
class | MythMainWindow |
MythDisplay is a wrapper around platform dependant display functionality. It can only be created by MythMainWindow and the single instance is owned by the MythMainWindow object.
Definition at line 22 of file mythdisplay.h.
|
protected |
Definition at line 211 of file mythdisplay.cpp.
Referenced by Create().
|
overrideprotected |
Definition at line 230 of file mythdisplay.cpp.
|
inlinevirtual |
Reimplemented in MythDisplayRPI, MythDisplayOSX, MythDisplayMutter, MythDisplayDRM, and MythDisplayX11.
Definition at line 29 of file mythdisplay.h.
Referenced by AppearanceSettings::AppearanceSettings(), and Create().
|
inlinevirtual |
Reimplemented in MythDisplayRPI, MythDisplayOSX, MythDisplayMutter, MythDisplayDRM, and MythDisplayX11.
Definition at line 30 of file mythdisplay.h.
Referenced by TV::DoEditSchedule(), MythVideoOutputGPU::Init(), MythMainWindow::MythMainWindow(), MythVideoOutputGPU::ResizeForVideo(), and TV::~TV().
|
inlinevirtual |
Reimplemented in MythDisplayDRM.
Definition at line 31 of file mythdisplay.h.
Referenced by MythVideoOutputGPU::MythVideoOutputGPU().
|
virtual |
Reimplemented in MythDisplayMutter, MythDisplayRPI, MythDisplayOSX, MythDisplayDRM, and MythDisplayX11.
Definition at line 845 of file mythdisplay.cpp.
Referenced by AppearanceSettings::AppearanceSettings(), GetDescription(), GetRefreshRates(), GuiVidModeResolution(), SwitchToVideo(), and TVVidModeResolution().
|
static |
Shared static initialistaion code for all MythTV GUI applications.
Definition at line 1155 of file mythdisplay.cpp.
Referenced by main().
|
static |
Return true if the MythTV windows should span all screens.
Definition at line 493 of file mythdisplay.cpp.
Referenced by GetAspectRatio(), GetDescription(), GetDesiredScreen(), InitScreenBounds(), and MythVideoBounds::PopulateGeometry().
|
static |
Definition at line 498 of file mythdisplay.cpp.
Referenced by DebugScreen(), InitScreenBounds(), and AppearanceSettings::PopulateScreens().
QStringList MythDisplay::GetDescription | ( | ) |
Definition at line 138 of file mythdisplay.cpp.
Referenced by StatusBox::doDisplayStatus().
QRect MythDisplay::GetScreenBounds | ( | ) |
Definition at line 309 of file mythdisplay.cpp.
Referenced by GetDescription(), TV::Init(), and MythUIScreenBounds::UpdateScreenSettings().
QScreen * MythDisplay::GetCurrentScreen | ( | ) |
Return a pointer to the screen to use.
This function looks at the users screen preference, and will return that screen if possible. If not, i.e. the screen isn't plugged in, then this function returns the system's primary screen.
Note: There is no special case here for the case of MythTV spanning all screens, as all screen have access to the virtual desktop attributes. The check for spanning screens must be made when the screen size/geometry accessed, and the proper physical/virtual size/geometry retrieved.
Definition at line 326 of file mythdisplay.cpp.
Referenced by MythVRR::Create(), GetDescription(), MythVideoBounds::PopulateGeometry(), and UpdateCurrentMode().
|
static |
Definition at line 290 of file mythdisplay.cpp.
Referenced by AppearanceSettings::AppearanceSettings(), GetAspectRatio(), GetDescription(), InitScreenBounds(), and MythVideoBounds::PopulateGeometry().
double MythDisplay::GetPixelAspectRatio | ( | ) |
Definition at line 295 of file mythdisplay.cpp.
Referenced by MythUIScreenBounds::UpdateScreenSettings().
QSize MythDisplay::GetGUIResolution | ( | ) |
Definition at line 304 of file mythdisplay.cpp.
Referenced by TV::DoEditSchedule(), and TV::~TV().
bool MythDisplay::NextModeIsLarger | ( | QSize | Size | ) |
Check whether the next mode is larger in size than the current mode.
This is used to allow the caller to force an update of the main window to ensure the window is fully resized and is in no way clipped. Not an issue if the next mode is smaller.
Definition at line 669 of file mythdisplay.cpp.
Referenced by TV::DoEditSchedule(), MythVideoOutputGPU::ResizeForVideo(), and TV::~TV().
void MythDisplay::SwitchToDesktop | ( | ) |
Return the screen to the original desktop video mode.
Definition at line 678 of file mythdisplay.cpp.
Referenced by SetWidget(), and MythMainWindow::~MythMainWindow().
Switches to the GUI resolution.
Definition at line 771 of file mythdisplay.cpp.
Referenced by TV::DoEditSchedule(), MythMainWindow::MythMainWindow(), and TV::~TV().
bool MythDisplay::SwitchToVideo | ( | QSize | Size, |
double | Rate = 0.0 |
||
) |
Switches to the resolution and refresh rate defined in the database for the specified video resolution and frame rate.
Definition at line 689 of file mythdisplay.cpp.
Referenced by MythVideoOutputGPU::ResizeForVideo().
QSize MythDisplay::GetResolution | ( | ) |
Definition at line 1064 of file mythdisplay.cpp.
Referenced by GetDescription(), MythVideoOutputGPU::InitDisplayMeasurements(), and MythVideoOutputGPU::ResizeForVideo().
QSize MythDisplay::GetPhysicalSize | ( | ) |
Definition at line 1069 of file mythdisplay.cpp.
double MythDisplay::GetRefreshRate | ( | ) | const |
Definition at line 802 of file mythdisplay.cpp.
Referenced by GetDescription().
std::chrono::microseconds MythDisplay::GetRefreshInterval | ( | std::chrono::microseconds | Fallback | ) | const |
Definition at line 807 of file mythdisplay.cpp.
Referenced by MythPlayerUI::MythPlayerUI().
Returns current screen aspect ratio.
For the vast majority of cases we should be using the physical display size to compute the actual aspect ratio.
This is currently overridden by:-
If no override is specified and a valid physical aspect ratio cannot be calculated, then we fallback to the screen resolution (i.e. assume square pixels) and finally a guess at 16:9.
Definition at line 868 of file mythdisplay.cpp.
Referenced by GetDescription(), MythVideoBounds::InitBounds(), MythVideoOutputGPU::InitDisplayMeasurements(), and MythVideoOutputGPU::ResizeForVideo().
double MythDisplay::EstimateVirtualAspectRatio | ( | ) |
Estimate the overall display aspect ratio for multi screen setups.
Definition at line 966 of file mythdisplay.cpp.
Referenced by GetAspectRatio().
MythEDID & MythDisplay::GetEDID | ( | ) |
Definition at line 931 of file mythdisplay.cpp.
Referenced by MythVRR::Create(), MythCECAdapter::Open(), and MythDisplayX11::UpdateCurrentMode().
MythDisplayRates MythDisplay::GetRefreshRates | ( | QSize | Size | ) |
Definition at line 829 of file mythdisplay.cpp.
Referenced by HostRefreshRateComboBoxSetting::GetRefreshRates().
MythHDRPtr MythDisplay::GetHDRState | ( | ) |
Definition at line 936 of file mythdisplay.cpp.
Referenced by MythHDRTracker::Create().
|
virtualslot |
The actual screen in use has changed. We must use it.
Definition at line 421 of file mythdisplay.cpp.
Referenced by MythDisplayDRM::ScreenChanged(), and SetWidget().
|
staticslot |
Definition at line 442 of file mythdisplay.cpp.
Referenced by MythDisplay().
|
slot |
Definition at line 447 of file mythdisplay.cpp.
Referenced by MythDisplay().
|
slot |
Definition at line 453 of file mythdisplay.cpp.
Referenced by MythDisplay().
|
slot |
Definition at line 435 of file mythdisplay.cpp.
Referenced by MythDisplay(), ScreenChanged(), and MythVideoBounds::SetDisplay().
|
staticslot |
Definition at line 459 of file mythdisplay.cpp.
Referenced by MythDisplay(), and ScreenChanged().
|
signal |
Referenced by ScreenChanged(), and MythVideoBounds::SetDisplay().
|
signal |
Referenced by AppearanceSettings::AppearanceSettings(), ScreenAdded(), and ScreenRemoved().
|
signal |
Referenced by MythPainterGPU::MythPainterGPU(), and PhysicalDPIChanged().
|
staticprotected |
Create a MythDisplay object appropriate for the current platform.
Definition at line 83 of file mythdisplay.cpp.
Referenced by MythMainWindow::MythMainWindow().
|
protectedvirtual |
Retrieve screen details.
This is the final fallback when no other platform specifics are available It is usually accurate apart from the refresh rate - which is often rounded down.
Reimplemented in MythDisplayRPI, MythDisplayOSX, MythDisplayWindows, MythDisplayAndroid, MythDisplayMutter, MythDisplayDRM, and MythDisplayX11.
Definition at line 471 of file mythdisplay.cpp.
Referenced by Initialise(), SetWidget(), SwitchToGUI(), SwitchToVideo(), MythDisplayWindows::UpdateCurrentMode(), MythDisplayOSX::UpdateCurrentMode(), MythDisplayX11::UpdateCurrentMode(), MythDisplayRPI::UpdateCurrentMode(), MythDisplayDRM::UpdateCurrentMode(), and MythDisplayMutter::UpdateCurrentMode().
|
protectedvirtual |
Reimplemented in MythDisplayRPI, MythDisplayMutter, MythDisplayDRM, MythDisplayX11, and MythDisplayOSX.
Definition at line 840 of file mythdisplay.cpp.
Referenced by SwitchToDesktop(), SwitchToGUI(), and SwitchToVideo().
|
protected |
Definition at line 1130 of file mythdisplay.cpp.
Referenced by MythDisplayOSX::GetVideoModes(), MythDisplayX11::GetVideoModes(), MythDisplayRPI::GetVideoModes(), MythDisplayDRM::GetVideoModes(), and MythDisplayMutter::GetVideoModes().
|
protected |
Set the QWidget and QWindow in use.
Certain platform implementations need to know the QWidget and/or QWindow to access display information. We also connect to the QWindow::screenChanged signal so that we are informed when the window has been moved into a new screen.
Definition at line 248 of file mythdisplay.cpp.
Referenced by MythMainWindow::Init().
|
staticprotected |
Definition at line 331 of file mythdisplay.cpp.
Referenced by MythDisplay(), and SetWidget().
|
staticprotected |
Definition at line 509 of file mythdisplay.cpp.
Referenced by MythDisplay(), PrimaryScreenChanged(), ScreenAdded(), ScreenChanged(), and SetWidget().
|
protected |
Definition at line 531 of file mythdisplay.cpp.
Referenced by MythDisplayAndroid::MythDisplayAndroid(), MythDisplayDRM::MythDisplayDRM(), MythDisplayMutter::MythDisplayMutter(), MythDisplayOSX::MythDisplayOSX(), MythDisplayRPI::MythDisplayRPI(), MythDisplayWindows::MythDisplayWindows(), MythDisplayX11::MythDisplayX11(), and ScreenChanged().
|
protected |
Get screen size from Qt while respecting the user's multiscreen settings.
If the windowing system environment has multiple screens, then use QScreen::virtualSize() to get the size of the virtual desktop. Otherwise QScreen::size() or QScreen::availableSize() will provide the size of an individual screen.
Definition at line 609 of file mythdisplay.cpp.
Referenced by Initialise(), and SetWidget().
|
protected |
Definition at line 1074 of file mythdisplay.cpp.
Referenced by SwitchToGUI(), and SwitchToVideo().
|
protected |
Definition at line 1093 of file mythdisplay.cpp.
Referenced by SetWidget().
|
protected |
Definition at line 941 of file mythdisplay.cpp.
Referenced by Initialise().
|
staticprivate |
Definition at line 1113 of file mythdisplay.cpp.
Referenced by SwitchToVideo().
|
friend |
Definition at line 26 of file mythdisplay.h.
Definition at line 88 of file mythdisplay.h.
Referenced by MythDisplayRPI::MythDisplayRPI(), and WaitForScreenChange().
Definition at line 89 of file mythdisplay.h.
Referenced by SetWidget(), SwitchToGUI(), SwitchToVideo(), MythDisplayAndroid::UpdateCurrentMode(), MythDisplayWindows::UpdateCurrentMode(), MythDisplayOSX::UpdateCurrentMode(), MythDisplayX11::UpdateCurrentMode(), MythDisplayRPI::UpdateCurrentMode(), MythDisplayDRM::UpdateCurrentMode(), UpdateCurrentMode(), and MythDisplayMutter::UpdateCurrentMode().
|
protected |
Definition at line 90 of file mythdisplay.h.
Referenced by GetRefreshInterval(), GetRefreshRate(), Initialise(), SwitchToDesktop(), SwitchToGUI(), SwitchToVideo(), MythDisplayAndroid::UpdateCurrentMode(), MythDisplayWindows::UpdateCurrentMode(), MythDisplayOSX::UpdateCurrentMode(), MythDisplayX11::UpdateCurrentMode(), MythDisplayRPI::UpdateCurrentMode(), MythDisplayDRM::UpdateCurrentMode(), UpdateCurrentMode(), and MythDisplayMutter::UpdateResources().
|
protected |
Definition at line 91 of file mythdisplay.h.
Referenced by GetAspectRatio(), SwitchToGUI(), and SwitchToVideo().
|
protected |
Definition at line 92 of file mythdisplay.h.
Referenced by GetAspectRatio(), GetPixelAspectRatio(), GetResolution(), MythDisplayRPI::GetVideoModes(), Initialise(), NextModeIsLarger(), SwitchToDesktop(), SwitchToGUI(), SwitchToVideo(), MythDisplayAndroid::UpdateCurrentMode(), MythDisplayWindows::UpdateCurrentMode(), MythDisplayOSX::UpdateCurrentMode(), MythDisplayX11::UpdateCurrentMode(), MythDisplayRPI::UpdateCurrentMode(), MythDisplayDRM::UpdateCurrentMode(), UpdateCurrentMode(), and MythDisplayMutter::UpdateResources().
|
protected |
Definition at line 93 of file mythdisplay.h.
Referenced by GetAspectRatio(), GetPhysicalSize(), GetPixelAspectRatio(), Initialise(), SwitchToDesktop(), SwitchToVideo(), MythDisplayAndroid::UpdateCurrentMode(), MythDisplayWindows::UpdateCurrentMode(), MythDisplayOSX::UpdateCurrentMode(), MythDisplayX11::UpdateCurrentMode(), MythDisplayRPI::UpdateCurrentMode(), MythDisplayDRM::UpdateCurrentMode(), UpdateCurrentMode(), and MythDisplayMutter::UpdateResources().
|
protected |
Definition at line 94 of file mythdisplay.h.
Referenced by MythDisplayRPI::GetEDID(), MythDisplayX11::GetEDID(), GetEDID(), InitHDR(), Initialise(), MythDisplayRPI::SwitchToVideoMode(), MythDisplayOSX::UpdateCurrentMode(), MythDisplayRPI::UpdateCurrentMode(), MythDisplayDRM::UpdateCurrentMode(), UpdateCurrentMode(), and MythDisplayMutter::UpdateResources().
|
protected |
Definition at line 95 of file mythdisplay.h.
Referenced by SetWidget(), MythDisplayWindows::UpdateCurrentMode(), MythDisplayOSX::UpdateCurrentMode(), and WaitForNewScreen().
|
protected |
Definition at line 96 of file mythdisplay.h.
Referenced by SetWidget().
|
protected |
Definition at line 97 of file mythdisplay.h.
Referenced by EstimateVirtualAspectRatio(), GetCurrentScreen(), MythDisplayX11::GetEDID(), MythDisplayX11::GetVideoModes(), MythDisplayDRM::GetVideoModes(), InitScreenBounds(), MythDisplay(), MythDisplayDRM::MythDisplayDRM(), MythDisplayDRM::ScreenChanged(), ScreenChanged(), SetWidget(), MythDisplayDRM::SwitchToVideoMode(), MythDisplayX11::UpdateCurrentMode(), MythDisplayMutter::UpdateResources(), and WaitForScreenChange().
|
protected |
Definition at line 98 of file mythdisplay.h.
Referenced by MythDisplayOSX::ClearModes(), DebugModes(), MythDisplayOSX::GetVideoModes(), MythDisplayX11::GetVideoModes(), MythDisplayRPI::GetVideoModes(), MythDisplayDRM::GetVideoModes(), GetVideoModes(), MythDisplayMutter::GetVideoModes(), Initialise(), MythDisplayOSX::SwitchToVideoMode(), MythDisplayX11::SwitchToVideoMode(), MythDisplayRPI::SwitchToVideoMode(), MythDisplayDRM::SwitchToVideoMode(), and MythDisplayMutter::SwitchToVideoMode().
|
protected |
Definition at line 99 of file mythdisplay.h.
Referenced by GetDescription(), GetHDRState(), and InitHDR().
|
protected |
Definition at line 100 of file mythdisplay.h.
Referenced by GetDescription(), GetRefreshInterval(), Initialise(), and SwitchToVideo().
Definition at line 106 of file mythdisplay.h.
Referenced by Initialise(), and SetWidget().
Definition at line 107 of file mythdisplay.h.
Referenced by SetWidget().
|
private |
Definition at line 108 of file mythdisplay.h.
Referenced by GetScreenBounds(), and InitScreenBounds().
|
private |
Definition at line 109 of file mythdisplay.h.
Referenced by Initialise(), and SwitchToDesktop().
|
private |
Definition at line 110 of file mythdisplay.h.
Referenced by GetGUIResolution(), Initialise(), and SwitchToGUI().
|
private |
Definition at line 111 of file mythdisplay.h.
Referenced by Initialise(), and SwitchToVideo().
|
private |
Definition at line 112 of file mythdisplay.h.
Referenced by Initialise(), and SwitchToVideo().