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