MythTV  master
mythdisplaywindows.cpp
Go to the documentation of this file.
1 // MythTV
2 #include "mythdisplaywindows.h"
3 
5  : MythDisplay()
6 {
7  Initialise();
8 }
9 
11 {
12 }
13 
15 {
16  HDC hdc = GetDC((HWND)GetWindowID());
17  if (!hdc)
18  {
20  return;
21  }
22 
23  int rate = GetDeviceCaps(hdc, VREFRESH);
24  m_physicalSize = QSize(GetDeviceCaps(hdc, HORZSIZE),
25  GetDeviceCaps(hdc, VERTSIZE));
26  m_resolution = QSize(GetDeviceCaps(hdc, HORZRES),
27  GetDeviceCaps(hdc, VERTRES));
28  m_modeComplete = true;
29 
30  // see http://support.microsoft.com/kb/2006076
31  switch (rate)
32  {
33  case 23: m_refreshRate = 23.976; break;
34  case 29: m_refreshRate = 29.970; break;
35  case 47: m_refreshRate = 47.952; break;
36  case 59: m_refreshRate = 59.940; break;
37  case 71: m_refreshRate = 71.928; break;
38  case 119: m_refreshRate = 119.880; break;
39  default: m_refreshRate = static_cast<double>(rate);
40  }
41 }
virtual void UpdateCurrentMode(void)
Retrieve screen details.
QSize m_resolution
Definition: mythdisplay.h:86
void Initialise(void)
bool m_modeComplete
Definition: mythdisplay.h:83
QSize m_physicalSize
Definition: mythdisplay.h:87
double m_refreshRate
Definition: mythdisplay.h:84
void UpdateCurrentMode(void) override
Retrieve screen details.