MythTV  master
teletextscreen.h
Go to the documentation of this file.
1 #ifndef TELETEXTSCREEN_H
2 #define TELETEXTSCREEN_H
3 
4 #include <QFont>
5 
7 
9 #include "mythplayer.h"
10 
12 {
13  Q_OBJECT
14 
15  static bool InitialiseFont();
16 
17  public:
18  TeletextScreen(MythPlayer* Player, MythPainter* Painter, const QString& Name, int FontStretch);
19  ~TeletextScreen() override;
20 
21  bool Create() override;
22  void Pulse() override;
23 
24  // TeletextViewer interface methods
25  bool KeyPress(const QString& Key, bool& Exit);
26  void SetPage(int page, int subpage);
27  void SetDisplaying(bool display);
28  void Reset() override;
29  void ClearScreen();
30 
31  private:
32  void OptimiseDisplayedArea();
33  QImage* GetRowImage(int row, QRect &rect);
34  static void SetForegroundColor(int color);
35  void SetBackgroundColor(int color);
36  void DrawBackground(int x, int y);
37  void DrawRect(int row, QRect rect);
38  void DrawCharacter(int x, int y, QChar ch, bool doubleheight = false);
39  void DrawMosaic(int x, int y, int code, bool doubleheight);
40  void DrawLine(const tt_line_array& page, uint row, int lang);
41  void DrawHeader(const tt_line_array &page, int lang);
42  void DrawStatus();
43  void DrawPage();
44 
45  MythPlayer* m_player {nullptr};
47  QRect m_safeArea;
48  int m_colWidth {10};
49  int m_rowHeight {10};
51  bool m_displaying {false};
52  QHash<int, QImage*> m_rowImages;
54  int m_fontHeight {10};
55 
56  public:
57  static const QColor kColorBlack;
58  static const QColor kColorRed;
59  static const QColor kColorGreen;
60  static const QColor kColorYellow;
61  static const QColor kColorBlue;
62  static const QColor kColorMagenta;
63  static const QColor kColorCyan;
64  static const QColor kColorWhite;
65  static const QColor kColorTransp;
66  static const int kTeletextColumns;
67  static const int kTeletextRows;
68 };
69 
70 #endif // TELETEXTSCREEN_H
TeletextScreen::m_fontHeight
int m_fontHeight
Definition: teletextscreen.h:54
TeletextScreen::SetDisplaying
void SetDisplaying(bool display)
Definition: teletextscreen.cpp:236
TeletextScreen::DrawCharacter
void DrawCharacter(int x, int y, QChar ch, bool doubleheight=false)
Definition: teletextscreen.cpp:505
TeletextScreen::KeyPress
bool KeyPress(const QString &Key, bool &Exit)
Definition: teletextscreen.cpp:223
TeletextScreen::kColorWhite
static const QColor kColorWhite
Definition: teletextscreen.h:64
TeletextScreen::m_fontStretch
int m_fontStretch
Definition: teletextscreen.h:53
TeletextScreen::SetPage
void SetPage(int page, int subpage)
Definition: teletextscreen.cpp:230
TeletextScreen::DrawStatus
void DrawStatus()
Definition: teletextscreen.cpp:602
TeletextScreen::kTeletextColumns
static const int kTeletextColumns
Definition: teletextscreen.h:66
TeletextScreen::DrawMosaic
void DrawMosaic(int x, int y, int code, bool doubleheight)
Definition: teletextscreen.cpp:578
TeletextScreen::ClearScreen
void ClearScreen()
Definition: teletextscreen.cpp:63
TeletextScreen::Pulse
void Pulse() override
Pulse is called 70 times a second to trigger a single frame of an animation.
Definition: teletextscreen.cpp:138
TeletextScreen::kColorRed
static const QColor kColorRed
Definition: teletextscreen.h:58
TeletextScreen::kTeletextRows
static const int kTeletextRows
Definition: teletextscreen.h:67
TeletextScreen::m_displaying
bool m_displaying
Definition: teletextscreen.h:51
teletextreader.h
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
mythplayer.h
TeletextScreen::DrawPage
void DrawPage()
MythPlayer
Definition: mythplayer.h:83
TeletextScreen::SetBackgroundColor
void SetBackgroundColor(int color)
Definition: teletextscreen.cpp:303
TeletextScreen::m_rowImages
QHash< int, QImage * > m_rowImages
Definition: teletextscreen.h:52
TeletextScreen::m_bgColor
QColor m_bgColor
Definition: teletextscreen.h:50
TeletextScreen::m_player
MythPlayer * m_player
Definition: teletextscreen.h:45
TeletextReader
Definition: teletextreader.h:75
TeletextScreen::m_rowHeight
int m_rowHeight
Definition: teletextscreen.h:49
TeletextScreen::kColorCyan
static const QColor kColorCyan
Definition: teletextscreen.h:63
TeletextScreen::kColorTransp
static const QColor kColorTransp
Definition: teletextscreen.h:65
TeletextScreen::SetForegroundColor
static void SetForegroundColor(int color)
Definition: teletextscreen.cpp:295
TeletextScreen::Reset
void Reset() override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: teletextscreen.cpp:243
tt_line_array
std::array< uint8_t, 40 > tt_line_array
Definition: teletextreader.h:36
TeletextScreen::~TeletextScreen
~TeletextScreen() override
Definition: teletextscreen.cpp:51
TeletextScreen::OptimiseDisplayedArea
void OptimiseDisplayedArea()
Definition: teletextscreen.cpp:91
TeletextScreen::m_colWidth
int m_colWidth
Definition: teletextscreen.h:48
TeletextScreen::DrawHeader
void DrawHeader(const tt_line_array &page, int lang)
Definition: teletextscreen.cpp:249
TeletextScreen::m_safeArea
QRect m_safeArea
Definition: teletextscreen.h:47
uint
unsigned int uint
Definition: compat.h:81
TeletextScreen
Definition: teletextscreen.h:11
MythPainter
Definition: mythpainter.h:34
Name
Definition: channelsettings.cpp:71
TeletextScreen::kColorGreen
static const QColor kColorGreen
Definition: teletextscreen.h:59
TeletextScreen::DrawRect
void DrawRect(int row, QRect rect)
Definition: teletextscreen.cpp:564
TeletextScreen::DrawBackground
void DrawBackground(int x, int y)
Definition: teletextscreen.cpp:556
TeletextScreen::kColorBlue
static const QColor kColorBlue
Definition: teletextscreen.h:61
TeletextScreen::kColorMagenta
static const QColor kColorMagenta
Definition: teletextscreen.h:62
TeletextScreen::InitialiseFont
static bool InitialiseFont()
Definition: teletextscreen.cpp:657
TeletextScreen::TeletextScreen
TeletextScreen(MythPlayer *Player, MythPainter *Painter, const QString &Name, int FontStretch)
Definition: teletextscreen.cpp:43
TeletextScreen::m_teletextReader
TeletextReader * m_teletextReader
Definition: teletextscreen.h:46
TeletextScreen::GetRowImage
QImage * GetRowImage(int row, QRect &rect)
Definition: teletextscreen.cpp:72
Player
Definition: zmliveplayer.h:34
TeletextScreen::DrawLine
void DrawLine(const tt_line_array &page, uint row, int lang)
Definition: teletextscreen.cpp:313
TeletextScreen::kColorBlack
static const QColor kColorBlack
Definition: teletextscreen.h:57
TeletextScreen::kColorYellow
static const QColor kColorYellow
Definition: teletextscreen.h:60
mythscreentype.h
TeletextScreen::Create
bool Create() override
Definition: teletextscreen.cpp:56