MythTV  master
mythplayercaptionsui.cpp
Go to the documentation of this file.
1 // MythTV
4 
6 #include "livetvchain.h"
7 #include "mheg/interactivetv.h"
8 #include "mythplayercaptionsui.h"
9 #include "tv_play.h"
10 
11 #define LOC QString("PlayerCaptions: ")
12 
14  : MythPlayerAudioUI(MainWindow, Tv, Context, Flags),
15  m_captionsOverlay(MainWindow, Tv, nullptr, m_painter)
16 {
17  // Register state type for signalling
18  qRegisterMetaType<MythCaptionsState>();
19 
20  m_itvEnabled = gCoreContext->GetBoolSetting("EnableMHEG", false);
21 
22  // Connect outgoing
24 
25  // Inbound connections
45 
46  // Signalled connections (from MHIContext)
50 
51  // Signalled from the decoder
52  connect(this, &MythPlayerCaptionsUI::EnableSubtitles, this, [this](bool Enable) { this->SetCaptionsEnabled(Enable, false); });
53 
54  // Signalled from the base class
56 }
57 
59 {
60  delete m_interactiveTV;
61 }
62 
64 {
65  LOG(VB_GENERAL, LOG_INFO, LOC + "Initialising captions");
69 }
70 
72 {
74  bool inprogress = (m_playerCtx->GetState() == kState_WatchingRecording ||
78 }
79 
81 {
84 }
85 
87 {
89  return;
90 
91  if (auto * subs = m_captionsOverlay.InitSubtitles(); subs)
92  {
93  auto newval = std::clamp(subs->GetZoom() + Delta, 50, 200);
94  UpdateOSDStatus(tr("Adjust Subtitle Zoom"), tr("Subtitle Zoom"),
95  QString::number(newval), kOSDFunctionalType_SubtitleZoomAdjust,
96  "%", newval * 1000 / 200, kOSDTimeout_None);
98  subs->SetZoom(newval);
99  }
100 }
101 
102 void MythPlayerCaptionsUI::AdjustSubtitleDelay(std::chrono::milliseconds Delta)
103 {
106  if (!showing || (m_browsing || m_editing))
107  return;
108 
109  if (auto * subs = m_captionsOverlay.InitSubtitles(); subs)
110  {
111  auto newval = std::clamp(subs->GetDelay() + (Delta * 10), -5000ms, 5000ms);
112  // range of -5000ms..+5000ms, scale to 0..1000
113  UpdateOSDStatus(tr("Adjust Subtitle Delay"), tr("Subtitle Delay"),
114  QString::number(newval.count()), kOSDFunctionalType_SubtitleDelayAdjust,
115  "ms", (newval.count() / 10) + 500, kOSDTimeout_None);
117  subs->SetDelay(newval);
118  }
119 
120 }
121 
123 {
126 }
127 
128 static uint toCaptionType(uint Type)
129 {
130  if (kTrackTypeCC608 == Type) return kDisplayCC608;
131  if (kTrackTypeCC708 == Type) return kDisplayCC708;
132  if (kTrackTypeSubtitle == Type) return kDisplayAVSubtitle;
134  if (kTrackTypeTextSubtitle == Type) return kDisplayTextSubtitle;
135  if (kTrackTypeRawText == Type) return kDisplayRawTextSubtitle;
136  return 0;
137 }
138 
139 static uint toTrackType(uint Type)
140 {
141  if (kDisplayCC608 == Type) return kTrackTypeCC608;
142  if (kDisplayCC708 == Type) return kTrackTypeCC708;
143  if (kDisplayAVSubtitle == Type) return kTrackTypeSubtitle;
145  if (kDisplayTextSubtitle == Type) return kTrackTypeTextSubtitle;
146  if (kDisplayRawTextSubtitle == Type) return kTrackTypeRawText;
147  return kTrackTypeUnknown;
148 }
149 
151 {
152  auto oldcaptions = m_captionsState.m_textDisplayMode;
156  if (oldcaptions != m_captionsState.m_textDisplayMode)
158  ResetCaptions();
159 
160  QMutexLocker locker(&m_osdLock);
161 
162  bool newTextDesired = (m_captionsState.m_textDisplayMode & kDisplayAllTextCaptions) != 0U;
163  // Only turn off textDesired if the Operator requested it.
164  if (UpdateOSD || newTextDesired)
165  m_textDesired = newTextDesired;
166 
167  auto msg = (kDisplayNUVTeletextCaptions & Mode) ? tr("TXT CAP") : "";
169  {
170  if (auto track = GetTrack(kTrackTypeTeletextCaptions); (track > 1) && (m_decoder != nullptr))
171  msg += m_decoder->GetTrackDesc(kTrackTypeTeletextCaptions, static_cast<uint>(track));
172  DisableTeletext();
173  }
177  if ((kDisplayCC608 & Mode) || (kDisplayCC708 & Mode) ||
179  {
180  if (uint type = toTrackType(Mode); m_decoder != nullptr)
181  if (auto track = GetTrack(type); track > -1)
182  msg += m_decoder->GetTrackDesc(type, static_cast<uint>(track));
183 
185  }
186 
188  {
189  msg += tr("Text subtitles");
191  }
192 
193  if (!msg.isEmpty() && UpdateOSD)
194  {
195  msg += " " + tr("Off");
197  }
198 }
199 
201 {
202  QMutexLocker locker(&m_osdLock);
203  bool newTextDesired = (Mode & kDisplayAllTextCaptions) != 0U;
204  // Only turn off textDesired if the Operator requested it.
205  if (UpdateOSD || newTextDesired)
206  m_textDesired = newTextDesired;
207  QString msg;
208  if ((kDisplayCC608 & Mode) || (kDisplayCC708 & Mode) ||
210  {
211  if (auto type = toTrackType(Mode); m_decoder != nullptr)
212  if (auto track = GetTrack(type); track > -1)
213  msg += m_decoder->GetTrackDesc(type, static_cast<uint>(track));
214 
215  m_captionsOverlay.EnableSubtitles(static_cast<int>(Mode));
216  }
217 
219  {
222  subs->m_needSync = true;
223  msg += tr("Text subtitles");
224  }
225 
227  msg += tr("TXT %1").arg(m_ttPageNum, 3, 16);
228 
229  if ((kDisplayTeletextCaptions & Mode) && (m_decoder != nullptr))
230  {
232  static_cast<uint>(GetTrack(kTrackTypeTeletextCaptions)));
233 
235  static_cast<uint>(GetTrack(kTrackTypeTeletextCaptions)));
236 
237  EnableTeletext(page);
238  }
239 
240  msg += " " + tr("On");
241  LOG(VB_PLAYBACK, LOG_INFO, QString("EnableCaptions(%1) msg: %2").arg(Mode).arg(msg));
242 
243  auto oldcaptions = m_captionsState.m_textDisplayMode;
247  if (oldcaptions != m_captionsState.m_textDisplayMode)
249  if (UpdateOSD)
251 }
252 
257 {
259  SetCaptionsEnabled(true, false);
260 }
261 
263 {
264  m_allowForcedSubtitles = Allow;
265  UpdateOSDMessage(m_allowForcedSubtitles ? tr("Forced Subtitles On") : tr("Forced Subtitles Off"));
266 }
267 
269 {
271 }
272 
274 {
275  QMutexLocker locker(&m_osdLock);
276  auto mode = toCaptionType(Type);
277  auto origmode = m_captionsState.m_textDisplayMode;
279  DisableCaptions(m_captionsState.m_textDisplayMode, (origmode & mode) != 0U);
280  if (origmode & mode)
281  return;
282  if (mode)
283  EnableCaptions(mode);
284 }
285 
286 void MythPlayerCaptionsUI::SetCaptionsEnabled(bool Enable, bool UpdateOSD)
287 {
288  QMutexLocker locker(&m_osdLock);
289  auto origmode = m_captionsState.m_textDisplayMode;
290 
291  // Only turn off textDesired if the Operator requested it.
292  if (UpdateOSD || Enable)
293  m_textDesired = Enable;
294 
295  if (!Enable)
296  {
297  DisableCaptions(origmode, UpdateOSD);
298  return;
299  }
300 
303  {
304  DisableCaptions(origmode, false);
305  if (kDisplayNone == mode)
306  {
307  if (UpdateOSD)
308  UpdateOSDMessage(tr("No captions", "CC/Teletext/Subtitle text not available"), kOSDTimeout_Med);
309  LOG(VB_PLAYBACK, LOG_INFO, "No captions available yet to enable.");
310  }
311  else
312  {
313  EnableCaptions(mode, UpdateOSD);
314  }
315  }
316  ResetCaptions();
317 }
318 
320 {
321  if (m_decoder)
322  return m_decoder->GetTracks(Type);
323  return {};
324 }
325 
327 {
328  if (m_decoder)
329  return m_decoder->GetTrackCount(Type);
330  return 0;
331 }
332 
334 {
335  if (!m_decoder)
336  return;
337 
338  m_decoder->SetTrack(Type, static_cast<int>(TrackNo));
339  if (kTrackTypeAudio == Type)
340  {
341  UpdateOSDMessage(m_decoder->GetTrackDesc(Type, static_cast<uint>(GetTrack(Type))), kOSDTimeout_Med);
342  }
343  else if (auto subtype = toCaptionType(Type); subtype)
344  {
346  EnableCaptions(subtype, true);
347  if ((kDisplayCC708 == subtype || kDisplayCC608 == subtype) && m_decoder)
348  if (auto sid = m_decoder->GetTrackInfo(Type, TrackNo).m_stream_id; sid > 0)
349  (kDisplayCC708 == subtype) ? m_cc708.SetCurrentService(sid) : m_cc608.SetMode(sid);
350  }
351 }
352 
354 {
355  m_disableForcedSubtitles = false;
356  m_osdLock.lock();
358  m_osdLock.unlock();
359 }
360 
362 {
363  m_enableForcedSubtitles = false;
365  return;
366 
367  m_osdLock.lock();
369  m_osdLock.unlock();
370 }
371 
373 {
374  if (m_decoder)
375  return m_decoder->GetTrack(Type);
376  return -1;
377 }
378 
379 void MythPlayerCaptionsUI::ChangeTrack(uint Type, int Direction)
380 {
381  if (!m_decoder)
382  return;
383  if (auto ret = m_decoder->ChangeTrack(Type, Direction); ret >= 0)
384  UpdateOSDMessage(m_decoder->GetTrackDesc(Type, static_cast<uint>(GetTrack(Type))), kOSDTimeout_Med);
385 }
386 
388 {
389  if (!m_decoder || (Direction < 0))
390  return;
391 
395  {
397  if (GetTrack(tracktype) < m_decoder->NextTrack(tracktype))
398  {
399  SetTrack(tracktype, static_cast<uint>(m_decoder->NextTrack(tracktype)));
400  return;
401  }
402  }
404  if ((nextmode == kDisplayTextSubtitle) || (nextmode == kDisplayNUVTeletextCaptions) ||
405  (nextmode == kDisplayNone))
406  {
408  if (nextmode != kDisplayNone)
409  EnableCaptions(nextmode, true);
410  }
411  else
412  {
413  uint tracktype = toTrackType(nextmode);
414  uint tracks = m_decoder->GetTrackCount(tracktype);
415  if (tracks)
416  {
418  SetTrack(tracktype, 0);
419  }
420  }
421 }
422 
424 {
425  if (Mode == kDisplayNone)
426  return false;
428  return true;
429  // External subtitles are now decoded with FFmpeg and are AVSubtitles.
431  return true;
433  return true;
434  return false;
435 }
436 
438 {
439  // Text->TextStream->708->608->AVSubs->Teletext->NUV->None
440  // NUV only offerred if PAL
441  bool pal = (m_vbiMode == VBIMode::PAL_TT);
442  uint nextmode = kDisplayNone;
443 
444  if (kDisplayTextSubtitle == Mode)
445  nextmode = kDisplayRawTextSubtitle;
446  else if (kDisplayRawTextSubtitle == Mode)
447  nextmode = kDisplayCC708;
448  else if (kDisplayCC708 == Mode)
449  nextmode = kDisplayCC608;
450  else if (kDisplayCC608 == Mode)
451  nextmode = kDisplayAVSubtitle;
452  else if (kDisplayAVSubtitle == Mode)
453  nextmode = kDisplayTeletextCaptions;
454  else if (kDisplayTeletextCaptions == Mode)
455  nextmode = pal ? kDisplayNUVTeletextCaptions : kDisplayNone;
456  else if ((kDisplayNUVTeletextCaptions == Mode) && pal)
457  nextmode = kDisplayNone;
458  else if (kDisplayNone == Mode)
459  nextmode = kDisplayTextSubtitle;
460 
461  if (nextmode == kDisplayNone || HasCaptionTrack(nextmode))
462  return nextmode;
463 
464  return NextCaptionTrack(nextmode);
465 }
466 
468 {
469  QMutexLocker locker(&m_osdLock);
470  auto oldcaptions = m_captionsState.m_textDisplayMode;
471  m_captionsOverlay.EnableTeletext(true, Page);
474  if (oldcaptions != m_captionsState.m_textDisplayMode)
476 }
477 
479 {
480  QMutexLocker locker(&m_osdLock);
482  auto oldcaptions = m_captionsState.m_textDisplayMode;
484  if (oldcaptions != m_captionsState.m_textDisplayMode)
486 
487  // If subtitles were enabled before the teletext menu was displayed then re-enable them
490 }
491 
493 {
494  QMutexLocker locker(&m_osdLock);
496 }
497 
501 {
502  m_osdLock.lock();
504  auto oldcaptions = m_captionsState.m_textDisplayMode;
505  m_ttPageNum = static_cast<int>(Page);
509  if (oldcaptions != m_captionsState.m_textDisplayMode)
511  m_osdLock.unlock();
512 }
513 
514 void MythPlayerCaptionsUI::HandleTeletextAction(const QString& Action, bool &Handled)
515 {
517  return;
518 
519  bool exit = false;
520  m_osdLock.lock();
521  Handled = m_captionsOverlay.TeletextAction(Action, exit);
522  m_osdLock.unlock();
523  if (exit)
524  DisableTeletext();
525 }
526 
528 {
529 #ifdef USING_MHEG
530  bool update = false;
531  {
532  QMutexLocker lock1(&m_osdLock);
533  QMutexLocker lock2(&m_itvLock);
535  {
536  m_interactiveTV = new InteractiveTV(this);
537  m_captionsState.m_haveITV = true;
538  update = true;
539  }
540  }
541  if (update)
543 #endif
544  return m_interactiveTV;
545 }
546 
554 void MythPlayerCaptionsUI::ITVHandleAction([[maybe_unused]] const QString &Action,
555  [[maybe_unused]] bool& Handled)
556 {
557 #ifdef USING_MHEG
558  if (!GetInteractiveTV())
559  {
560  Handled = false;
561  return;
562  }
563 
564  QMutexLocker locker(&m_itvLock);
565  Handled = m_interactiveTV->OfferKey(Action);
566 #endif
567 }
568 
570 void MythPlayerCaptionsUI::ITVRestart([[maybe_unused]] uint Chanid,
571  [[maybe_unused]] uint Cardid,
572  [[maybe_unused]] bool IsLiveTV)
573 {
574 #ifdef USING_MHEG
575  if (!GetInteractiveTV())
576  return;
577 
578  QMutexLocker locker(&m_itvLock);
579  m_interactiveTV->Restart(static_cast<int>(Chanid), static_cast<int>(Cardid), IsLiveTV);
580  m_itvVisible = false;
581 #endif
582 }
583 
592 {
593  QMutexLocker locker(&m_decoderChangeLock);
594  if (m_decoder)
595  return m_decoder->SetAudioByComponentTag(Tag);
596  return false;
597 }
598 
604 {
605  QMutexLocker locker(&m_decoderChangeLock);
606  if (m_decoder)
607  return m_decoder->SetVideoByComponentTag(Tag);
608  return false;
609 }
610 
612 {
613  QMutexLocker locker(&m_decoderChangeLock);
614  if (!m_decoder)
615  return 25;
616  double fps = m_decoder->GetFPS();
617  return fps > 0 ? fps : 25.0;
618 }
619 
620 void MythPlayerCaptionsUI::SetStream(const QString& Stream)
621 {
622  // The stream name is empty if the stream is closing
623  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("SetStream '%1'").arg(Stream));
624 
625  // Stream will be changed by JumpToStream called from EventLoop
626  // If successful will call m_interactiveTV->StreamStarted();
627  m_newStream = Stream;
628 
629  if (Stream.isEmpty() && m_playerCtx->m_tvchain && m_playerCtx->m_buffer->GetType() == kMythBufferMHEG)
630  {
631  // Restore livetv
633  m_playerCtx->m_tvchain->JumpToNext(false, 0s);
634  m_playerCtx->m_tvchain->JumpToNext(true, 0s);
635  }
636 }
637 
638 // Called from the interactiveTV (MHIContext) thread
639 std::chrono::milliseconds MythPlayerCaptionsUI::GetStreamPos()
640 {
641  return millisecondsFromFloat((1000 * GetFramesPlayed()) / SafeFPS());
642 }
643 
644 // Called from the interactiveTV (MHIContext) thread
645 std::chrono::milliseconds MythPlayerCaptionsUI::GetStreamMaxPos()
646 {
647  std::chrono::seconds maxsecs = m_totalDuration > 0s ? m_totalDuration : m_totalLength;
648  auto maxpos = duration_cast<std::chrono::milliseconds>(maxsecs);
649  auto pos = GetStreamPos();
650  return maxpos > pos ? maxpos : pos;
651 }
652 
653 void MythPlayerCaptionsUI::SetStreamPos(std::chrono::milliseconds Position)
654 {
655  auto frameNum = static_cast<uint64_t>((Position.count() * SafeFPS()) / 1000);
656  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("SetStreamPos %1 mS = frame %2, now=%3")
657  .arg(Position.count()).arg(frameNum).arg(GetFramesPlayed()) );
658  JumpToFrame(frameNum);
659 }
660 
662 {
663  if (Playing)
664  Play();
665  else
666  Pause();
667 }
MythPlayerCaptionsUI::NextCaptionTrack
uint NextCaptionTrack(uint Mode)
Definition: mythplayercaptionsui.cpp:437
MythPlayerCaptionsUI::GetInteractiveTV
InteractiveTV * GetInteractiveTV() override
Definition: mythplayercaptionsui.cpp:527
MythPlayerCaptionsUI::PlayInteractiveStream
void PlayInteractiveStream(bool Play)
kTrackTypeCC708
@ kTrackTypeCC708
Definition: decoderbase.h:33
kTrackTypeUnknown
@ kTrackTypeUnknown
Definition: decoderbase.h:28
MythPlayerCaptionsUI::SetTrack
virtual void SetTrack(uint Type, uint TrackNo)
Definition: mythplayercaptionsui.cpp:333
DecoderBase::SetVideoByComponentTag
virtual bool SetVideoByComponentTag(int)
Definition: decoderbase.h:246
PlayerContext::GetState
TVState GetState(void) const
Definition: playercontext.cpp:331
MythPlayer::m_enableForcedSubtitles
bool m_enableForcedSubtitles
Definition: mythplayer.h:463
DecoderBase::SetTrack
virtual int SetTrack(uint Type, int TrackNo)
Definition: decoderbase.cpp:951
DecoderBase::GetTrack
int GetTrack(uint Type)
Definition: decoderbase.cpp:945
DecoderBase::NextTrack
int NextTrack(uint Type)
Definition: decoderbase.cpp:1005
MythPlayer::m_decoderChangeLock
QRecursiveMutex m_decoderChangeLock
Definition: mythplayer.h:363
LiveTVChain::JumpToNext
void JumpToNext(bool up, std::chrono::seconds pos)
jump to the next (up == true) or previous (up == false) liveTV program If pos > 0: indicate the absol...
Definition: livetvchain.cpp:619
MythPlayer::SetEof
void SetEof(EofState eof)
Definition: mythplayer.cpp:1077
SubtitleReader::TextSubtitlesUpdated
void TextSubtitlesUpdated()
MythCaptionsOverlay::EnableSubtitles
void EnableSubtitles(int Type, bool ForcedOnly=false)
Definition: mythcaptionsoverlay.cpp:189
MythPlayerCaptionsUI::SetAllowForcedSubtitles
void SetAllowForcedSubtitles(bool Allow)
Definition: mythplayercaptionsui.cpp:262
kTrackTypeSubtitle
@ kTrackTypeSubtitle
Definition: decoderbase.h:31
MythPlayer::m_subReader
SubtitleReader m_subReader
Definition: mythplayer.h:458
MythPlayerCaptionsUI::m_newStream
QString m_newStream
Definition: mythplayercaptionsui.h:79
MythPlayer::m_cc608
CC608Reader m_cc608
Definition: mythplayer.h:468
TVPlaybackState::HandleTeletextAction
void HandleTeletextAction(const QString &Action, bool &Handled)
MythPlayerCaptionsUI::GetTrack
int GetTrack(uint Type)
Definition: mythplayercaptionsui.cpp:372
MythPlayer::m_allowForcedSubtitles
bool m_allowForcedSubtitles
Definition: mythplayer.h:465
MythPlayerCaptionsUI::m_itvVisible
bool m_itvVisible
Definition: mythplayercaptionsui.h:78
MythPlayerCaptionsUI::SetInteractiveStream
void SetInteractiveStream(const QString &Stream)
MythPlayer::m_totalDuration
std::chrono::seconds m_totalDuration
Definition: mythplayer.h:427
StreamInfo::m_stream_id
int m_stream_id
Definition: decoderbase.h:104
MythPlayerCaptionsUI::ToggleCaptions
void ToggleCaptions()
Definition: mythplayercaptionsui.cpp:268
MythCaptionsOverlay::ClearSubtitles
void ClearSubtitles()
Definition: mythcaptionsoverlay.cpp:206
kOSDTimeout_Med
@ kOSDTimeout_Med
Definition: osd.h:60
kDisplayCC708
@ kDisplayCC708
Definition: videoouttypes.h:17
MythPlayerCaptionsUI::m_itvLock
QMutex m_itvLock
Definition: mythplayercaptionsui.h:76
MythPlayerCaptionsUI::m_lastTextDisplayMode
uint m_lastTextDisplayMode
Definition: mythplayercaptionsui.h:73
MythPlayerCaptionsUI::DisableTeletext
void DisableTeletext()
Definition: mythplayercaptionsui.cpp:478
MythCaptionsOverlay::InitSubtitles
SubtitleScreen * InitSubtitles()
Definition: mythcaptionsoverlay.cpp:160
toTrackType
static uint toTrackType(uint Type)
Definition: mythplayercaptionsui.cpp:139
TVPlaybackState::ResetTeletext
void ResetTeletext()
MythPlayerCaptionsUI::AdjustSubtitleDelay
void AdjustSubtitleDelay(std::chrono::milliseconds Delta)
Definition: mythplayercaptionsui.cpp:102
MythPlayer::m_cc708
CC708Reader m_cc708
Definition: mythplayer.h:469
MythPlayerCaptionsUI::GetStreamPos
std::chrono::milliseconds GetStreamPos()
Definition: mythplayercaptionsui.cpp:639
CC608Reader::SetTTPageNum
void SetTTPageNum(int page)
Definition: cc608reader.h:84
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
DecoderBase::ChangeTrack
int ChangeTrack(uint Type, int Dir)
Definition: decoderbase.cpp:989
DecoderBase::SetAudioByComponentTag
virtual bool SetAudioByComponentTag(int)
Definition: decoderbase.h:245
PlayerFlags
PlayerFlags
Definition: mythplayer.h:64
MythPlayer::Pause
bool Pause(void)
Definition: mythplayer.cpp:153
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:554
kMythBufferMHEG
@ kMythBufferMHEG
Definition: mythmediabuffer.h:56
MythPlayerCaptionsUI::ChangeTrack
void ChangeTrack(uint Type, int Direction)
Definition: mythplayercaptionsui.cpp:379
MythPlayerCaptionsUI::InitialiseState
void InitialiseState() override
Definition: mythplayercaptionsui.cpp:63
TVPlaybackState::ToggleCaptionsByType
void ToggleCaptionsByType(uint Type)
MythCaptionsState::m_textDisplayMode
uint m_textDisplayMode
Definition: mythplayerstate.h:70
MythPlayerCaptionsUI::AdjustSubtitleZoom
void AdjustSubtitleZoom(int Delta)
Definition: mythplayercaptionsui.cpp:86
TVPlaybackState::ToggleCaptions
void ToggleCaptions()
MythPlayerAudioUI
Acts as the interface between the UI and the underlying AudioPlayer object.
Definition: mythplayeraudioui.h:9
VBIMode::PAL_TT
@ PAL_TT
Definition: tv.h:13
Action
An action (for this plugin) consists of a description, and a set of key sequences.
Definition: action.h:40
kDisplayAllCaptions
@ kDisplayAllCaptions
Definition: videoouttypes.h:21
InteractiveTV::OfferKey
bool OfferKey(const QString &key)
Definition: interactivetv.cpp:68
kDisplayTeletextMenu
@ kDisplayTeletextMenu
Definition: videoouttypes.h:22
toCaptionType
static uint toCaptionType(uint Type)
Definition: mythplayercaptionsui.cpp:128
MythCaptionsOverlay::EnableTeletext
void EnableTeletext(bool Enable, int Page)
Definition: mythcaptionsoverlay.cpp:110
MythPlayerOverlayUI::UpdateOSDMessage
void UpdateOSDMessage(const QString &Message)
Definition: mythplayeroverlayui.cpp:78
DecoderBase::GetTrackDesc
virtual QString GetTrackDesc(uint Type, uint TrackNo)
Definition: decoderbase.cpp:927
DecoderBase::GetTrackCount
virtual uint GetTrackCount(uint Type)
Definition: decoderbase.cpp:897
CC608Reader::SetMode
void SetMode(int mode)
Definition: cc608reader.cpp:151
MythPlayer::GetFramesPlayed
uint64_t GetFramesPlayed(void) const
Definition: mythplayer.h:144
MythPlayer::m_decoder
DecoderBase * m_decoder
Definition: mythplayer.h:362
MythPlayerCaptionsUI::EnableSubtitles
void EnableSubtitles(bool Enable)
kOSDTimeout_None
@ kOSDTimeout_None
Definition: osd.h:58
mythlogging.h
DecoderBase::GetTrackInfo
StreamInfo GetTrackInfo(uint Type, uint TrackNo)
Definition: decoderbase.cpp:978
subtitlescreen.h
MythPlayerAudioUI::InitialiseState
void InitialiseState() override
Initialise audio and signal initial state.
Definition: mythplayeraudioui.cpp:63
SubtitleReader::LoadExternalSubtitles
void LoadExternalSubtitles(const QString &subtitleFileName, bool isInProgress)
Definition: subtitlereader.cpp:160
TVPlaybackState::AdjustSubtitleZoom
void AdjustSubtitleZoom(int Delta)
TVPlaybackState::ChangeAllowForcedSubtitles
void ChangeAllowForcedSubtitles(bool Allow)
kTrackTypeTextSubtitle
@ kTrackTypeTextSubtitle
Definition: decoderbase.h:42
MythPlayerOverlayUI::ChangeOSDPositionUpdates
void ChangeOSDPositionUpdates(bool Enable)
Definition: mythplayeroverlayui.cpp:45
MythPlayerOverlayUI::m_editing
bool m_editing
Definition: mythplayeroverlayui.h:48
kDisplayRawTextSubtitle
@ kDisplayRawTextSubtitle
Definition: videoouttypes.h:20
MythPlayerCaptionsUI::tracksChanged
void tracksChanged(uint TrackType) override
This tries to re-enable captions/subtitles if the user wants them and one of the captions/subtitles t...
Definition: mythplayercaptionsui.cpp:256
MythPlayerCaptionsUI::SetAudioByComponentTag
bool SetAudioByComponentTag(int Tag)
Selects the audio stream using the DVB component tag.
Definition: mythplayercaptionsui.cpp:591
MythMediaBuffer::GetSubtitleFilename
QString GetSubtitleFilename(void) const
Definition: mythmediabuffer.cpp:1762
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:116
MythCaptionsOverlay::TeletextAction
bool TeletextAction(const QString &Action, bool &Exit)
Definition: mythcaptionsoverlay.cpp:129
TVPlaybackState::SetTeletextPage
void SetTeletextPage(uint Page)
TVPlaybackState::ResetCaptions
void ResetCaptions()
MythPlayerCaptionsUI::ITVRestart
void ITVRestart(uint Chanid, uint Cardid, bool IsLiveTV)
Restart the MHEG/MHP engine.
Definition: mythplayercaptionsui.cpp:570
TVPlaybackState::HandleITVAction
void HandleITVAction(const QString &Action, bool &Handled)
MythPlayerCaptionsUI::ResetTeletext
void ResetTeletext()
Definition: mythplayercaptionsui.cpp:492
kOSDFunctionalType_SubtitleZoomAdjust
@ kOSDFunctionalType_SubtitleZoomAdjust
Definition: osd.h:51
TVPlaybackState::RestartITV
void RestartITV(uint Chanid, uint Cardid, bool IsLiveTV)
MythPlayerCaptionsUI::GetTracks
QStringList GetTracks(uint Type)
Definition: mythplayercaptionsui.cpp:319
AVSubtitles
Definition: subtitlereader.h:22
MythCaptionsOverlay::TeletextReset
void TeletextReset()
Definition: mythcaptionsoverlay.cpp:140
MythPlayer::m_ttPageNum
int m_ttPageNum
VBI page to display when in PAL vbimode.
Definition: mythplayer.h:455
TVPlaybackState::SetCaptionsEnabled
void SetCaptionsEnabled(bool Enable, bool UpdateOSD=true)
kTrackTypeCC608
@ kTrackTypeCC608
Definition: decoderbase.h:32
MythPlayerOverlayUI::m_browsing
bool m_browsing
Definition: mythplayeroverlayui.h:47
kDisplayNUVTeletextCaptions
@ kDisplayNUVTeletextCaptions
Definition: videoouttypes.h:13
kDisplayAVSubtitle
@ kDisplayAVSubtitle
Definition: videoouttypes.h:15
MythPlayer::m_playerCtx
PlayerContext * m_playerCtx
Definition: mythplayer.h:366
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:66
DecoderBase::GetFPS
virtual double GetFPS(void) const
Definition: decoderbase.h:189
MythPlayerCaptionsUI::SetTeletextPage
void SetTeletextPage(uint Page)
Set Teletext NUV Caption page.
Definition: mythplayercaptionsui.cpp:500
MythPlayerCaptionsUI::SetStreamPos
void SetStreamPos(std::chrono::milliseconds Position)
Definition: mythplayercaptionsui.cpp:653
MythPlayerCaptionsUI::SetCaptionsEnabled
void SetCaptionsEnabled(bool Enable, bool UpdateOSD=true)
Definition: mythplayercaptionsui.cpp:286
MythPlayer::m_disableForcedSubtitles
bool m_disableForcedSubtitles
Definition: mythplayer.h:464
MythPlayerCaptionsUI::SafeFPS
double SafeFPS()
Definition: mythplayercaptionsui.cpp:611
kNoITV
@ kNoITV
Definition: mythplayer.h:75
MythPlayer::RequestResetCaptions
void RequestResetCaptions()
MythPlayerCaptionsUI::EnableTeletext
void EnableTeletext(int Page=0x100)
Definition: mythplayercaptionsui.cpp:467
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:57
clamp
static eu8 clamp(eu8 value, eu8 low, eu8 high)
Definition: pxsup2dast.c:204
kOSDFunctionalType_SubtitleDelayAdjust
@ kOSDFunctionalType_SubtitleDelayAdjust
Definition: osd.h:52
PlayerContext::m_tvchain
LiveTVChain * m_tvchain
Definition: playercontext.h:115
MythPlayer::m_vbiMode
uint m_vbiMode
VBI decoder to use.
Definition: mythplayer.h:454
MythPlayerCaptionsUI::DisableCaptions
virtual void DisableCaptions(uint Mode, bool UpdateOSD=true)
Definition: mythplayercaptionsui.cpp:150
TVPlaybackState::AdjustSubtitleDelay
void AdjustSubtitleDelay(std::chrono::milliseconds Delta)
kState_WatchingRecording
@ kState_WatchingRecording
Watching Recording is the state for when we are watching an in progress recording,...
Definition: tv.h:83
AVSubtitles::m_needSync
bool m_needSync
Definition: subtitlereader.h:29
TVPlaybackState::SetTrack
void SetTrack(uint Type, uint TrackNo)
MythPlayerCaptionsUI::ResetCaptions
void ResetCaptions()
Definition: mythplayercaptionsui.cpp:122
SubtitleReader::GetAVSubtitles
AVSubtitles * GetAVSubtitles(void)
Definition: subtitlereader.h:57
MythCoreContext::GetBoolSetting
bool GetBoolSetting(const QString &key, bool defaultval=false)
Definition: mythcorecontext.cpp:912
MythPlayerCaptionsUI::DoEnableForcedSubtitles
void DoEnableForcedSubtitles()
Definition: mythplayercaptionsui.cpp:361
MythPlayerCaptionsUI::GetStreamMaxPos
std::chrono::milliseconds GetStreamMaxPos()
Definition: mythplayercaptionsui.cpp:645
MythPlayerCaptionsUI::EnableCaptions
virtual void EnableCaptions(uint Mode, bool UpdateOSD=true)
Definition: mythplayercaptionsui.cpp:200
kDisplayAllTextCaptions
@ kDisplayAllTextCaptions
Definition: videoouttypes.h:23
MythPlayerCaptionsUI::~MythPlayerCaptionsUI
~MythPlayerCaptionsUI() override
Definition: mythplayercaptionsui.cpp:58
kDisplayTextSubtitle
@ kDisplayTextSubtitle
Definition: videoouttypes.h:18
CC708Reader::SetCurrentService
void SetCurrentService(int service)
Definition: cc708reader.h:21
MythPlayerCaptionsUI::ToggleCaptionsByType
void ToggleCaptionsByType(uint Type)
Definition: mythplayercaptionsui.cpp:273
MythPlayerCaptionsUI::m_textDesired
bool m_textDesired
Definition: mythplayercaptionsui.h:72
MythPlayerCaptionsUI::ExternalSubtitlesUpdated
void ExternalSubtitlesUpdated()
Definition: mythplayercaptionsui.cpp:80
TVPlaybackState::EnableTeletext
void EnableTeletext(int Page=0x100)
livetvchain.h
kDisplayCC608
@ kDisplayCC608
Definition: videoouttypes.h:16
MythPlayerCaptionsUI::LoadExternalSubtitles
void LoadExternalSubtitles()
Definition: mythplayercaptionsui.cpp:71
MythCaptionsOverlay::TeletextClear
void TeletextClear()
Definition: mythcaptionsoverlay.cpp:150
kEofStateDelayed
@ kEofStateDelayed
Definition: decoderbase.h:70
MythPlayerOverlayUI::m_osdLock
QRecursiveMutex m_osdLock
Definition: mythplayeroverlayui.h:46
MythPlayerCaptionsUI::SetStream
void SetStream(const QString &Stream)
Definition: mythplayercaptionsui.cpp:620
OptionalCaptionEnabled
bool OptionalCaptionEnabled(uint Captions)
Return whether any optional captions are enabled.
Definition: videoouttypes.h:30
mythcorecontext.h
MythPlayerCaptionsUI::SetInteractiveStreamPos
void SetInteractiveStreamPos(std::chrono::milliseconds Position)
MythPlayerCaptionsUI::m_itvEnabled
bool m_itvEnabled
Definition: mythplayercaptionsui.h:77
MythPlayerCaptionsUI::StreamPlay
void StreamPlay(bool Playing=true)
Definition: mythplayercaptionsui.cpp:661
MythPlayerCaptionsUI::m_interactiveTV
InteractiveTV * m_interactiveTV
Definition: mythplayercaptionsui.h:75
MythPlayerUIBase::m_tv
TV * m_tv
Definition: mythplayeruibase.h:18
MythPlayerCaptionsUI::DoDisableForcedSubtitles
void DoDisableForcedSubtitles()
Definition: mythplayercaptionsui.cpp:353
kTrackTypeTeletextCaptions
@ kTrackTypeTeletextCaptions
Definition: decoderbase.h:34
SubtitleReader::HasTextSubtitles
bool HasTextSubtitles(void)
Definition: subtitlereader.cpp:179
MythPlayer::m_totalLength
std::chrono::seconds m_totalLength
Definition: mythplayer.h:426
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:103
TVPlaybackState::ChangeCaptionTrack
void ChangeCaptionTrack(int Direction)
MythPlayerCaptionsUI::CaptionsStateChanged
void CaptionsStateChanged(MythCaptionsState &CaptionsState)
interactivetv.h
MythPlayer::FlagIsSet
bool FlagIsSet(PlayerFlags arg)
Definition: mythplayer.h:318
kTrackTypeAudio
@ kTrackTypeAudio
Definition: decoderbase.h:29
MythPlayerCaptionsUI::SetVideoByComponentTag
bool SetVideoByComponentTag(int Tag)
Selects the video stream using the DVB component tag.
Definition: mythplayercaptionsui.cpp:603
TVPlaybackState::CaptionsStateChanged
void CaptionsStateChanged(MythCaptionsState CaptionsState)
Definition: tvplaybackstate.cpp:33
kTrackTypeRawText
@ kTrackTypeRawText
Definition: decoderbase.h:36
MythPlayer::JumpToFrame
virtual bool JumpToFrame(uint64_t frame)
Definition: mythplayer.cpp:886
MythPlayerCaptionsUI::MythPlayerCaptionsUI
MythPlayerCaptionsUI(MythMainWindow *MainWindow, TV *Tv, PlayerContext *Context, PlayerFlags Flags)
Definition: mythplayercaptionsui.cpp:13
MythPlayerCaptionsUI::m_captionsState
MythCaptionsState m_captionsState
Definition: mythplayercaptionsui.h:71
MythCaptionsState::m_externalTextSubs
bool m_externalTextSubs
Definition: mythplayerstate.h:71
TrackType
TrackType
Track types.
Definition: decoderbase.h:26
MythPlayerCaptionsUI::GetTrackCount
uint GetTrackCount(uint Type)
Definition: mythplayercaptionsui.cpp:326
InteractiveTV
This is the interface between an MHEG engine and a MythTV TV object.
Definition: interactivetv.h:15
MythCaptionsState::m_haveITV
bool m_haveITV
Definition: mythplayerstate.h:72
DecoderBase::GetTracks
virtual QStringList GetTracks(uint Type)
Definition: decoderbase.cpp:910
build_compdb.filename
filename
Definition: build_compdb.py:21
kDisplayTeletextCaptions
@ kDisplayTeletextCaptions
Definition: videoouttypes.h:14
LOC
#define LOC
Definition: mythplayercaptionsui.cpp:11
MythPlayerCaptionsUI::HasCaptionTrack
bool HasCaptionTrack(uint Mode)
Definition: mythplayercaptionsui.cpp:423
InteractiveTV::Restart
void Restart(int chanid, int sourceid, bool isLive)
Definition: interactivetv.cpp:36
MythMainWindow
Definition: mythmainwindow.h:28
MythPlayer::Play
bool Play(float speed=1.0, bool normal=true, bool unpauseaudio=true)
Definition: mythplayer.cpp:186
Mode
Mode
Definition: synaesthesia.h:23
mythplayercaptionsui.h
DecoderBase::GetTrackLanguageIndex
virtual int GetTrackLanguageIndex(uint Type, uint TrackNo)
Definition: decoderbase.cpp:919
uint
unsigned int uint
Definition: freesurround.h:24
kDisplayNone
@ kDisplayNone
Definition: videoouttypes.h:12
TVPlaybackState::ChangeTrack
void ChangeTrack(uint Type, int Direction)
MythMediaBuffer::GetType
MythBufferType GetType() const
Definition: mythmediabuffer.cpp:204
millisecondsFromFloat
std::enable_if_t< std::is_floating_point_v< T >, std::chrono::milliseconds > millisecondsFromFloat(T value)
Helper function for convert a floating point number to a duration.
Definition: mythchrono.h:91
tv_play.h
MythPlayerCaptionsUI::ChangeCaptionTrack
void ChangeCaptionTrack(int Direction)
Definition: mythplayercaptionsui.cpp:387
MythCaptionsOverlay::DisableForcedSubtitles
void DisableForcedSubtitles()
Definition: mythcaptionsoverlay.cpp:196
MythPlayerCaptionsUI::HandleTeletextAction
void HandleTeletextAction(const QString &Action, bool &Handled)
Definition: mythplayercaptionsui.cpp:514
TV
Control TV playback.
Definition: tv_play.h:154