|
MythTV master
|
#include <libmythui/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 initialisation 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 215 of file mythdisplay.cpp.
Referenced by Create().
|
overrideprotected |
Definition at line 234 of file mythdisplay.cpp.
|
static |
Shared static initialisation code for all MythTV GUI applications.
Definition at line 1164 of file mythdisplay.cpp.
Referenced by main().
|
staticprotected |
Create a MythDisplay object appropriate for the current platform.
Definition at line 89 of file mythdisplay.cpp.
|
signal |
Referenced by MythPainterGPU::MythPainterGPU(), and PhysicalDPIChanged().
|
signal |
Referenced by ScreenChanged(), and MythVideoBounds::SetDisplay().
|
protected |
Definition at line 1139 of file mythdisplay.cpp.
Referenced by MythDisplayDRM::GetVideoModes(), MythDisplayX11::GetVideoModes(), MythDisplayMutter::GetVideoModes(), MythDisplayOSX::GetVideoModes(), and MythDisplayRPI::GetVideoModes().
|
staticprotected |
Definition at line 517 of file mythdisplay.cpp.
Referenced by MythDisplay(), PrimaryScreenChanged(), ScreenAdded(), ScreenChanged(), and SetWidget().
| double MythDisplay::EstimateVirtualAspectRatio | ( | ) |
Estimate the overall display aspect ratio for multi screen setups.
Definition at line 975 of file mythdisplay.cpp.
Referenced by GetAspectRatio().
|
staticslot |
Definition at line 467 of file mythdisplay.cpp.
Referenced by MythDisplay(), and ScreenChanged().
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 877 of file mythdisplay.cpp.
Referenced by GetDescription(), MythVideoBounds::InitBounds(), MythVideoOutputGPU::InitDisplayMeasurements(), and MythVideoOutputGPU::ResizeForVideo().
| 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 334 of file mythdisplay.cpp.
Referenced by MythVRR::Create(), GetDescription(), MythVideoBounds::PopulateGeometry(), and UpdateCurrentMode().
| QStringList MythDisplay::GetDescription | ( | void | ) |
Definition at line 142 of file mythdisplay.cpp.
Referenced by StatusBox::doDisplayStatus().
|
staticprotected |
Definition at line 339 of file mythdisplay.cpp.
Referenced by SetWidget().
| MythEDID & MythDisplay::GetEDID | ( | void | ) |
Definition at line 940 of file mythdisplay.cpp.
Referenced by MythVRR::Create(), MythCECAdapter::Open(), and MythDisplayX11::UpdateCurrentMode().
|
static |
Definition at line 506 of file mythdisplay.cpp.
Referenced by DebugScreen(), InitScreenBounds(), and AppearanceSettings::PopulateScreens().
| QSize MythDisplay::GetGUIResolution | ( | ) |
Definition at line 312 of file mythdisplay.cpp.
Referenced by TV::DoEditSchedule(), and TV::~TV().
| MythHDRPtr MythDisplay::GetHDRState | ( | ) |
Definition at line 945 of file mythdisplay.cpp.
Referenced by MythHDRTracker::Create().
| QSize MythDisplay::GetPhysicalSize | ( | ) |
Definition at line 1078 of file mythdisplay.cpp.
| double MythDisplay::GetPixelAspectRatio | ( | ) |
Definition at line 299 of file mythdisplay.cpp.
Referenced by MythUIScreenBounds::UpdateScreenSettings().
| std::chrono::microseconds MythDisplay::GetRefreshInterval | ( | std::chrono::microseconds | Fallback | ) | const |
Definition at line 816 of file mythdisplay.cpp.
Referenced by MythPlayerUI::MythPlayerUI().
| double MythDisplay::GetRefreshRate | ( | ) | const |
Definition at line 811 of file mythdisplay.cpp.
Referenced by GetDescription(), and MythPlayerUI::GetPlaybackData().
| MythDisplayRates MythDisplay::GetRefreshRates | ( | QSize | Size | ) |
Definition at line 838 of file mythdisplay.cpp.
Referenced by HostRefreshRateComboBoxSetting::GetRefreshRates().
| QSize MythDisplay::GetResolution | ( | ) |
Definition at line 1073 of file mythdisplay.cpp.
Referenced by GetDescription(), MythPlayerUI::GetPlaybackData(), MythVideoOutputGPU::InitDisplayMeasurements(), and MythVideoOutputGPU::ResizeForVideo().
| QRect MythDisplay::GetScreenBounds | ( | ) |
Definition at line 317 of file mythdisplay.cpp.
Referenced by GetDescription(), TV::Init(), and MythUIScreenBounds::UpdateScreenSettings().
|
static |
Definition at line 294 of file mythdisplay.cpp.
Referenced by AppearanceSettings::AppearanceSettings(), GetAspectRatio(), GetDescription(), InitScreenBounds(), and MythVideoBounds::PopulateGeometry().
|
virtual |
Reimplemented in MythDisplayDRM, MythDisplayX11, MythDisplayMutter, MythDisplayOSX, and MythDisplayRPI.
Definition at line 854 of file mythdisplay.cpp.
Referenced by AppearanceSettings::AppearanceSettings(), GetDescription(), GetRefreshRates(), GuiVidModeResolution(), SwitchToVideo(), and TVVidModeResolution().
|
protected |
Definition at line 950 of file mythdisplay.cpp.
Referenced by Initialise().
|
protected |
Definition at line 539 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 617 of file mythdisplay.cpp.
Referenced by Initialise(), and SetWidget().
|
inlinevirtual |
Reimplemented in MythDisplayDRM.
Definition at line 31 of file mythdisplay.h.
Referenced by MythVideoOutputGPU::MythVideoOutputGPU().
| 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 678 of file mythdisplay.cpp.
Referenced by TV::DoEditSchedule(), MythVideoOutputGPU::ResizeForVideo(), and TV::~TV().
|
staticprivate |
Definition at line 1122 of file mythdisplay.cpp.
Referenced by SwitchToVideo().
|
slot |
Definition at line 443 of file mythdisplay.cpp.
Referenced by MythDisplay(), ScreenChanged(), and MythVideoBounds::SetDisplay().
|
staticslot |
Definition at line 450 of file mythdisplay.cpp.
Referenced by MythDisplay().
|
slot |
Definition at line 455 of file mythdisplay.cpp.
Referenced by MythDisplay().
|
virtualslot |
The actual screen in use has changed. We must use it.
Definition at line 429 of file mythdisplay.cpp.
Referenced by MythDisplayDRM::ScreenChanged(), and SetWidget().
|
signal |
Referenced by AppearanceSettings::AppearanceSettings(), ScreenAdded(), and ScreenRemoved().
|
slot |
Definition at line 461 of file mythdisplay.cpp.
Referenced by MythDisplay().
|
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 252 of file mythdisplay.cpp.
Referenced by MythMainWindow::Init().
|
static |
Return true if the MythTV windows should span all screens.
Definition at line 501 of file mythdisplay.cpp.
Referenced by GetAspectRatio(), GetDescription(), GetDesiredScreen(), InitScreenBounds(), and MythVideoBounds::PopulateGeometry().
| void MythDisplay::SwitchToDesktop | ( | ) |
Return the screen to the original desktop video mode.
Definition at line 687 of file mythdisplay.cpp.
Referenced by SetWidget(), and MythMainWindow::~MythMainWindow().
Switches to the GUI resolution.
Definition at line 780 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 698 of file mythdisplay.cpp.
Referenced by MythVideoOutputGPU::ResizeForVideo().
|
protectedvirtual |
Reimplemented in MythDisplayDRM, MythDisplayMutter, MythDisplayOSX, MythDisplayX11, and MythDisplayRPI.
Definition at line 849 of file mythdisplay.cpp.
Referenced by SwitchToDesktop(), SwitchToGUI(), and SwitchToVideo().
|
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 MythDisplayDRM, MythDisplayMutter, MythDisplayX11, MythDisplayAndroid, MythDisplayOSX, MythDisplayRPI, and MythDisplayWindows.
Definition at line 479 of file mythdisplay.cpp.
Referenced by Initialise(), SetWidget(), SwitchToGUI(), SwitchToVideo(), MythDisplayDRM::UpdateCurrentMode(), MythDisplayMutter::UpdateCurrentMode(), MythDisplayX11::UpdateCurrentMode(), MythDisplayOSX::UpdateCurrentMode(), MythDisplayRPI::UpdateCurrentMode(), and MythDisplayWindows::UpdateCurrentMode().
|
inlinevirtual |
Reimplemented in MythDisplayDRM, MythDisplayMutter, MythDisplayX11, MythDisplayOSX, and MythDisplayRPI.
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, MythDisplayMutter, MythDisplayX11, MythDisplayOSX, and MythDisplayRPI.
Definition at line 29 of file mythdisplay.h.
Referenced by AppearanceSettings::AppearanceSettings(), and Create().
|
protected |
Definition at line 1102 of file mythdisplay.cpp.
Referenced by SetWidget().
|
protected |
Definition at line 1083 of file mythdisplay.cpp.
Referenced by SwitchToGUI(), and SwitchToVideo().
|
friend |
Definition at line 26 of file mythdisplay.h.
|
protected |
Definition at line 91 of file mythdisplay.h.
Referenced by GetAspectRatio(), SwitchToGUI(), and SwitchToVideo().
|
private |
Definition at line 109 of file mythdisplay.h.
Referenced by Initialise(), and SwitchToDesktop().
|
protected |
Definition at line 94 of file mythdisplay.h.
Referenced by GetEDID(), MythDisplayX11::GetEDID(), MythDisplayRPI::GetEDID(), InitHDR(), Initialise(), MythDisplayRPI::SwitchToVideoMode(), UpdateCurrentMode(), MythDisplayDRM::UpdateCurrentMode(), MythDisplayOSX::UpdateCurrentMode(), MythDisplayRPI::UpdateCurrentMode(), and MythDisplayMutter::UpdateResources().
Definition at line 107 of file mythdisplay.h.
Referenced by SetWidget().
|
private |
Definition at line 110 of file mythdisplay.h.
Referenced by GetGUIResolution(), Initialise(), and SwitchToGUI().
|
protected |
Definition at line 99 of file mythdisplay.h.
Referenced by GetDescription(), GetHDRState(), and InitHDR().
Definition at line 106 of file mythdisplay.h.
Referenced by Initialise(), and SetWidget().
Definition at line 89 of file mythdisplay.h.
Referenced by SetWidget(), SwitchToGUI(), SwitchToVideo(), UpdateCurrentMode(), MythDisplayDRM::UpdateCurrentMode(), MythDisplayMutter::UpdateCurrentMode(), MythDisplayX11::UpdateCurrentMode(), MythDisplayAndroid::UpdateCurrentMode(), MythDisplayOSX::UpdateCurrentMode(), MythDisplayRPI::UpdateCurrentMode(), and MythDisplayWindows::UpdateCurrentMode().
|
private |
Definition at line 112 of file mythdisplay.h.
Referenced by Initialise(), and SwitchToVideo().
|
protected |
Definition at line 93 of file mythdisplay.h.
Referenced by GetAspectRatio(), GetPhysicalSize(), GetPixelAspectRatio(), Initialise(), SwitchToDesktop(), SwitchToVideo(), UpdateCurrentMode(), MythDisplayDRM::UpdateCurrentMode(), MythDisplayX11::UpdateCurrentMode(), MythDisplayAndroid::UpdateCurrentMode(), MythDisplayOSX::UpdateCurrentMode(), MythDisplayRPI::UpdateCurrentMode(), MythDisplayWindows::UpdateCurrentMode(), and MythDisplayMutter::UpdateResources().
|
protected |
Definition at line 90 of file mythdisplay.h.
Referenced by GetRefreshInterval(), GetRefreshRate(), Initialise(), SwitchToDesktop(), SwitchToGUI(), SwitchToVideo(), UpdateCurrentMode(), MythDisplayDRM::UpdateCurrentMode(), MythDisplayX11::UpdateCurrentMode(), MythDisplayAndroid::UpdateCurrentMode(), MythDisplayOSX::UpdateCurrentMode(), MythDisplayRPI::UpdateCurrentMode(), MythDisplayWindows::UpdateCurrentMode(), and MythDisplayMutter::UpdateResources().
|
protected |
Definition at line 92 of file mythdisplay.h.
Referenced by GetAspectRatio(), GetPixelAspectRatio(), GetResolution(), MythDisplayRPI::GetVideoModes(), Initialise(), NextModeIsLarger(), SwitchToDesktop(), SwitchToGUI(), SwitchToVideo(), UpdateCurrentMode(), MythDisplayDRM::UpdateCurrentMode(), MythDisplayX11::UpdateCurrentMode(), MythDisplayAndroid::UpdateCurrentMode(), MythDisplayOSX::UpdateCurrentMode(), MythDisplayRPI::UpdateCurrentMode(), MythDisplayWindows::UpdateCurrentMode(), and MythDisplayMutter::UpdateResources().
|
protected |
Definition at line 97 of file mythdisplay.h.
Referenced by EstimateVirtualAspectRatio(), GetCurrentScreen(), MythDisplayX11::GetEDID(), MythDisplayDRM::GetVideoModes(), MythDisplayX11::GetVideoModes(), InitScreenBounds(), MythDisplay(), MythDisplayDRM::MythDisplayDRM(), ScreenChanged(), MythDisplayDRM::ScreenChanged(), SetWidget(), MythDisplayDRM::SwitchToVideoMode(), MythDisplayX11::UpdateCurrentMode(), MythDisplayMutter::UpdateResources(), and WaitForScreenChange().
|
private |
Definition at line 108 of file mythdisplay.h.
Referenced by GetScreenBounds(), and InitScreenBounds().
|
private |
Definition at line 111 of file mythdisplay.h.
Referenced by Initialise(), and SwitchToVideo().
|
protected |
Definition at line 98 of file mythdisplay.h.
Referenced by MythDisplayOSX::ClearModes(), DebugModes(), GetVideoModes(), MythDisplayDRM::GetVideoModes(), MythDisplayX11::GetVideoModes(), MythDisplayMutter::GetVideoModes(), MythDisplayOSX::GetVideoModes(), MythDisplayRPI::GetVideoModes(), Initialise(), MythDisplayDRM::SwitchToVideoMode(), MythDisplayMutter::SwitchToVideoMode(), MythDisplayOSX::SwitchToVideoMode(), MythDisplayX11::SwitchToVideoMode(), and MythDisplayRPI::SwitchToVideoMode().
|
protected |
Definition at line 100 of file mythdisplay.h.
Referenced by GetDescription(), GetRefreshInterval(), Initialise(), and SwitchToVideo().
Definition at line 88 of file mythdisplay.h.
Referenced by MythDisplayRPI::MythDisplayRPI(), and WaitForScreenChange().
|
protected |
Definition at line 95 of file mythdisplay.h.
Referenced by VideoOutputD3D::Init(), SetWidget(), MythDisplayOSX::UpdateCurrentMode(), MythDisplayWindows::UpdateCurrentMode(), and WaitForNewScreen().
|
protected |
Definition at line 96 of file mythdisplay.h.
Referenced by SetWidget().