Permalink
Browse files

Teletext: Clear teletext captions when skipping etc.

Closes #9763
  • Loading branch information...
1 parent 998288d commit 71301ed0355bf6529fa95dcc61b9ba906770872f Mark Kendall committed Oct 3, 2011
@@ -1304,6 +1304,11 @@ void MythPlayer::ResetCaptions(void)
{
osd->ClearSubtitles();
}
+ else if ((textDisplayMode & kDisplayTeletextCaptions) ||
+ (textDisplayMode & kDisplayNUVTeletextCaptions))
+ {
+ osd->TeletextClear();
+ }
}
void MythPlayer::DisableCaptions(uint mode, bool osd_msg)
@@ -1074,6 +1074,16 @@ void OSD::TeletextReset(void)
tt->Reset();
}
+void OSD::TeletextClear(void)
+{
+ if (!HasWindow(OSD_WIN_TELETEXT))
+ return;
+
+ TeletextScreen* tt = (TeletextScreen*)m_Children.value(OSD_WIN_TELETEXT);
+ if (tt)
+ tt->ClearScreen();
+}
+
SubtitleScreen* OSD::InitSubtitles(void)
{
SubtitleScreen *sub = NULL;
@@ -174,6 +174,7 @@ class OSD
void EnableTeletext(bool enable, int page);
bool TeletextAction(const QString &action);
void TeletextReset(void);
+ void TeletextClear(void);
SubtitleScreen* InitSubtitles(void);
void EnableSubtitles(int type);
@@ -52,7 +52,7 @@ TeletextScreen::TeletextScreen(MythPlayer *player, const char * name,
TeletextScreen::~TeletextScreen()
{
- CleanUp();
+ ClearScreen();
}
bool TeletextScreen::Create(void)
@@ -62,7 +62,7 @@ bool TeletextScreen::Create(void)
return m_player && m_teletextReader;
}
-void TeletextScreen::CleanUp(void)
+void TeletextScreen::ClearScreen(void)
{
DeleteAllChildren();
for (int i = 0; i < m_rowImages.size(); i++)
@@ -191,7 +191,7 @@ void TeletextScreen::Pulse(void)
if (!m_teletextReader->PageChanged())
return;
- CleanUp();
+ ClearScreen();
const TeletextSubPage *ttpage = m_teletextReader->FindSubPage();
@@ -247,7 +247,7 @@ void TeletextScreen::SetDisplaying(bool display)
{
m_displaying = display;
if (!m_displaying)
- CleanUp();
+ ClearScreen();
}
void TeletextScreen::Reset(void)
@@ -24,9 +24,9 @@ class TeletextScreen: public MythScreenType
void SetPage(int page, int subpage);
void SetDisplaying(bool display);
void Reset(void);
+ void ClearScreen(void);
private:
- void CleanUp();
void OptimiseDisplayedArea(void);
QImage* GetRowImage(int row, QRect &rect);
void SetForegroundColor(int color);

0 comments on commit 71301ed

Please sign in to comment.