MythTV  master
mythplayercaptionsui.cpp
Go to the documentation of this file.
1 // MythTV
2 #include "livetvchain.h"
3 #include "tv_play.h"
4 #include "interactivetv.h"
6 #include "mythplayercaptionsui.h"
7 
8 #define LOC QString("PlayerCaptions: ")
9 
11  : MythPlayerAudioUI(MainWindow, Tv, Context, Flags),
12  m_captionsOverlay(MainWindow, Tv, nullptr, m_painter)
13 {
14  // Register state type for signalling
15  qRegisterMetaType<MythCaptionsState>();
16 
17  m_itvEnabled = gCoreContext->GetBoolSetting("EnableMHEG", false);
18 
19  // Connect outgoing
21 
22  // Inbound connections
42 
43  // Signalled connections (from MHIContext)
47 
48  // Signalled from the decoder
50 
51  // Signalled from the base class
53 }
54 
56 {
57  delete m_interactiveTV;
58 }
59 
61 {
62  LOG(VB_GENERAL, LOG_INFO, LOC + "Initialising captions");
66 }
67 
69 {
71  bool inprogress = (m_playerCtx->GetState() == kState_WatchingRecording ||
75 }
76 
78 {
81 }
82 
84 {
86  return;
87 
88  auto * subs = m_captionsOverlay.InitSubtitles();
89  if (subs)
90  {
91  int newval = std::clamp(subs->GetZoom() + Delta, 50, 200);
92  UpdateOSDStatus(tr("Adjust Subtitle Zoom"), tr("Subtitle Zoom"),
93  QString::number(newval), kOSDFunctionalType_SubtitleZoomAdjust,
94  "%", newval * 1000 / 200, kOSDTimeout_None);
96  subs->SetZoom(newval);
97  }
98 }
99 
101 {
104  if (!(showing && !(m_browsing || m_editing)))
105  return;
106 
107  auto * subs = m_captionsOverlay.InitSubtitles();
108  if (subs)
109  {
110  int newval = std::clamp(subs->GetDelay() + (Delta * 10), -5000, 5000);
111  // range of -5000ms..+5000ms, scale to 0..1000
112  UpdateOSDStatus(tr("Adjust Subtitle Delay"), tr("Subtitle Delay"),
113  QString::number(newval), kOSDFunctionalType_SubtitleDelayAdjust,
114  "ms", (newval / 10) + 500, kOSDTimeout_None);
116  subs->SetDelay(newval);
117  }
118 
119 }
120 
122 {
125 }
126 
127 static uint toCaptionType(uint Type)
128 {
129  if (kTrackTypeCC608 == Type) return kDisplayCC608;
130  if (kTrackTypeCC708 == Type) return kDisplayCC708;
131  if (kTrackTypeSubtitle == Type) return kDisplayAVSubtitle;
133  if (kTrackTypeTextSubtitle == Type) return kDisplayTextSubtitle;
134  if (kTrackTypeRawText == Type) return kDisplayRawTextSubtitle;
135  return 0;
136 }
137 
138 static uint toTrackType(uint Type)
139 {
140  if (kDisplayCC608 == Type) return kTrackTypeCC608;
141  if (kDisplayCC708 == Type) return kTrackTypeCC708;
142  if (kDisplayAVSubtitle == Type) return kTrackTypeSubtitle;
144  if (kDisplayTextSubtitle == Type) return kTrackTypeTextSubtitle;
145  if (kDisplayRawTextSubtitle == Type) return kTrackTypeRawText;
146  return kTrackTypeUnknown;
147 }
148 
149 void MythPlayerCaptionsUI::DisableCaptions(uint Mode, bool UpdateOSD)
150 {
151  uint oldcaptions = m_captionsState.m_textDisplayMode;
155  if (oldcaptions != m_captionsState.m_textDisplayMode)
157  ResetCaptions();
158 
159  QMutexLocker locker(&m_osdLock);
160 
161  bool newTextDesired = (m_captionsState.m_textDisplayMode & kDisplayAllTextCaptions) != 0U;
162  // Only turn off textDesired if the Operator requested it.
163  if (UpdateOSD || newTextDesired)
164  m_textDesired = newTextDesired;
165 
166  QString msg = "";
167  if (kDisplayNUVTeletextCaptions & Mode)
168  msg += tr("TXT CAP");
169 
170  if (kDisplayTeletextCaptions & Mode)
171  {
172  if (m_decoder != nullptr)
173  {
175  if (track > -1)
176  msg += m_decoder->GetTrackDesc(kTrackTypeTeletextCaptions, static_cast<uint>(track));
177  }
178  DisableTeletext();
179  }
183  if ((kDisplayCC608 & Mode) || (kDisplayCC708 & Mode) ||
184  (kDisplayAVSubtitle & Mode) || (kDisplayRawTextSubtitle & Mode))
185  {
186  uint type = toTrackType(Mode);
187  if (m_decoder != nullptr)
188  {
189  int track = GetTrack(type);
190  if (track > -1)
191  msg += m_decoder->GetTrackDesc(type, static_cast<uint>(track));
192  }
194  }
195 
196  if (kDisplayTextSubtitle & Mode)
197  {
198  msg += tr("Text subtitles");
200  }
201 
202  if (!msg.isEmpty() && UpdateOSD)
203  {
204  msg += " " + tr("Off");
206  }
207 }
208 
209 void MythPlayerCaptionsUI::EnableCaptions(uint Mode, bool UpdateOSD)
210 {
211  QMutexLocker locker(&m_osdLock);
212  bool newTextDesired = (Mode & kDisplayAllTextCaptions) != 0U;
213  // Only turn off textDesired if the Operator requested it.
214  if (UpdateOSD || newTextDesired)
215  m_textDesired = newTextDesired;
216  QString msg = "";
217  if ((kDisplayCC608 & Mode) || (kDisplayCC708 & Mode) ||
218  (kDisplayAVSubtitle & Mode) || kDisplayRawTextSubtitle & Mode)
219  {
220  uint type = toTrackType(Mode);
221  if (m_decoder != nullptr)
222  {
223  int track = GetTrack(type);
224  if (track > -1)
225  msg += m_decoder->GetTrackDesc(type, static_cast<uint>(track));
226  }
227 
228  m_captionsOverlay.EnableSubtitles(static_cast<int>(Mode));
229  }
230  if (kDisplayTextSubtitle & Mode)
231  {
233  msg += tr("Text subtitles");
234  }
235  if (kDisplayNUVTeletextCaptions & Mode)
236  msg += tr("TXT %1").arg(m_ttPageNum, 3, 16);
237  if ((kDisplayTeletextCaptions & Mode) && (m_decoder != nullptr))
238  {
240  static_cast<uint>(GetTrack(kTrackTypeTeletextCaptions)));
241 
243  static_cast<uint>(GetTrack(kTrackTypeTeletextCaptions)));
244 
245  EnableTeletext(page);
246  }
247 
248  msg += " " + tr("On");
249 
250  LOG(VB_PLAYBACK, LOG_INFO, QString("EnableCaptions(%1) msg: %2")
251  .arg(Mode).arg(msg));
252 
253  uint oldcaptions = m_captionsState.m_textDisplayMode;
257  if (oldcaptions != m_captionsState.m_textDisplayMode)
259  if (UpdateOSD)
261 }
262 
267 {
270  {
271  SetCaptionsEnabled(true, false);
272  }
273 }
274 
276 {
277  m_allowForcedSubtitles = Allow;
278  UpdateOSDMessage(m_allowForcedSubtitles ? tr("Forced Subtitles On") : tr("Forced Subtitles Off"));
279 }
280 
282 {
284 }
285 
287 {
289 }
290 
292 {
293  QMutexLocker locker(&m_osdLock);
294  uint mode = toCaptionType(Type);
296 
298  DisableCaptions(m_captionsState.m_textDisplayMode, (origMode & mode) != 0U);
299 
300  if (origMode & mode)
301  return;
302 
303  if (mode)
304  EnableCaptions(mode);
305 }
306 
307 void MythPlayerCaptionsUI::SetCaptionsEnabled(bool Enable, bool UpdateOSD)
308 {
309  QMutexLocker locker(&m_osdLock);
312 
313  // Only turn off textDesired if the Operator requested it.
314  if (UpdateOSD || Enable)
315  m_textDesired = Enable;
316 
317  if (!Enable)
318  {
319  DisableCaptions(origMode, UpdateOSD);
320  return;
321  }
324  if (origMode != mode)
325  {
326  DisableCaptions(origMode, false);
327 
328  if (kDisplayNone == mode)
329  {
330  if (UpdateOSD)
331  {
332  UpdateOSDMessage(tr("No captions", "CC/Teletext/Subtitle text not available"),
334  }
335  LOG(VB_PLAYBACK, LOG_INFO, "No captions available yet to enable.");
336  }
337  else if (mode)
338  {
339  EnableCaptions(mode, UpdateOSD);
340  }
341  }
342  ResetCaptions();
343 }
344 
346 {
347  if (m_decoder)
348  return m_decoder->GetTracks(Type);
349  return QStringList();
350 }
351 
353 {
354  if (m_decoder)
355  return m_decoder->GetTrackCount(Type);
356  return 0;
357 }
358 
360 {
361  if (!m_decoder)
362  return;
363 
364  m_decoder->SetTrack(Type, static_cast<int>(TrackNo));
365  if (kTrackTypeAudio == Type)
366  {
367  if (m_decoder)
368  {
370  static_cast<uint>(GetTrack(Type))), kOSDTimeout_Med);
371  }
372  return;
373  }
374 
375  uint subtype = toCaptionType(Type);
376  if (subtype)
377  {
379  EnableCaptions(subtype, true);
380  if ((kDisplayCC708 == subtype || kDisplayCC608 == subtype) && m_decoder)
381  {
382  int sid = m_decoder->GetTrackInfo(Type, TrackNo).m_stream_id;
383  if (sid >= 0)
384  {
385  (kDisplayCC708 == subtype) ? m_cc708.SetCurrentService(sid) :
386  m_cc608.SetMode(sid);
387  }
388  }
389  }
390 }
391 
393 {
394  m_disableForcedSubtitles = false;
395  m_osdLock.lock();
397  m_osdLock.unlock();
398 }
399 
401 {
402  m_enableForcedSubtitles = false;
404  return;
405 
406  m_osdLock.lock();
408  m_osdLock.unlock();
409 }
410 
412 {
413  if (m_decoder)
414  return m_decoder->GetTrack(Type);
415  return -1;
416 }
417 
418 void MythPlayerCaptionsUI::ChangeTrack(uint Type, int Direction)
419 {
420  if (!m_decoder)
421  return;
422 
423  int retval = m_decoder->ChangeTrack(Type, Direction);
424  if (retval >= 0)
425  {
426  UpdateOSDMessage(m_decoder->GetTrackDesc(Type, static_cast<uint>(GetTrack(Type))),
428  }
429 }
430 
432 {
433  if (!m_decoder || (Direction < 0))
434  return;
435 
439  {
441  if (GetTrack(tracktype) < m_decoder->NextTrack(tracktype))
442  {
443  SetTrack(tracktype, static_cast<uint>(m_decoder->NextTrack(tracktype)));
444  return;
445  }
446  }
448  if ((nextmode == kDisplayTextSubtitle) ||
449  (nextmode == kDisplayNUVTeletextCaptions) ||
450  (nextmode == kDisplayNone))
451  {
453  if (nextmode != kDisplayNone)
454  EnableCaptions(nextmode, true);
455  }
456  else
457  {
458  uint tracktype = toTrackType(nextmode);
459  uint tracks = m_decoder->GetTrackCount(tracktype);
460  if (tracks)
461  {
463  SetTrack(tracktype, 0);
464  }
465  }
466 }
467 
469 {
470  if (Mode == kDisplayNone)
471  return false;
472 
474  return true;
475 
476  if (!(Mode == kDisplayTextSubtitle) && m_decoder->GetTrackCount(toTrackType(Mode)))
477  return true;
478 
479  return false;
480 }
481 
483 {
484  // Text->TextStream->708->608->AVSubs->Teletext->NUV->None
485  // NUV only offerred if PAL
486  bool pal = (m_vbiMode == VBIMode::PAL_TT);
487  uint nextmode = kDisplayNone;
488 
489  if (kDisplayTextSubtitle == Mode)
490  nextmode = kDisplayRawTextSubtitle;
491  else if (kDisplayRawTextSubtitle == Mode)
492  nextmode = kDisplayCC708;
493  else if (kDisplayCC708 == Mode)
494  nextmode = kDisplayCC608;
495  else if (kDisplayCC608 == Mode)
496  nextmode = kDisplayAVSubtitle;
497  else if (kDisplayAVSubtitle == Mode)
498  nextmode = kDisplayTeletextCaptions;
499  else if (kDisplayTeletextCaptions == Mode)
500  nextmode = pal ? kDisplayNUVTeletextCaptions : kDisplayNone;
501  else if ((kDisplayNUVTeletextCaptions == Mode) && pal)
502  nextmode = kDisplayNone;
503  else if (kDisplayNone == Mode)
504  nextmode = kDisplayTextSubtitle;
505 
506  if (nextmode == kDisplayNone || HasCaptionTrack(nextmode))
507  return nextmode;
508 
509  return NextCaptionTrack(nextmode);
510 }
511 
513 {
514  QMutexLocker locker(&m_osdLock);
515  uint oldcaptions = m_captionsState.m_textDisplayMode;
516  m_captionsOverlay.EnableTeletext(true, Page);
519  if (oldcaptions != m_captionsState.m_textDisplayMode)
521 }
522 
524 {
525  QMutexLocker locker(&m_osdLock);
527  uint oldcaptions = m_captionsState.m_textDisplayMode;
529  if (oldcaptions != m_captionsState.m_textDisplayMode)
531 
532  // If subtitles were enabled before the teletext menu was displayed then re-enable them
535 }
536 
538 {
539  QMutexLocker locker(&m_osdLock);
541 }
542 
546 {
547  m_osdLock.lock();
549  uint oldcaptions = m_captionsState.m_textDisplayMode;
550  m_ttPageNum = static_cast<int>(Page);
554  if (oldcaptions != m_captionsState.m_textDisplayMode)
556  m_osdLock.unlock();
557 }
558 
559 void MythPlayerCaptionsUI::HandleTeletextAction(const QString& Action, bool &Handled)
560 {
562  return;
563 
564  bool exit = false;
565  m_osdLock.lock();
566  Handled = m_captionsOverlay.TeletextAction(Action, exit);
567  m_osdLock.unlock();
568  if (exit)
569  DisableTeletext();
570 }
571 
573 {
574 #ifdef USING_MHEG
575  bool update = false;
576  {
577  QMutexLocker lock1(&m_osdLock);
578  QMutexLocker lock2(&m_itvLock);
580  {
581  m_interactiveTV = new InteractiveTV(this);
582  m_captionsState.m_haveITV = true;
583  update = true;
584  }
585  }
586  if (update)
588 #endif
589  return m_interactiveTV;
590 }
591 
599 void MythPlayerCaptionsUI::ITVHandleAction(const QString &Action, bool& Handled)
600 {
601 #ifdef USING_MHEG
602  if (!GetInteractiveTV())
603  {
604  Handled = false;
605  return;
606  }
607 
608  QMutexLocker locker(&m_itvLock);
609  Handled = m_interactiveTV->OfferKey(Action);
610 #else
611  Q_UNUSED(Action);
612  Q_UNUSED(Handled);
613 #endif
614 }
615 
617 void MythPlayerCaptionsUI::ITVRestart(uint Chanid, uint Cardid, bool IsLiveTV)
618 {
619 #ifdef USING_MHEG
620  if (!GetInteractiveTV())
621  return;
622 
623  QMutexLocker locker(&m_itvLock);
624  m_interactiveTV->Restart(static_cast<int>(Chanid), static_cast<int>(Cardid), IsLiveTV);
625  m_itvVisible = false;
626 #else
627  Q_UNUSED(Chanid);
628  Q_UNUSED(Cardid);
629  Q_UNUSED(IsLiveTV);
630 #endif
631 }
632 
641 {
642  QMutexLocker locker(&m_decoderChangeLock);
643  if (m_decoder)
644  return m_decoder->SetAudioByComponentTag(Tag);
645  return false;
646 }
647 
653 {
654  QMutexLocker locker(&m_decoderChangeLock);
655  if (m_decoder)
656  return m_decoder->SetVideoByComponentTag(Tag);
657  return false;
658 }
659 
661 {
662  QMutexLocker locker(&m_decoderChangeLock);
663  if (!m_decoder)
664  return 25;
665  double fps = m_decoder->GetFPS();
666  return fps > 0 ? fps : 25.0;
667 }
668 
669 void MythPlayerCaptionsUI::SetStream(const QString& Stream)
670 {
671  // The stream name is empty if the stream is closing
672  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("SetStream '%1'").arg(Stream));
673 
674  // Stream will be changed by JumpToStream called from EventLoop
675  // If successful will call m_interactiveTV->StreamStarted();
676  m_newStream = Stream;
677 
678  if (Stream.isEmpty() && m_playerCtx->m_tvchain &&
680  {
681  // Restore livetv
683  m_playerCtx->m_tvchain->JumpToNext(false, 0);
684  m_playerCtx->m_tvchain->JumpToNext(true, 0);
685  }
686 }
687 
688 // Called from the interactiveTV (MHIContext) thread
690 {
691  return static_cast<long>((1000 * GetFramesPlayed()) / SafeFPS());
692 }
693 
694 // Called from the interactiveTV (MHIContext) thread
696 {
697  long maxpos = static_cast<long>(1000 * (m_totalDuration > 0 ? m_totalDuration : m_totalLength));
698  long pos = GetStreamPos();
699  return maxpos > pos ? maxpos : pos;
700 }
701 
703 {
704  auto frameNum = static_cast<uint64_t>((Position * SafeFPS()) / 1000);
705  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("SetStreamPos %1 mS = frame %2, now=%3")
706  .arg(Position).arg(frameNum).arg(GetFramesPlayed()) );
707  JumpToFrame(frameNum);
708  return Position;
709 }
710 
712 {
713  if (Playing)
714  Play();
715  else
716  Pause();
717 }
kTrackTypeUnknown
@ kTrackTypeUnknown
Definition: decoderbase.h:28
MythPlayerCaptionsUI::NextCaptionTrack
uint NextCaptionTrack(uint Mode)
Definition: mythplayercaptionsui.cpp:482
MythPlayerCaptionsUI::GetInteractiveTV
InteractiveTV * GetInteractiveTV() override
Definition: mythplayercaptionsui.cpp:572
MythPlayerCaptionsUI::PlayInteractiveStream
void PlayInteractiveStream(bool Play)
MythPlayerCaptionsUI::SetTrack
virtual void SetTrack(uint Type, uint TrackNo)
Definition: mythplayercaptionsui.cpp:359
DecoderBase::SetVideoByComponentTag
virtual bool SetVideoByComponentTag(int)
Definition: decoderbase.h:255
PlayerContext::GetState
TVState GetState(void) const
Definition: playercontext.cpp:336
MythPlayer::m_enableForcedSubtitles
bool m_enableForcedSubtitles
Definition: mythplayer.h:468
DecoderBase::SetTrack
virtual int SetTrack(uint Type, int TrackNo)
Definition: decoderbase.cpp:957
DecoderBase::GetTrack
int GetTrack(uint Type)
Definition: decoderbase.cpp:951
DecoderBase::NextTrack
int NextTrack(uint Type)
Definition: decoderbase.cpp:1004
kTrackTypeTextSubtitle
@ kTrackTypeTextSubtitle
Definition: decoderbase.h:42
MythPlayer::SetEof
void SetEof(EofState eof)
Definition: mythplayer.cpp:1074
SubtitleReader::TextSubtitlesUpdated
void TextSubtitlesUpdated()
MythCaptionsOverlay::EnableSubtitles
void EnableSubtitles(int Type, bool ForcedOnly=false)
Definition: mythcaptionsoverlay.cpp:187
MythPlayerCaptionsUI::SetAllowForcedSubtitles
void SetAllowForcedSubtitles(bool Allow)
Definition: mythplayercaptionsui.cpp:275
MythPlayerCaptionsUI::GetStreamMaxPos
long GetStreamMaxPos()
Definition: mythplayercaptionsui.cpp:695
kDisplayTeletextMenu
@ kDisplayTeletextMenu
Definition: videoouttypes.h:22
MythPlayer::m_subReader
SubtitleReader m_subReader
Definition: mythplayer.h:461
MythPlayerCaptionsUI::m_newStream
QString m_newStream
Definition: mythplayercaptionsui.h:79
kDisplayNone
@ kDisplayNone
Definition: videoouttypes.h:12
MythPlayer::m_cc608
CC608Reader m_cc608
Definition: mythplayer.h:473
TVPlaybackState::HandleTeletextAction
void HandleTeletextAction(const QString &Action, bool &Handled)
MythPlayerCaptionsUI::GetTrack
int GetTrack(uint Type)
Definition: mythplayercaptionsui.cpp:411
MythPlayer::m_allowForcedSubtitles
bool m_allowForcedSubtitles
Definition: mythplayer.h:470
MythPlayerCaptionsUI::m_itvVisible
bool m_itvVisible
Definition: mythplayercaptionsui.h:78
MythPlayerCaptionsUI::SetInteractiveStream
void SetInteractiveStream(const QString &Stream)
StreamInfo::m_stream_id
int m_stream_id
Definition: decoderbase.h:99
MythPlayerCaptionsUI::ToggleCaptions
void ToggleCaptions()
Definition: mythplayercaptionsui.cpp:281
MythCaptionsOverlay::ClearSubtitles
void ClearSubtitles()
Definition: mythcaptionsoverlay.cpp:203
MythPlayerCaptionsUI::m_itvLock
QMutex m_itvLock
Definition: mythplayercaptionsui.h:76
MythPlayerCaptionsUI::m_lastTextDisplayMode
uint m_lastTextDisplayMode
Definition: mythplayercaptionsui.h:73
arg
arg(title).arg(filename).arg(doDelete))
MythPlayerCaptionsUI::DisableTeletext
void DisableTeletext()
Definition: mythplayercaptionsui.cpp:523
MythCaptionsOverlay::InitSubtitles
SubtitleScreen * InitSubtitles()
Definition: mythcaptionsoverlay.cpp:158
toTrackType
static uint toTrackType(uint Type)
Definition: mythplayercaptionsui.cpp:138
TVPlaybackState::ResetTeletext
void ResetTeletext()
Context
QHash< QString, Action * > Context
Definition: action.h:77
MythPlayer::m_cc708
CC708Reader m_cc708
Definition: mythplayer.h:474
CC608Reader::SetTTPageNum
void SetTTPageNum(int page)
Definition: cc608reader.h:83
MythPlayerCaptionsUI::SetInteractiveStreamPos
void SetInteractiveStreamPos(long Position)
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
DecoderBase::ChangeTrack
int ChangeTrack(uint Type, int Dir)
Definition: decoderbase.cpp:988
TrackType
TrackType
Track types.
Definition: decoderbase.h:27
MythPlayerCaptionsUI::SetStreamPos
long SetStreamPos(long Position)
Definition: mythplayercaptionsui.cpp:702
DecoderBase::SetAudioByComponentTag
virtual bool SetAudioByComponentTag(int)
Definition: decoderbase.h:254
PlayerFlags
PlayerFlags
Definition: mythplayer.h:62
MythPlayer::Pause
bool Pause(void)
Definition: mythplayer.cpp:159
kOSDTimeout_None
@ kOSDTimeout_None
Definition: osd.h:59
TVPlaybackState::EnableCaptions
void EnableCaptions(uint Mode, bool UpdateOSD=true)
MythPlayerCaptionsUI::ITVHandleAction
void ITVHandleAction(const QString &Action, bool &Handled)
Submit Action to the interactiveTV object.
Definition: mythplayercaptionsui.cpp:599
MythPlayerCaptionsUI::ChangeTrack
void ChangeTrack(uint Type, int Direction)
Definition: mythplayercaptionsui.cpp:418
MythPlayerCaptionsUI::GetCaptionMode
uint GetCaptionMode() const override
Definition: mythplayercaptionsui.cpp:286
MythPlayerCaptionsUI::InitialiseState
void InitialiseState() override
Definition: mythplayercaptionsui.cpp:60
TVPlaybackState::ToggleCaptionsByType
void ToggleCaptionsByType(uint Type)
MythCaptionsState::m_textDisplayMode
uint m_textDisplayMode
Definition: mythplayerstate.h:69
MythPlayerCaptionsUI::AdjustSubtitleZoom
void AdjustSubtitleZoom(int Delta)
Definition: mythplayercaptionsui.cpp:83
VBIMode::PAL_TT
@ PAL_TT
Definition: tv.h:12
TVPlaybackState::ToggleCaptions
void ToggleCaptions()
MythPlayerAudioUI
Acts as the interface between the UI and the underlying AudioPlayer object.
Definition: mythplayeraudioui.h:10
Action
An action (for this plugin) consists of a description, and a set of key sequences.
Definition: action.h:41
InteractiveTV::OfferKey
bool OfferKey(const QString &key)
Definition: interactivetv.cpp:67
toCaptionType
static uint toCaptionType(uint Type)
Definition: mythplayercaptionsui.cpp:127
kState_WatchingRecording
@ kState_WatchingRecording
Watching Recording is the state for when we are watching an in progress recording,...
Definition: tv.h:80
MythCaptionsOverlay::EnableTeletext
void EnableTeletext(bool Enable, int Page)
Definition: mythcaptionsoverlay.cpp:108
MythPlayerOverlayUI::UpdateOSDMessage
void UpdateOSDMessage(const QString &Message)
Definition: mythplayeroverlayui.cpp:71
kDisplayCC708
@ kDisplayCC708
Definition: videoouttypes.h:17
DecoderBase::GetTrackDesc
virtual QString GetTrackDesc(uint Type, uint TrackNo)
Definition: decoderbase.cpp:933
DecoderBase::GetTrackCount
virtual uint GetTrackCount(uint Type)
Definition: decoderbase.cpp:903
CC608Reader::SetMode
void SetMode(int mode)
Definition: cc608reader.cpp:150
MythPlayer::GetFramesPlayed
uint64_t GetFramesPlayed(void) const
Definition: mythplayer.h:143
MythPlayer::m_decoder
DecoderBase * m_decoder
Definition: mythplayer.h:366
kDisplayNUVTeletextCaptions
@ kDisplayNUVTeletextCaptions
Definition: videoouttypes.h:13
LiveTVChain::JumpToNext
void JumpToNext(bool up, int pos)
JumpToNext(bool up, int pos) jump to the next (up == true) or previous (up == false) liveTV program I...
Definition: livetvchain.cpp:617
MythPlayer::m_totalLength
long long m_totalLength
Definition: mythplayer.h:429
DecoderBase::GetTrackInfo
StreamInfo GetTrackInfo(uint Type, uint TrackNo)
Definition: decoderbase.cpp:977
subtitlescreen.h
MythPlayerAudioUI::InitialiseState
void InitialiseState() override
Initialise audio and signal initial state.
Definition: mythplayeraudioui.cpp:60
SubtitleReader::LoadExternalSubtitles
void LoadExternalSubtitles(const QString &subtitleFileName, bool isInProgress)
Definition: subtitlereader.cpp:93
TVPlaybackState::AdjustSubtitleZoom
void AdjustSubtitleZoom(int Delta)
TVPlaybackState::ChangeAllowForcedSubtitles
void ChangeAllowForcedSubtitles(bool Allow)
MythPlayerOverlayUI::ChangeOSDPositionUpdates
void ChangeOSDPositionUpdates(bool Enable)
Definition: mythplayeroverlayui.cpp:38
MythPlayerOverlayUI::m_editing
bool m_editing
Definition: mythplayeroverlayui.h:46
TVPlaybackState::AdjustSubtitleDelay
void AdjustSubtitleDelay(int Delta)
MythPlayerCaptionsUI::SetAudioByComponentTag
bool SetAudioByComponentTag(int Tag)
Selects the audio stream using the DVB component tag.
Definition: mythplayercaptionsui.cpp:640
MythMediaBuffer::GetSubtitleFilename
QString GetSubtitleFilename(void) const
Definition: mythmediabuffer.cpp:1745
MythPlayerCaptionsUI::m_lastValidTextDisplayMode
uint m_lastValidTextDisplayMode
Definition: mythplayercaptionsui.h:74
MythPlayerCaptionsUI::m_captionsOverlay
MythCaptionsOverlay m_captionsOverlay
Definition: mythplayercaptionsui.h:70
PlayerContext::m_buffer
MythMediaBuffer * m_buffer
Definition: playercontext.h:115
kOSDFunctionalType_SubtitleDelayAdjust
@ kOSDFunctionalType_SubtitleDelayAdjust
Definition: osd.h:53
MythCaptionsOverlay::TeletextAction
bool TeletextAction(const QString &Action, bool &Exit)
Definition: mythcaptionsoverlay.cpp:127
TVPlaybackState::SetTeletextPage
void SetTeletextPage(uint Page)
TVPlaybackState::ResetCaptions
void ResetCaptions()
MythPlayer::m_totalDuration
int64_t m_totalDuration
Definition: mythplayer.h:430
MythPlayerCaptionsUI::ITVRestart
void ITVRestart(uint Chanid, uint Cardid, bool IsLiveTV)
Restart the MHEG/MHP engine.
Definition: mythplayercaptionsui.cpp:617
kTrackTypeTeletextCaptions
@ kTrackTypeTeletextCaptions
Definition: decoderbase.h:34
TVPlaybackState::HandleITVAction
void HandleITVAction(const QString &Action, bool &Handled)
MythPlayerCaptionsUI::ResetTeletext
void ResetTeletext()
Definition: mythplayercaptionsui.cpp:537
TVPlaybackState::RestartITV
void RestartITV(uint Chanid, uint Cardid, bool IsLiveTV)
MythPlayerCaptionsUI::GetTracks
QStringList GetTracks(uint Type)
Definition: mythplayercaptionsui.cpp:345
clamp
float clamp(float val, float minimum, float maximum)
Definition: mythmiscutil.h:59
MythCaptionsOverlay::TeletextReset
void TeletextReset()
Definition: mythcaptionsoverlay.cpp:138
filename
QString filename
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:637
MythPlayer::m_ttPageNum
int m_ttPageNum
VBI page to display when in PAL vbimode.
Definition: mythplayer.h:458
TVPlaybackState::SetCaptionsEnabled
void SetCaptionsEnabled(bool Enable, bool UpdateOSD=true)
MythPlayerOverlayUI::m_browsing
bool m_browsing
Definition: mythplayeroverlayui.h:45
kMythBufferMHEG
@ kMythBufferMHEG
Definition: mythmediabuffer.h:46
MythPlayer::m_playerCtx
PlayerContext * m_playerCtx
Definition: mythplayer.h:369
DecoderBase::GetFPS
virtual double GetFPS(void) const
Definition: decoderbase.h:197
MythPlayerCaptionsUI::SetTeletextPage
void SetTeletextPage(uint Page)
Set Teletext NUV Caption page.
Definition: mythplayercaptionsui.cpp:545
MythPlayerCaptionsUI::SetCaptionsEnabled
void SetCaptionsEnabled(bool Enable, bool UpdateOSD=true)
Definition: mythplayercaptionsui.cpp:307
kDisplayRawTextSubtitle
@ kDisplayRawTextSubtitle
Definition: videoouttypes.h:20
MythPlayer::m_disableForcedSubtitles
bool m_disableForcedSubtitles
Definition: mythplayer.h:469
kTrackTypeAudio
@ kTrackTypeAudio
Definition: decoderbase.h:29
MythPlayerCaptionsUI::SafeFPS
double SafeFPS()
Definition: mythplayercaptionsui.cpp:660
kTrackTypeCC708
@ kTrackTypeCC708
Definition: decoderbase.h:33
kNoITV
@ kNoITV
Definition: mythplayer.h:72
MythPlayer::RequestResetCaptions
void RequestResetCaptions()
MythPlayerCaptionsUI::EnableTeletext
void EnableTeletext(int Page=0x100)
Definition: mythplayercaptionsui.cpp:512
uint
unsigned int uint
Definition: compat.h:141
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
PlayerContext::m_tvchain
LiveTVChain * m_tvchain
Definition: playercontext.h:114
kDisplayAllTextCaptions
@ kDisplayAllTextCaptions
Definition: videoouttypes.h:23
MythPlayer::m_vbiMode
uint m_vbiMode
VBI decoder to use.
Definition: mythplayer.h:457
kTrackTypeSubtitle
@ kTrackTypeSubtitle
Definition: decoderbase.h:31
kOSDFunctionalType_SubtitleZoomAdjust
@ kOSDFunctionalType_SubtitleZoomAdjust
Definition: osd.h:52
MythPlayerCaptionsUI::DisableCaptions
virtual void DisableCaptions(uint Mode, bool UpdateOSD=true)
Definition: mythplayercaptionsui.cpp:149
TVPlaybackState::SetTrack
void SetTrack(uint Type, uint TrackNo)
MythPlayerCaptionsUI::ResetCaptions
void ResetCaptions()
Definition: mythplayercaptionsui.cpp:121
MythCoreContext::GetBoolSetting
bool GetBoolSetting(const QString &key, bool defaultval=false)
Definition: mythcorecontext.cpp:927
MythPlayerCaptionsUI::DoEnableForcedSubtitles
void DoEnableForcedSubtitles()
Definition: mythplayercaptionsui.cpp:400
MythPlayer::m_enableCaptions
bool m_enableCaptions
Definition: mythplayer.h:466
MythPlayerCaptionsUI::EnableCaptions
virtual void EnableCaptions(uint Mode, bool UpdateOSD=true)
Definition: mythplayercaptionsui.cpp:209
MythPlayerCaptionsUI::~MythPlayerCaptionsUI
~MythPlayerCaptionsUI() override
Definition: mythplayercaptionsui.cpp:55
CC708Reader::SetCurrentService
void SetCurrentService(int service)
Definition: cc708reader.h:22
MythPlayerCaptionsUI::ToggleCaptionsByType
void ToggleCaptionsByType(uint Type)
Definition: mythplayercaptionsui.cpp:291
MythPlayerCaptionsUI::m_textDesired
bool m_textDesired
Definition: mythplayercaptionsui.h:72
MythPlayerCaptionsUI::GetStreamPos
long GetStreamPos()
Definition: mythplayercaptionsui.cpp:689
MythPlayerCaptionsUI::ExternalSubtitlesUpdated
void ExternalSubtitlesUpdated()
Definition: mythplayercaptionsui.cpp:77
TVPlaybackState::EnableTeletext
void EnableTeletext(int Page=0x100)
livetvchain.h
kTrackTypeCC608
@ kTrackTypeCC608
Definition: decoderbase.h:32
MythPlayerCaptionsUI::LoadExternalSubtitles
void LoadExternalSubtitles()
Definition: mythplayercaptionsui.cpp:68
MythCaptionsOverlay::TeletextClear
void TeletextClear()
Definition: mythcaptionsoverlay.cpp:148
MythPlayerCaptionsUI::SetStream
void SetStream(const QString &Stream)
Definition: mythplayercaptionsui.cpp:669
OptionalCaptionEnabled
bool OptionalCaptionEnabled(uint Captions)
Return whether any optional captions are enabled.
Definition: videoouttypes.h:30
kEofStateDelayed
@ kEofStateDelayed
Definition: decoderbase.h:70
MythPlayerCaptionsUI::m_itvEnabled
bool m_itvEnabled
Definition: mythplayercaptionsui.h:77
MythPlayer::m_disableCaptions
bool m_disableCaptions
Definition: mythplayer.h:467
kDisplayAllCaptions
@ kDisplayAllCaptions
Definition: videoouttypes.h:21
MythPlayerCaptionsUI::StreamPlay
void StreamPlay(bool Playing=true)
Definition: mythplayercaptionsui.cpp:711
MythPlayerCaptionsUI::m_interactiveTV
InteractiveTV * m_interactiveTV
Definition: mythplayercaptionsui.h:75
MythPlayerUIBase::m_tv
TV * m_tv
Definition: mythplayeruibase.h:15
MythPlayerCaptionsUI::DoDisableForcedSubtitles
void DoDisableForcedSubtitles()
Definition: mythplayercaptionsui.cpp:392
kDisplayCC608
@ kDisplayCC608
Definition: videoouttypes.h:16
SubtitleReader::HasTextSubtitles
bool HasTextSubtitles(void)
Definition: subtitlereader.cpp:102
kState_WatchingLiveTV
@ kState_WatchingLiveTV
Watching LiveTV is the state for when we are watching a recording and the user has control over the c...
Definition: tv.h:63
PlayerContext
Definition: playercontext.h:49
TVPlaybackState::DisableCaptions
void DisableCaptions(uint Mode, bool UpdateOSD=true)
MythPlayerOverlayUI::UpdateOSDStatus
void UpdateOSDStatus(osdInfo &Info, int Type, enum OSDTimeout Timeout)
Definition: mythplayeroverlayui.cpp:96
TVPlaybackState::ChangeCaptionTrack
void ChangeCaptionTrack(int Direction)
MythPlayerCaptionsUI::CaptionsStateChanged
void CaptionsStateChanged(MythCaptionsState &CaptionsState)
interactivetv.h
kTrackTypeRawText
@ kTrackTypeRawText
Definition: decoderbase.h:36
MythPlayerCaptionsUI::AdjustSubtitleDelay
void AdjustSubtitleDelay(int Delta)
Definition: mythplayercaptionsui.cpp:100
MythPlayerCaptionsUI::SetVideoByComponentTag
bool SetVideoByComponentTag(int Tag)
Selects the video stream using the DVB component tag.
Definition: mythplayercaptionsui.cpp:652
TVPlaybackState::CaptionsStateChanged
void CaptionsStateChanged(MythCaptionsState CaptionsState)
Definition: tvplaybackstate.cpp:33
MythPlayer::JumpToFrame
virtual bool JumpToFrame(uint64_t frame)
Definition: mythplayer.cpp:883
MythPlayerCaptionsUI::MythPlayerCaptionsUI
MythPlayerCaptionsUI(MythMainWindow *MainWindow, TV *Tv, PlayerContext *Context, PlayerFlags Flags)
Definition: mythplayercaptionsui.cpp:10
MythPlayer::m_decoderChangeLock
QMutex m_decoderChangeLock
Definition: mythplayer.h:367
MythPlayerCaptionsUI::m_captionsState
MythCaptionsState m_captionsState
Definition: mythplayercaptionsui.h:71
MythPlayer::SignalTracksChanged
void SignalTracksChanged(uint Type)
MythPlayerCaptionsUI::TracksChanged
void TracksChanged(uint TrackType)
This tries to re-enable captions/subtitles if the user wants them and one of the captions/subtitles t...
Definition: mythplayercaptionsui.cpp:266
MythCaptionsState::m_externalTextSubs
bool m_externalTextSubs
Definition: mythplayerstate.h:70
MythPlayerCaptionsUI::GetTrackCount
uint GetTrackCount(uint Type)
Definition: mythplayercaptionsui.cpp:352
InteractiveTV
This is the interface between an MHEG engine and a MythTV TV object.
Definition: interactivetv.h:16
MythCaptionsState::m_haveITV
bool m_haveITV
Definition: mythplayerstate.h:71
DecoderBase::GetTracks
virtual QStringList GetTracks(uint Type)
Definition: decoderbase.cpp:916
kDisplayAVSubtitle
@ kDisplayAVSubtitle
Definition: videoouttypes.h:15
kDisplayTextSubtitle
@ kDisplayTextSubtitle
Definition: videoouttypes.h:18
FlagIsSet
#define FlagIsSet(arg)
Definition: mythplayer.h:76
LOC
#define LOC
Definition: mythplayercaptionsui.cpp:8
MythPlayerCaptionsUI::HasCaptionTrack
bool HasCaptionTrack(uint Mode)
Definition: mythplayercaptionsui.cpp:468
kOSDTimeout_Med
@ kOSDTimeout_Med
Definition: osd.h:61
InteractiveTV::Restart
void Restart(int chanid, int sourceid, bool isLive)
Definition: interactivetv.cpp:35
MythMainWindow
Definition: mythmainwindow.h:35
MythPlayer::Play
bool Play(float speed=1.0, bool normal=true, bool unpauseaudio=true)
Definition: mythplayer.cpp:192
mythplayercaptionsui.h
DecoderBase::GetTrackLanguageIndex
virtual int GetTrackLanguageIndex(uint Type, uint TrackNo)
Definition: decoderbase.cpp:925
TVPlaybackState::ChangeTrack
void ChangeTrack(uint Type, int Direction)
MythMediaBuffer::GetType
MythBufferType GetType() const
Definition: mythmediabuffer.cpp:205
tv_play.h
MythPlayerCaptionsUI::ChangeCaptionTrack
void ChangeCaptionTrack(int Direction)
Definition: mythplayercaptionsui.cpp:431
MythCaptionsOverlay::DisableForcedSubtitles
void DisableForcedSubtitles()
Definition: mythcaptionsoverlay.cpp:194
MythPlayerCaptionsUI::HandleTeletextAction
void HandleTeletextAction(const QString &Action, bool &Handled)
Definition: mythplayercaptionsui.cpp:559
TV
Control TV playback.
Definition: tv_play.h:153
MythPlayerOverlayUI::m_osdLock
QMutex m_osdLock
Definition: mythplayeroverlayui.h:44
kDisplayTeletextCaptions
@ kDisplayTeletextCaptions
Definition: videoouttypes.h:14