MythTV  master
interactivescreen.cpp
Go to the documentation of this file.
1 // MythTV
2 #include "mythplayerui.h"
4 
6  : MythScreenType(static_cast<MythScreenType*>(nullptr), Name),
7  m_player(Player)
8 {
9  m_painter = Painter;
10  UpdateArea();
11 }
12 
14 {
15  if (m_player)
16  emit m_player->ResizeForInteractiveTV(QRect());
17 }
18 
20 {
21  if (m_childrenList.isEmpty())
22  {
23  m_safeArea = {};
24  }
25  else if (m_player && m_player->GetVideoOutput())
26  {
27  float tmp = 0.0;
28  QRect dummy;
30  }
32 }
33 
35 {
36  UpdateArea();
37 
38  QRegion visible;
39  QListIterator<MythUIType *> i(m_childrenList);
40  while (i.hasNext())
41  {
42  MythUIType *img = i.next();
43  visible = visible.united(img->GetArea());
44  }
45 
46  if (visible.isEmpty())
47  return;
48 
49  QRect bounding = visible.boundingRect();
50  bounding = bounding.translated(m_safeArea.topLeft());
51  bounding = m_safeArea.intersected(bounding);
52  int left = m_safeArea.left() - bounding.left();
53  int top = m_safeArea.top() - bounding.top();
54  SetArea(MythRect(bounding));
55 
56  i.toFront();;
57  while (i.hasNext())
58  {
59  MythUIType *img = i.next();
60  img->SetArea(MythRect(img->GetArea().translated(left, top)));
61  }
62 }
MythVideoOutput::GetOSDBounds
virtual void GetOSDBounds(QRect &Total, QRect &Visible, float &VisibleAspect, float &FontScaling, float ThemeAspect) const
Definition: mythvideoout.cpp:207
MythPlayer::GetVideoOutput
MythVideoOutput * GetVideoOutput(void)
Definition: mythplayer.h:166
mythplayerui.h
MythUIType::SetArea
virtual void SetArea(const MythRect &rect)
Definition: mythuitype.cpp:610
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
MythRect
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
Definition: mythrect.h:17
InteractiveScreen::Close
void Close() override
Definition: interactivescreen.cpp:13
tmp
static guint32 * tmp
Definition: goom_core.cpp:26
MythUIType::GetArea
virtual MythRect GetArea(void) const
If the object has a minimum area defined, return it, other wise return the default area.
Definition: mythuitype.cpp:885
MythPlayerUI
Definition: mythplayerui.h:12
MythPlayerCaptionsUI::ResizeForInteractiveTV
void ResizeForInteractiveTV(const QRect &Rect)
MythUIType::m_childrenList
QList< MythUIType * > m_childrenList
Definition: mythuitype.h:253
InteractiveScreen::m_player
MythPlayerUI * m_player
Definition: interactivescreen.h:27
interactivescreen.h
MythUIType
The base class on which all widgets and screens are based.
Definition: mythuitype.h:85
InteractiveScreen::OptimiseDisplayedArea
void OptimiseDisplayedArea()
Definition: interactivescreen.cpp:34
MythPainter
Definition: mythpainter.h:34
Name
Definition: channelsettings.cpp:71
InteractiveScreen::m_safeArea
QRect m_safeArea
Definition: interactivescreen.h:28
MythUIType::m_painter
MythPainter * m_painter
Definition: mythuitype.h:295
InteractiveScreen::UpdateArea
void UpdateArea()
Definition: interactivescreen.cpp:19
Player
Definition: zmliveplayer.h:34
InteractiveScreen::InteractiveScreen
InteractiveScreen(MythPlayerUI *Player, MythPainter *Painter, const QString &Name)
Definition: interactivescreen.cpp:5