MythTV  master
Public Slots | Signals | Public Member Functions | Protected Slots | Private Member Functions | Private Attributes | List of all members
OSD Class Reference

#include <libmythtv/osd.h>

Inheritance diagram for OSD:
[legend]
Collaboration diagram for OSD:
[legend]

Public Slots

void SetText (const QString &Window, const InfoMap &Map, OSDTimeout Timeout)
 
void DialogQuit ()
 
void HideAll (bool KeepSubs=true, MythScreenType *Except=nullptr, bool DropNotification=false)
 
void Embed (bool Embedding)
 

Signals

void HideOSD (OSDFunctionalType Type)
 

Public Member Functions

 OSD (MythMainWindow *MainWindow, TV *Tv, MythPlayerUI *Player, MythPainter *Painter)
 
 ~OSD () override
 
bool Init (QRect Rect, float FontAspect) override
 
void HideWindow (const QString &Window) override
 
void SetFunctionalWindow (const QString &Window, enum OSDFunctionalType Type)
 
void SetExpiry (const QString &Window, enum OSDTimeout Timeout, std::chrono::milliseconds CustomTimeout=0ms)
 
void ResetWindow (const QString &Window)
 
void Draw ()
 
void SetValues (const QString &Window, const QHash< QString, int > &Map, OSDTimeout Timeout)
 
void SetValues (const QString &Window, const QHash< QString, float > &Map, OSDTimeout Timeout)
 
void SetRegions (const QString &Window, frm_dir_map_t &Map, long long Total)
 
void SetGraph (const QString &Window, const QString &Graph, std::chrono::milliseconds Timecode)
 
bool IsWindowVisible (const QString &Window)
 
bool DialogVisible (const QString &Window=QString())
 
bool DialogHandleKeypress (QKeyEvent *Event)
 
bool DialogHandleGesture (MythGestureEvent *Event)
 
void DialogGetText (InfoMap &Map)
 
- Public Member Functions inherited from MythMediaOverlay
 MythMediaOverlay (MythMainWindow *MainWindow, TV *Tv, MythPlayerUI *Player, MythPainter *Painter)
 
 ~MythMediaOverlay () override
 
void SetPlayer (MythPlayerUI *Player)
 
QRect Bounds () const
 
int GetFontStretch () const
 
bool HasWindow (const QString &Window)
 
virtual MythScreenTypeGetWindow (const QString &Window)
 

Protected Slots

void ShowDialog (const MythOSDDialogData &Data)
 Show a dialog menu, removing any existing dialog. More...
 
void IsOSDVisible (bool &Visible)
 

Private Member Functions

void PositionWindow (MythScreenType *Window)
 
void RemoveWindow (const QString &Window)
 
void DialogShow (const QString &Window, const QString &Text="", std::chrono::milliseconds UpdateFor=0ms)
 
void DialogAddButton (const QString &Text, QVariant Data, bool Menu=false, bool Current=false)
 
void DialogBack (const QString &Text="", const QVariant &Data=0, bool Exit=false)
 
void TearDown () override
 
void LoadWindows ()
 
void CheckExpiry ()
 
void SetExpiryPriv (const QString &Window, enum OSDTimeout Timeout, std::chrono::milliseconds CustomTimeout)
 

Private Attributes

bool m_embedded { false }
 
std::chrono::milliseconds m_fadeTime { kOSDFadeTime }
 
MythScreenTypem_dialog { nullptr }
 
QString m_pulsedDialogText
 
QDateTime m_nextPulseUpdate
 
std::array< std::chrono::milliseconds, 4 > m_timeouts { -1ms, 3s, 5s, 13s }
 
QString m_functionalWindow
 
QHash< MythScreenType *, QDateTime > m_expireTimes
 

Additional Inherited Members

- Protected Member Functions inherited from MythMediaOverlay
void OverrideUIScale (bool Log=true)
 
void RevertUIScale ()
 
MythScreenTypeInitWindow (const QString &Window, MythScreenType *Screen)
 
- Protected Attributes inherited from MythMediaOverlay
MythMainWindowm_mainWindow { nullptr }
 
TVm_tv { nullptr }
 
MythPlayerUIm_player { nullptr }
 
MythPainterm_painter { nullptr }
 
QRect m_rect
 
bool m_uiScaleOverride { false }
 
float m_savedWMult { 1.0F }
 
float m_savedHMult { 1.0F }
 
QRect m_savedUIRect
 
int m_fontStretch { 0 }
 
int m_savedFontStretch { 0 }
 
QMap< QString, MythScreenType * > m_children
 

Detailed Description

Definition at line 93 of file osd.h.

Constructor & Destructor Documentation

◆ OSD()

OSD::OSD ( MythMainWindow MainWindow,
TV Tv,
MythPlayerUI Player,
MythPainter Painter 
)

Definition at line 30 of file osd.cpp.

◆ ~OSD()

OSD::~OSD ( )
override

Definition at line 39 of file osd.cpp.

Member Function Documentation

◆ HideOSD

void OSD::HideOSD ( OSDFunctionalType  Type)
signal

◆ SetText

void OSD::SetText ( const QString &  Window,
const InfoMap Map,
OSDTimeout  Timeout 
)
slot

◆ DialogQuit

void OSD::DialogQuit ( )
slot

◆ HideAll

void OSD::HideAll ( bool  KeepSubs = true,
MythScreenType Except = nullptr,
bool  DropNotification = false 
)
slot

◆ Embed

void OSD::Embed ( bool  Embedding)
slot

Definition at line 77 of file osd.cpp.

Referenced by MythPlayerOverlayUI::MythPlayerOverlayUI().

◆ ShowDialog

void OSD::ShowDialog ( const MythOSDDialogData Data)
protectedslot

Show a dialog menu, removing any existing dialog.

This slot deliberately uses a const reference despite the minor performance penalty. This simplifies memory management (e.g. if the signal is not delivered when there is no OSD) and allows for possible future changes where the OSD and TV objects do not reside in the same thread.

Definition at line 736 of file osd.cpp.

Referenced by OSD().

◆ IsOSDVisible

void OSD::IsOSDVisible ( bool Visible)
protectedslot

Definition at line 82 of file osd.cpp.

Referenced by OSD().

◆ Init()

bool OSD::Init ( QRect  Rect,
float  FontAspect 
)
overridevirtual

Reimplemented from MythMediaOverlay.

Definition at line 50 of file osd.cpp.

Referenced by MythPlayerVideoUI::ReinitOSD(), and MythPlayerUI::VideoStart().

◆ HideWindow()

void OSD::HideWindow ( const QString &  Window)
overridevirtual

◆ SetFunctionalWindow()

void OSD::SetFunctionalWindow ( const QString &  Window,
enum OSDFunctionalType  Type 
)

Definition at line 666 of file osd.cpp.

Referenced by MythPlayerOverlayUI::UpdateOSDStatus(), and TV::UpdateOSDStatus().

◆ SetExpiry()

void OSD::SetExpiry ( const QString &  Window,
enum OSDTimeout  Timeout,
std::chrono::milliseconds  CustomTimeout = 0ms 
)

◆ ResetWindow()

void OSD::ResetWindow ( const QString &  Window)

◆ Draw()

void OSD::Draw ( )

Definition at line 457 of file osd.cpp.

Referenced by MythPlayerUI::RenderVideoFrame().

◆ SetValues() [1/2]

void OSD::SetValues ( const QString &  Window,
const QHash< QString, int > &  Map,
OSDTimeout  Timeout 
)

◆ SetValues() [2/2]

void OSD::SetValues ( const QString &  Window,
const QHash< QString, float > &  Map,
OSDTimeout  Timeout 
)

Definition at line 187 of file osd.cpp.

◆ SetRegions()

void OSD::SetRegions ( const QString &  Window,
frm_dir_map_t Map,
long long  Total 
)

Definition at line 376 of file osd.cpp.

Referenced by DeleteMap::UpdateOSD().

◆ SetGraph()

void OSD::SetGraph ( const QString &  Window,
const QString &  Graph,
std::chrono::milliseconds  Timecode 
)

Definition at line 442 of file osd.cpp.

Referenced by DeleteMap::UpdateOSD().

◆ IsWindowVisible()

bool OSD::IsWindowVisible ( const QString &  Window)

◆ DialogVisible()

bool OSD::DialogVisible ( const QString &  Window = QString())

◆ DialogHandleKeypress()

bool OSD::DialogHandleKeypress ( QKeyEvent *  Event)

Definition at line 705 of file osd.cpp.

Referenced by TV::ProcessKeypressOrGesture().

◆ DialogHandleGesture()

bool OSD::DialogHandleGesture ( MythGestureEvent Event)

Definition at line 712 of file osd.cpp.

Referenced by TV::ProcessKeypressOrGesture().

◆ DialogGetText()

void OSD::DialogGetText ( InfoMap Map)

Definition at line 835 of file osd.cpp.

Referenced by TV::HandleOSDChannelEdit().

◆ PositionWindow()

void OSD::PositionWindow ( MythScreenType Window)
private

Definition at line 645 of file osd.cpp.

Referenced by DialogShow(), and LoadWindows().

◆ RemoveWindow()

void OSD::RemoveWindow ( const QString &  Window)
private

Definition at line 655 of file osd.cpp.

Referenced by DialogQuit().

◆ DialogShow()

void OSD::DialogShow ( const QString &  Window,
const QString &  Text = "",
std::chrono::milliseconds  UpdateFor = 0ms 
)
private

Definition at line 745 of file osd.cpp.

Referenced by ShowDialog().

◆ DialogAddButton()

void OSD::DialogAddButton ( const QString &  Text,
QVariant  Data,
bool  Menu = false,
bool  Current = false 
)
private

Definition at line 828 of file osd.cpp.

◆ DialogBack()

void OSD::DialogBack ( const QString &  Text = "",
const QVariant &  Data = 0,
bool  Exit = false 
)
private

Definition at line 817 of file osd.cpp.

Referenced by DialogShow(), and ShowDialog().

◆ TearDown()

void OSD::TearDown ( )
overrideprivatevirtual

Reimplemented from MythMediaOverlay.

Definition at line 44 of file osd.cpp.

Referenced by Init(), and ~OSD().

◆ LoadWindows()

void OSD::LoadWindows ( )
private

Definition at line 120 of file osd.cpp.

Referenced by Init().

◆ CheckExpiry()

void OSD::CheckExpiry ( )
private

Definition at line 548 of file osd.cpp.

Referenced by Draw().

◆ SetExpiryPriv()

void OSD::SetExpiryPriv ( const QString &  Window,
enum OSDTimeout  Timeout,
std::chrono::milliseconds  CustomTimeout 
)
private

Definition at line 603 of file osd.cpp.

Referenced by SetExpiry().

Member Data Documentation

◆ m_embedded

bool OSD::m_embedded { false }
private

Definition at line 145 of file osd.h.

Referenced by Draw(), and Embed().

◆ m_fadeTime

std::chrono::milliseconds OSD::m_fadeTime { kOSDFadeTime }
private

Definition at line 146 of file osd.h.

Referenced by Draw().

◆ m_dialog

MythScreenType* OSD::m_dialog { nullptr }
private

◆ m_pulsedDialogText

QString OSD::m_pulsedDialogText
private

Definition at line 148 of file osd.h.

Referenced by CheckExpiry(), DialogQuit(), and DialogShow().

◆ m_nextPulseUpdate

QDateTime OSD::m_nextPulseUpdate
private

Definition at line 149 of file osd.h.

Referenced by CheckExpiry(), and DialogShow().

◆ m_timeouts

std::array<std::chrono::milliseconds,4> OSD::m_timeouts { -1ms, 3s, 5s, 13s }
private

Definition at line 150 of file osd.h.

Referenced by SetExpiryPriv().

◆ m_functionalWindow

QString OSD::m_functionalWindow
private

Definition at line 152 of file osd.h.

Referenced by HideWindow(), and SetFunctionalWindow().

◆ m_expireTimes

QHash<MythScreenType*, QDateTime> OSD::m_expireTimes
private

Definition at line 153 of file osd.h.

Referenced by CheckExpiry(), Draw(), and SetExpiryPriv().


The documentation for this class was generated from the following files: