MythTV
master
mythtv
libs
libmythui
platforms
mythdisplaywindows.cpp
Go to the documentation of this file.
1
#include "windows.h"
2
3
// MythTV
4
#include "
mythdisplaywindows.h
"
5
#include "
mythmainwindow.h
"
6
7
MythDisplayWindows::MythDisplayWindows
()
8
:
MythDisplay
()
9
{
10
Initialise
();
11
}
12
13
MythDisplayWindows::~MythDisplayWindows
()
14
{
15
}
16
17
void
MythDisplayWindows::UpdateCurrentMode
(
void
)
18
{
19
QWidget* widget =
m_widget
;
20
21
if
(!widget)
22
{
23
if
(!
HasMythMainWindow
())
24
{
25
MythDisplay::UpdateCurrentMode
();
26
return
;
27
}
28
widget = qobject_cast<QWidget*>(
MythMainWindow::getMainWindow
());
29
}
30
WId win = 0;
31
if
(widget)
32
win = widget->winId();
33
34
HDC hdc = GetDC((HWND)win);
35
if
(!hdc)
36
{
37
MythDisplay::UpdateCurrentMode
();
38
return
;
39
}
40
41
int
rate = GetDeviceCaps(hdc, VREFRESH);
42
m_physicalSize
= QSize(GetDeviceCaps(hdc, HORZSIZE),
43
GetDeviceCaps(hdc, VERTSIZE));
44
m_resolution
= QSize(GetDeviceCaps(hdc, HORZRES),
45
GetDeviceCaps(hdc, VERTRES));
46
m_modeComplete
=
true
;
47
48
// see http://support.microsoft.com/kb/2006076
49
switch
(rate)
50
{
51
case
23:
m_refreshRate
= 23.976;
break
;
52
case
29:
m_refreshRate
= 29.970;
break
;
53
case
47:
m_refreshRate
= 47.952;
break
;
54
case
59:
m_refreshRate
= 59.940;
break
;
55
case
71:
m_refreshRate
= 71.928;
break
;
56
case
119:
m_refreshRate
= 119.880;
break
;
57
default
:
m_refreshRate
=
static_cast<
double
>
(rate);
58
}
59
}
MythDisplay::m_physicalSize
QSize m_physicalSize
Definition:
mythdisplay.h:93
mythdisplaywindows.h
MythDisplay::m_resolution
QSize m_resolution
Definition:
mythdisplay.h:92
MythMainWindow::getMainWindow
static MythMainWindow * getMainWindow(bool UseDB=true)
Return the existing main window, or create one.
Definition:
mythmainwindow.cpp:80
MythDisplayWindows::~MythDisplayWindows
~MythDisplayWindows() override
Definition:
mythdisplaywindows.cpp:13
HasMythMainWindow
bool HasMythMainWindow(void)
Definition:
mythmainwindow.cpp:109
MythDisplay::UpdateCurrentMode
virtual void UpdateCurrentMode()
Retrieve screen details.
Definition:
mythdisplay.cpp:473
MythDisplay::m_modeComplete
bool m_modeComplete
Definition:
mythdisplay.h:89
MythDisplayWindows::UpdateCurrentMode
void UpdateCurrentMode(void) override
Retrieve screen details.
Definition:
mythdisplaywindows.cpp:17
MythDisplay
Definition:
mythdisplay.h:22
MythDisplay::m_refreshRate
double m_refreshRate
Definition:
mythdisplay.h:90
MythDisplay::Initialise
void Initialise()
Definition:
mythdisplay.cpp:533
MythDisplay::m_widget
QWidget * m_widget
Definition:
mythdisplay.h:95
mythmainwindow.h
MythDisplayWindows::MythDisplayWindows
MythDisplayWindows()
Definition:
mythdisplaywindows.cpp:7
Generated on Sun Jan 5 2025 03:16:26 for MythTV by
1.8.17