MythTV  master
mythplayercaptionsui.cpp
Go to the documentation of this file.
1 // MythTV
3 #include "livetvchain.h"
4 #include "mheg/interactivetv.h"
5 #include "mythplayercaptionsui.h"
6 #include "tv_play.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
49  connect(this, &MythPlayerCaptionsUI::EnableSubtitles, this, [=](bool Enable) { this->SetCaptionsEnabled(Enable, false); });
51 
52  // Signalled from the base class
54 }
55 
57 {
58  delete m_interactiveTV;
59 }
60 
62 {
63  LOG(VB_GENERAL, LOG_INFO, LOC + "Initialising captions");
67 }
68 
70 {
72  bool inprogress = (m_playerCtx->GetState() == kState_WatchingRecording ||
76 }
77 
79 {
82 }
83 
85 {
87  return;
88 
89  if (auto * subs = m_captionsOverlay.InitSubtitles(); subs)
90  {
91  auto 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 
100 void MythPlayerCaptionsUI::AdjustSubtitleDelay(std::chrono::milliseconds Delta)
101 {
104  if (!showing || (m_browsing || m_editing))
105  return;
106 
107  if (auto * subs = m_captionsOverlay.InitSubtitles(); subs)
108  {
109  auto newval = std::clamp(subs->GetDelay() + (Delta * 10), -5000ms, 5000ms);
110  // range of -5000ms..+5000ms, scale to 0..1000
111  UpdateOSDStatus(tr("Adjust Subtitle Delay"), tr("Subtitle Delay"),
112  QString::number(newval.count()), kOSDFunctionalType_SubtitleDelayAdjust,
113  "ms", (newval.count() / 10) + 500, kOSDTimeout_None);
115  subs->SetDelay(newval);
116  }
117 
118 }
119 
121 {
124 }
125 
126 static uint toCaptionType(uint Type)
127 {
128  if (kTrackTypeCC608 == Type) return kDisplayCC608;
129  if (kTrackTypeCC708 == Type) return kDisplayCC708;
130  if (kTrackTypeSubtitle == Type) return kDisplayAVSubtitle;
132  if (kTrackTypeTextSubtitle == Type) return kDisplayTextSubtitle;
133  if (kTrackTypeRawText == Type) return kDisplayRawTextSubtitle;
134  return 0;
135 }
136 
137 static uint toTrackType(uint Type)
138 {
139  if (kDisplayCC608 == Type) return kTrackTypeCC608;
140  if (kDisplayCC708 == Type) return kTrackTypeCC708;
141  if (kDisplayAVSubtitle == Type) return kTrackTypeSubtitle;
143  if (kDisplayTextSubtitle == Type) return kTrackTypeTextSubtitle;
144  if (kDisplayRawTextSubtitle == Type) return kTrackTypeRawText;
145  return kTrackTypeUnknown;
146 }
147 
149 {
150  auto oldcaptions = m_captionsState.m_textDisplayMode;
154  if (oldcaptions != m_captionsState.m_textDisplayMode)
156  ResetCaptions();
157 
158  QMutexLocker locker(&m_osdLock);
159 
160  bool newTextDesired = (m_captionsState.m_textDisplayMode & kDisplayAllTextCaptions) != 0U;
161  // Only turn off textDesired if the Operator requested it.
162  if (UpdateOSD || newTextDesired)
163  m_textDesired = newTextDesired;
164 
165  auto msg = (kDisplayNUVTeletextCaptions & Mode) ? tr("TXT CAP") : "";
167  {
168  if (auto track = GetTrack(kTrackTypeTeletextCaptions); (track > 1) && (m_decoder != nullptr))
169  msg += m_decoder->GetTrackDesc(kTrackTypeTeletextCaptions, static_cast<uint>(track));
170  DisableTeletext();
171  }
175  if ((kDisplayCC608 & Mode) || (kDisplayCC708 & Mode) ||
177  {
178  if (uint type = toTrackType(Mode); m_decoder != nullptr)
179  if (auto track = GetTrack(type); track > -1)
180  msg += m_decoder->GetTrackDesc(type, static_cast<uint>(track));
181 
183  }
184 
186  {
187  msg += tr("Text subtitles");
189  }
190 
191  if (!msg.isEmpty() && UpdateOSD)
192  {
193  msg += " " + tr("Off");
195  }
196 }
197 
199 {
200  QMutexLocker locker(&m_osdLock);
201  bool newTextDesired = (Mode & kDisplayAllTextCaptions) != 0U;
202  // Only turn off textDesired if the Operator requested it.
203  if (UpdateOSD || newTextDesired)
204  m_textDesired = newTextDesired;
205  QString msg;
206  if ((kDisplayCC608 & Mode) || (kDisplayCC708 & Mode) ||
208  {
209  if (auto type = toTrackType(Mode); m_decoder != nullptr)
210  if (auto track = GetTrack(type); track > -1)
211  msg += m_decoder->GetTrackDesc(type, static_cast<uint>(track));
212 
213  m_captionsOverlay.EnableSubtitles(static_cast<int>(Mode));
214  }
215 
217  {
220  subs->m_needSync = true;
221  msg += tr("Text subtitles");
222  }
223 
225  msg += tr("TXT %1").arg(m_ttPageNum, 3, 16);
226 
227  if ((kDisplayTeletextCaptions & Mode) && (m_decoder != nullptr))
228  {
230  static_cast<uint>(GetTrack(kTrackTypeTeletextCaptions)));
231 
233  static_cast<uint>(GetTrack(kTrackTypeTeletextCaptions)));
234 
235  EnableTeletext(page);
236  }
237 
238  msg += " " + tr("On");
239  LOG(VB_PLAYBACK, LOG_INFO, QString("EnableCaptions(%1) msg: %2").arg(Mode).arg(msg));
240 
241  auto oldcaptions = m_captionsState.m_textDisplayMode;
245  if (oldcaptions != m_captionsState.m_textDisplayMode)
247  if (UpdateOSD)
249 }
250 
255 {
257  SetCaptionsEnabled(true, false);
258 }
259 
261 {
262  m_allowForcedSubtitles = Allow;
263  UpdateOSDMessage(m_allowForcedSubtitles ? tr("Forced Subtitles On") : tr("Forced Subtitles Off"));
264 }
265 
267 {
269 }
270 
272 {
273  QMutexLocker locker(&m_osdLock);
274  auto mode = toCaptionType(Type);
275  auto origmode = m_captionsState.m_textDisplayMode;
277  DisableCaptions(m_captionsState.m_textDisplayMode, (origmode & mode) != 0U);
278  if (origmode & mode)
279  return;
280  if (mode)
281  EnableCaptions(mode);
282 }
283 
284 void MythPlayerCaptionsUI::SetCaptionsEnabled(bool Enable, bool UpdateOSD)
285 {
286  QMutexLocker locker(&m_osdLock);
287  auto origmode = m_captionsState.m_textDisplayMode;
288 
289  // Only turn off textDesired if the Operator requested it.
290  if (UpdateOSD || Enable)
291  m_textDesired = Enable;
292 
293  if (!Enable)
294  {
295  DisableCaptions(origmode, UpdateOSD);
296  return;
297  }
298 
301  {
302  DisableCaptions(origmode, false);
303  if (kDisplayNone == mode)
304  {
305  if (UpdateOSD)
306  UpdateOSDMessage(tr("No captions", "CC/Teletext/Subtitle text not available"), kOSDTimeout_Med);
307  LOG(VB_PLAYBACK, LOG_INFO, "No captions available yet to enable.");
308  }
309  else
310  {
311  EnableCaptions(mode, UpdateOSD);
312  }
313  }
314  ResetCaptions();
315 }
316 
318 {
319  if (m_decoder)
320  return m_decoder->GetTracks(Type);
321  return {};
322 }
323 
325 {
326  if (m_decoder)
327  return m_decoder->GetTrackCount(Type);
328  return 0;
329 }
330 
332 {
333  if (!m_decoder)
334  return;
335 
336  m_decoder->SetTrack(Type, static_cast<int>(TrackNo));
337  if (kTrackTypeAudio == Type)
338  {
339  UpdateOSDMessage(m_decoder->GetTrackDesc(Type, static_cast<uint>(GetTrack(Type))), kOSDTimeout_Med);
340  }
341  else if (auto subtype = toCaptionType(Type); subtype)
342  {
344  EnableCaptions(subtype, true);
345  if ((kDisplayCC708 == subtype || kDisplayCC608 == subtype) && m_decoder)
346  if (auto sid = m_decoder->GetTrackInfo(Type, TrackNo).m_stream_id; sid > 0)
347  (kDisplayCC708 == subtype) ? m_cc708.SetCurrentService(sid) : m_cc608.SetMode(sid);
348  }
349 }
350 
352 {
353  m_disableForcedSubtitles = false;
354  m_osdLock.lock();
356  m_osdLock.unlock();
357 }
358 
360 {
361  m_enableForcedSubtitles = false;
363  return;
364 
365  m_osdLock.lock();
367  m_osdLock.unlock();
368 }
369 
371 {
372  if (m_decoder)
373  return m_decoder->GetTrack(Type);
374  return -1;
375 }
376 
377 void MythPlayerCaptionsUI::ChangeTrack(uint Type, int Direction)
378 {
379  if (!m_decoder)
380  return;
381  if (auto ret = m_decoder->ChangeTrack(Type, Direction); ret >= 0)
382  UpdateOSDMessage(m_decoder->GetTrackDesc(Type, static_cast<uint>(GetTrack(Type))), kOSDTimeout_Med);
383 }
384 
386 {
387  if (!m_decoder || (Direction < 0))
388  return;
389 
393  {
395  if (GetTrack(tracktype) < m_decoder->NextTrack(tracktype))
396  {
397  SetTrack(tracktype, static_cast<uint>(m_decoder->NextTrack(tracktype)));
398  return;
399  }
400  }
402  if ((nextmode == kDisplayTextSubtitle) || (nextmode == kDisplayNUVTeletextCaptions) ||
403  (nextmode == kDisplayNone))
404  {
406  if (nextmode != kDisplayNone)
407  EnableCaptions(nextmode, true);
408  }
409  else
410  {
411  uint tracktype = toTrackType(nextmode);
412  uint tracks = m_decoder->GetTrackCount(tracktype);
413  if (tracks)
414  {
416  SetTrack(tracktype, 0);
417  }
418  }
419 }
420 
422 {
423  if (Mode == kDisplayNone)
424  return false;
426  return true;
427  // External subtitles are now decoded with FFmpeg and are AVSubtitles.
429  return true;
431  return true;
432  return false;
433 }
434 
436 {
437  // Text->TextStream->708->608->AVSubs->Teletext->NUV->None
438  // NUV only offerred if PAL
439  bool pal = (m_vbiMode == VBIMode::PAL_TT);
440  uint nextmode = kDisplayNone;
441 
442  if (kDisplayTextSubtitle == Mode)
443  nextmode = kDisplayRawTextSubtitle;
444  else if (kDisplayRawTextSubtitle == Mode)
445  nextmode = kDisplayCC708;
446  else if (kDisplayCC708 == Mode)
447  nextmode = kDisplayCC608;
448  else if (kDisplayCC608 == Mode)
449  nextmode = kDisplayAVSubtitle;
450  else if (kDisplayAVSubtitle == Mode)
451  nextmode = kDisplayTeletextCaptions;
452  else if (kDisplayTeletextCaptions == Mode)
453  nextmode = pal ? kDisplayNUVTeletextCaptions : kDisplayNone;
454  else if ((kDisplayNUVTeletextCaptions == Mode) && pal)
455  nextmode = kDisplayNone;
456  else if (kDisplayNone == Mode)
457  nextmode = kDisplayTextSubtitle;
458 
459  if (nextmode == kDisplayNone || HasCaptionTrack(nextmode))
460  return nextmode;
461 
462  return NextCaptionTrack(nextmode);
463 }
464 
466 {
467  QMutexLocker locker(&m_osdLock);
468  auto oldcaptions = m_captionsState.m_textDisplayMode;
469  m_captionsOverlay.EnableTeletext(true, Page);
472  if (oldcaptions != m_captionsState.m_textDisplayMode)
474 }
475 
477 {
478  QMutexLocker locker(&m_osdLock);
480  auto oldcaptions = m_captionsState.m_textDisplayMode;
482  if (oldcaptions != m_captionsState.m_textDisplayMode)
484 
485  // If subtitles were enabled before the teletext menu was displayed then re-enable them
488 }
489 
491 {
492  QMutexLocker locker(&m_osdLock);
494 }
495 
499 {
500  m_osdLock.lock();
502  auto oldcaptions = m_captionsState.m_textDisplayMode;
503  m_ttPageNum = static_cast<int>(Page);
507  if (oldcaptions != m_captionsState.m_textDisplayMode)
509  m_osdLock.unlock();
510 }
511 
512 void MythPlayerCaptionsUI::HandleTeletextAction(const QString& Action, bool &Handled)
513 {
515  return;
516 
517  bool exit = false;
518  m_osdLock.lock();
519  Handled = m_captionsOverlay.TeletextAction(Action, exit);
520  m_osdLock.unlock();
521  if (exit)
522  DisableTeletext();
523 }
524 
526 {
527 #ifdef USING_MHEG
528  bool update = false;
529  {
530  QMutexLocker lock1(&m_osdLock);
531  QMutexLocker lock2(&m_itvLock);
533  {
534  m_interactiveTV = new InteractiveTV(this);
535  m_captionsState.m_haveITV = true;
536  update = true;
537  }
538  }
539  if (update)
541 #endif
542  return m_interactiveTV;
543 }
544 
552 void MythPlayerCaptionsUI::ITVHandleAction([[maybe_unused]] const QString &Action,
553  [[maybe_unused]] bool& Handled)
554 {
555 #ifdef USING_MHEG
556  if (!GetInteractiveTV())
557  {
558  Handled = false;
559  return;
560  }
561 
562  QMutexLocker locker(&m_itvLock);
563  Handled = m_interactiveTV->OfferKey(Action);
564 #endif
565 }
566 
568 void MythPlayerCaptionsUI::ITVRestart([[maybe_unused]] uint Chanid,
569  [[maybe_unused]] uint Cardid,
570  [[maybe_unused]] bool IsLiveTV)
571 {
572 #ifdef USING_MHEG
573  if (!GetInteractiveTV())
574  return;
575 
576  QMutexLocker locker(&m_itvLock);
577  m_interactiveTV->Restart(static_cast<int>(Chanid), static_cast<int>(Cardid), IsLiveTV);
578  m_itvVisible = false;
579 #endif
580 }
581 
590 {
591  QMutexLocker locker(&m_decoderChangeLock);
592  if (m_decoder)
593  return m_decoder->SetAudioByComponentTag(Tag);
594  return false;
595 }
596 
602 {
603  QMutexLocker locker(&m_decoderChangeLock);
604  if (m_decoder)
605  return m_decoder->SetVideoByComponentTag(Tag);
606  return false;
607 }
608 
610 {
611  QMutexLocker locker(&m_decoderChangeLock);
612  if (!m_decoder)
613  return 25;
614  double fps = m_decoder->GetFPS();
615  return fps > 0 ? fps : 25.0;
616 }
617 
618 void MythPlayerCaptionsUI::SetStream(const QString& Stream)
619 {
620  // The stream name is empty if the stream is closing
621  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("SetStream '%1'").arg(Stream));
622 
623  // Stream will be changed by JumpToStream called from EventLoop
624  // If successful will call m_interactiveTV->StreamStarted();
625  m_newStream = Stream;
626 
627  if (Stream.isEmpty() && m_playerCtx->m_tvchain && m_playerCtx->m_buffer->GetType() == kMythBufferMHEG)
628  {
629  // Restore livetv
631  m_playerCtx->m_tvchain->JumpToNext(false, 0s);
632  m_playerCtx->m_tvchain->JumpToNext(true, 0s);
633  }
634 }
635 
636 // Called from the interactiveTV (MHIContext) thread
637 std::chrono::milliseconds MythPlayerCaptionsUI::GetStreamPos()
638 {
639  return millisecondsFromFloat((1000 * GetFramesPlayed()) / SafeFPS());
640 }
641 
642 // Called from the interactiveTV (MHIContext) thread
643 std::chrono::milliseconds MythPlayerCaptionsUI::GetStreamMaxPos()
644 {
645  std::chrono::seconds maxsecs = m_totalDuration > 0s ? m_totalDuration : m_totalLength;
646  auto maxpos = duration_cast<std::chrono::milliseconds>(maxsecs);
647  auto pos = GetStreamPos();
648  return maxpos > pos ? maxpos : pos;
649 }
650 
651 void MythPlayerCaptionsUI::SetStreamPos(std::chrono::milliseconds Position)
652 {
653  auto frameNum = static_cast<uint64_t>((Position.count() * SafeFPS()) / 1000);
654  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("SetStreamPos %1 mS = frame %2, now=%3")
655  .arg(Position.count()).arg(frameNum).arg(GetFramesPlayed()) );
656  JumpToFrame(frameNum);
657 }
658 
660 {
661  if (Playing)
662  Play();
663  else
664  Pause();
665 }
kTrackTypeUnknown
@ kTrackTypeUnknown
Definition: decoderbase.h:28
MythPlayerCaptionsUI::NextCaptionTrack
uint NextCaptionTrack(uint Mode)
Definition: mythplayercaptionsui.cpp:435
MythPlayerCaptionsUI::GetInteractiveTV
InteractiveTV * GetInteractiveTV() override
Definition: mythplayercaptionsui.cpp:525
MythPlayerCaptionsUI::PlayInteractiveStream
void PlayInteractiveStream(bool Play)
kDisplayNone
@ kDisplayNone
Definition: videoouttypes.h:12
kDisplayCC608
@ kDisplayCC608
Definition: videoouttypes.h:16
MythPlayerCaptionsUI::SetTrack
virtual void SetTrack(uint Type, uint TrackNo)
Definition: mythplayercaptionsui.cpp:331
DecoderBase::SetVideoByComponentTag
virtual bool SetVideoByComponentTag(int)
Definition: decoderbase.h:256
PlayerContext::GetState
TVState GetState(void) const
Definition: playercontext.cpp:325
MythPlayer::m_enableForcedSubtitles
bool m_enableForcedSubtitles
Definition: mythplayer.h:463
DecoderBase::SetTrack
virtual int SetTrack(uint Type, int TrackNo)
Definition: decoderbase.cpp:963
DecoderBase::GetTrack
int GetTrack(uint Type)
Definition: decoderbase.cpp:957
DecoderBase::NextTrack
int NextTrack(uint Type)
Definition: decoderbase.cpp:1017
MythPlayer::m_decoderChangeLock
QRecursiveMutex m_decoderChangeLock
Definition: mythplayer.h:363
kTrackTypeTextSubtitle
@ kTrackTypeTextSubtitle
Definition: decoderbase.h:42
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:617
MythPlayer::SetEof
void SetEof(EofState eof)
Definition: mythplayer.cpp:1080
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:260
MythPlayer::m_subReader
SubtitleReader m_subReader
Definition: mythplayer.h:458
MythPlayerCaptionsUI::m_newStream
QString m_newStream
Definition: mythplayercaptionsui.h:78
MythPlayer::m_cc608
CC608Reader m_cc608
Definition: mythplayer.h:468
TVPlaybackState::HandleTeletextAction
void HandleTeletextAction(const QString &Action, bool &Handled)
kDisplayTextSubtitle
@ kDisplayTextSubtitle
Definition: videoouttypes.h:18
MythPlayerCaptionsUI::GetTrack
int GetTrack(uint Type)
Definition: mythplayercaptionsui.cpp:370
MythPlayer::m_allowForcedSubtitles
bool m_allowForcedSubtitles
Definition: mythplayer.h:465
Mode
Mode
Definition: synaesthesia.h:23
kDisplayTeletextCaptions
@ kDisplayTeletextCaptions
Definition: videoouttypes.h:14
MythPlayerCaptionsUI::m_itvVisible
bool m_itvVisible
Definition: mythplayercaptionsui.h:77
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:99
MythPlayerCaptionsUI::ToggleCaptions
void ToggleCaptions()
Definition: mythplayercaptionsui.cpp:266
MythCaptionsOverlay::ClearSubtitles
void ClearSubtitles()
Definition: mythcaptionsoverlay.cpp:206
MythPlayerCaptionsUI::m_itvLock
QMutex m_itvLock
Definition: mythplayercaptionsui.h:75
MythPlayerCaptionsUI::m_lastTextDisplayMode
uint m_lastTextDisplayMode
Definition: mythplayercaptionsui.h:72
MythPlayerCaptionsUI::DisableTeletext
void DisableTeletext()
Definition: mythplayercaptionsui.cpp:476
MythCaptionsOverlay::InitSubtitles
SubtitleScreen * InitSubtitles()
Definition: mythcaptionsoverlay.cpp:160
toTrackType
static uint toTrackType(uint Type)
Definition: mythplayercaptionsui.cpp:137
TVPlaybackState::ResetTeletext
void ResetTeletext()
MythPlayerCaptionsUI::AdjustSubtitleDelay
void AdjustSubtitleDelay(std::chrono::milliseconds Delta)
Definition: mythplayercaptionsui.cpp:100
kDisplayTeletextMenu
@ kDisplayTeletextMenu
Definition: videoouttypes.h:22
MythPlayer::m_cc708
CC708Reader m_cc708
Definition: mythplayer.h:469
MythPlayerCaptionsUI::GetStreamPos
std::chrono::milliseconds GetStreamPos()
Definition: mythplayercaptionsui.cpp:637
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:1001
kDisplayAVSubtitle
@ kDisplayAVSubtitle
Definition: videoouttypes.h:15
TrackType
TrackType
Track types.
Definition: decoderbase.h:26
kDisplayNUVTeletextCaptions
@ kDisplayNUVTeletextCaptions
Definition: videoouttypes.h:13
DecoderBase::SetAudioByComponentTag
virtual bool SetAudioByComponentTag(int)
Definition: decoderbase.h:255
PlayerFlags
PlayerFlags
Definition: mythplayer.h:64
MythPlayer::Pause
bool Pause(void)
Definition: mythplayer.cpp:156
kOSDTimeout_None
@ kOSDTimeout_None
Definition: osd.h:58
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:552
MythPlayerCaptionsUI::ChangeTrack
void ChangeTrack(uint Type, int Direction)
Definition: mythplayercaptionsui.cpp:377
MythPlayerCaptionsUI::InitialiseState
void InitialiseState() override
Definition: mythplayercaptionsui.cpp:61
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:84
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:9
Action
An action (for this plugin) consists of a description, and a set of key sequences.
Definition: action.h:40
InteractiveTV::OfferKey
bool OfferKey(const QString &key)
Definition: interactivetv.cpp:67
toCaptionType
static uint toCaptionType(uint Type)
Definition: mythplayercaptionsui.cpp:126
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:110
MythPlayerOverlayUI::UpdateOSDMessage
void UpdateOSDMessage(const QString &Message)
Definition: mythplayeroverlayui.cpp:76
DecoderBase::GetTrackDesc
virtual QString GetTrackDesc(uint Type, uint TrackNo)
Definition: decoderbase.cpp:939
DecoderBase::GetTrackCount
virtual uint GetTrackCount(uint Type)
Definition: decoderbase.cpp:909
CC608Reader::SetMode
void SetMode(int mode)
Definition: cc608reader.cpp:149
MythPlayer::GetFramesPlayed
uint64_t GetFramesPlayed(void) const
Definition: mythplayer.h:145
MythPlayer::m_decoder
DecoderBase * m_decoder
Definition: mythplayer.h:362
MythPlayerCaptionsUI::EnableSubtitles
void EnableSubtitles(bool Enable)
DecoderBase::GetTrackInfo
StreamInfo GetTrackInfo(uint Type, uint TrackNo)
Definition: decoderbase.cpp:990
subtitlescreen.h
MythPlayerAudioUI::InitialiseState
void InitialiseState() override
Initialise audio and signal initial state.
Definition: mythplayeraudioui.cpp:62
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)
MythPlayerOverlayUI::ChangeOSDPositionUpdates
void ChangeOSDPositionUpdates(bool Enable)
Definition: mythplayeroverlayui.cpp:43
MythPlayerOverlayUI::m_editing
bool m_editing
Definition: mythplayeroverlayui.h:48
MythPlayerCaptionsUI::SetAudioByComponentTag
bool SetAudioByComponentTag(int Tag)
Selects the audio stream using the DVB component tag.
Definition: mythplayercaptionsui.cpp:589
MythMediaBuffer::GetSubtitleFilename
QString GetSubtitleFilename(void) const
Definition: mythmediabuffer.cpp:1753
MythPlayerCaptionsUI::m_lastValidTextDisplayMode
uint m_lastValidTextDisplayMode
Definition: mythplayercaptionsui.h:73
MythPlayerCaptionsUI::m_captionsOverlay
MythCaptionsOverlay m_captionsOverlay
Definition: mythplayercaptionsui.h:69
PlayerContext::m_buffer
MythMediaBuffer * m_buffer
Definition: playercontext.h:116
kOSDFunctionalType_SubtitleDelayAdjust
@ kOSDFunctionalType_SubtitleDelayAdjust
Definition: osd.h:52
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:568
kTrackTypeTeletextCaptions
@ kTrackTypeTeletextCaptions
Definition: decoderbase.h:34
TVPlaybackState::HandleITVAction
void HandleITVAction(const QString &Action, bool &Handled)
MythPlayerCaptionsUI::ResetTeletext
void ResetTeletext()
Definition: mythplayercaptionsui.cpp:490
TVPlaybackState::RestartITV
void RestartITV(uint Chanid, uint Cardid, bool IsLiveTV)
MythPlayerCaptionsUI::GetTracks
QStringList GetTracks(uint Type)
Definition: mythplayercaptionsui.cpp:317
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)
MythPlayerOverlayUI::m_browsing
bool m_browsing
Definition: mythplayeroverlayui.h:47
kMythBufferMHEG
@ kMythBufferMHEG
Definition: mythmediabuffer.h:47
MythPlayer::m_playerCtx
PlayerContext * m_playerCtx
Definition: mythplayer.h:366
DecoderBase::GetFPS
virtual double GetFPS(void) const
Definition: decoderbase.h:198
MythPlayerCaptionsUI::SetTeletextPage
void SetTeletextPage(uint Page)
Set Teletext NUV Caption page.
Definition: mythplayercaptionsui.cpp:498
MythPlayerCaptionsUI::SetStreamPos
void SetStreamPos(std::chrono::milliseconds Position)
Definition: mythplayercaptionsui.cpp:651
MythPlayerCaptionsUI::SetCaptionsEnabled
void SetCaptionsEnabled(bool Enable, bool UpdateOSD=true)
Definition: mythplayercaptionsui.cpp:284
MythPlayer::m_disableForcedSubtitles
bool m_disableForcedSubtitles
Definition: mythplayer.h:464
kTrackTypeAudio
@ kTrackTypeAudio
Definition: decoderbase.h:29
MythPlayerCaptionsUI::SafeFPS
double SafeFPS()
Definition: mythplayercaptionsui.cpp:609
kTrackTypeCC708
@ kTrackTypeCC708
Definition: decoderbase.h:33
kNoITV
@ kNoITV
Definition: mythplayer.h:75
MythPlayer::RequestResetCaptions
void RequestResetCaptions()
MythPlayerCaptionsUI::EnableTeletext
void EnableTeletext(int Page=0x100)
Definition: mythplayercaptionsui.cpp:465
uint
unsigned int uint
Definition: compat.h:81
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:55
PlayerContext::m_tvchain
LiveTVChain * m_tvchain
Definition: playercontext.h:115
MythPlayer::m_vbiMode
uint m_vbiMode
VBI decoder to use.
Definition: mythplayer.h:454
kTrackTypeSubtitle
@ kTrackTypeSubtitle
Definition: decoderbase.h:31
kOSDFunctionalType_SubtitleZoomAdjust
@ kOSDFunctionalType_SubtitleZoomAdjust
Definition: osd.h:51
MythPlayerCaptionsUI::DisableCaptions
virtual void DisableCaptions(uint Mode, bool UpdateOSD=true)
Definition: mythplayercaptionsui.cpp:148
TVPlaybackState::AdjustSubtitleDelay
void AdjustSubtitleDelay(std::chrono::milliseconds Delta)
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:120
SubtitleReader::GetAVSubtitles
AVSubtitles * GetAVSubtitles(void)
Definition: subtitlereader.h:57
MythCoreContext::GetBoolSetting
bool GetBoolSetting(const QString &key, bool defaultval=false)
Definition: mythcorecontext.cpp:906
MythPlayerCaptionsUI::DoEnableForcedSubtitles
void DoEnableForcedSubtitles()
Definition: mythplayercaptionsui.cpp:359
kDisplayCC708
@ kDisplayCC708
Definition: videoouttypes.h:17
MythPlayerCaptionsUI::GetStreamMaxPos
std::chrono::milliseconds GetStreamMaxPos()
Definition: mythplayercaptionsui.cpp:643
MythPlayerCaptionsUI::EnableCaptions
virtual void EnableCaptions(uint Mode, bool UpdateOSD=true)
Definition: mythplayercaptionsui.cpp:198
MythPlayerCaptionsUI::~MythPlayerCaptionsUI
~MythPlayerCaptionsUI() override
Definition: mythplayercaptionsui.cpp:56
CC708Reader::SetCurrentService
void SetCurrentService(int service)
Definition: cc708reader.h:22
MythPlayerCaptionsUI::ToggleCaptionsByType
void ToggleCaptionsByType(uint Type)
Definition: mythplayercaptionsui.cpp:271
MythPlayerCaptionsUI::m_textDesired
bool m_textDesired
Definition: mythplayercaptionsui.h:71
MythPlayerCaptionsUI::ExternalSubtitlesUpdated
void ExternalSubtitlesUpdated()
Definition: mythplayercaptionsui.cpp:78
TVPlaybackState::EnableTeletext
void EnableTeletext(int Page=0x100)
livetvchain.h
kTrackTypeCC608
@ kTrackTypeCC608
Definition: decoderbase.h:32
MythPlayerCaptionsUI::LoadExternalSubtitles
void LoadExternalSubtitles()
Definition: mythplayercaptionsui.cpp:69
MythCaptionsOverlay::TeletextClear
void TeletextClear()
Definition: mythcaptionsoverlay.cpp:150
MythPlayerOverlayUI::m_osdLock
QRecursiveMutex m_osdLock
Definition: mythplayeroverlayui.h:46
MythPlayerCaptionsUI::SetStream
void SetStream(const QString &Stream)
Definition: mythplayercaptionsui.cpp:618
OptionalCaptionEnabled
bool OptionalCaptionEnabled(uint Captions)
Return whether any optional captions are enabled.
Definition: videoouttypes.h:30
kEofStateDelayed
@ kEofStateDelayed
Definition: decoderbase.h:70
MythPlayerCaptionsUI::SetInteractiveStreamPos
void SetInteractiveStreamPos(std::chrono::milliseconds Position)
MythPlayerCaptionsUI::m_itvEnabled
bool m_itvEnabled
Definition: mythplayercaptionsui.h:76
MythPlayerCaptionsUI::StreamPlay
void StreamPlay(bool Playing=true)
Definition: mythplayercaptionsui.cpp:659
MythPlayerCaptionsUI::m_interactiveTV
InteractiveTV * m_interactiveTV
Definition: mythplayercaptionsui.h:74
MythPlayerUIBase::m_tv
TV * m_tv
Definition: mythplayeruibase.h:18
MythPlayerCaptionsUI::DoDisableForcedSubtitles
void DoDisableForcedSubtitles()
Definition: mythplayercaptionsui.cpp:351
SubtitleReader::HasTextSubtitles
bool HasTextSubtitles(void)
Definition: subtitlereader.cpp:179
MythPlayer::m_totalLength
std::chrono::seconds m_totalLength
Definition: mythplayer.h:426
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:101
TVPlaybackState::ChangeCaptionTrack
void ChangeCaptionTrack(int Direction)
MythPlayerCaptionsUI::CaptionsStateChanged
void CaptionsStateChanged(MythCaptionsState &CaptionsState)
interactivetv.h
MythPlayer::FlagIsSet
bool FlagIsSet(PlayerFlags arg)
Definition: mythplayer.h:318
kTrackTypeRawText
@ kTrackTypeRawText
Definition: decoderbase.h:36
kDisplayRawTextSubtitle
@ kDisplayRawTextSubtitle
Definition: videoouttypes.h:20
MythPlayerCaptionsUI::SetVideoByComponentTag
bool SetVideoByComponentTag(int Tag)
Selects the video stream using the DVB component tag.
Definition: mythplayercaptionsui.cpp:601
TVPlaybackState::CaptionsStateChanged
void CaptionsStateChanged(MythCaptionsState CaptionsState)
Definition: tvplaybackstate.cpp:33
MythPlayer::JumpToFrame
virtual bool JumpToFrame(uint64_t frame)
Definition: mythplayer.cpp:889
MythPlayerCaptionsUI::MythPlayerCaptionsUI
MythPlayerCaptionsUI(MythMainWindow *MainWindow, TV *Tv, PlayerContext *Context, PlayerFlags Flags)
Definition: mythplayercaptionsui.cpp:10
MythPlayerCaptionsUI::m_captionsState
MythCaptionsState m_captionsState
Definition: mythplayercaptionsui.h:70
MythPlayer::SignalTracksChanged
void SignalTracksChanged(uint Type)
kDisplayAllCaptions
@ kDisplayAllCaptions
Definition: videoouttypes.h:21
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:254
MythCaptionsState::m_externalTextSubs
bool m_externalTextSubs
Definition: mythplayerstate.h:71
MythPlayerCaptionsUI::GetTrackCount
uint GetTrackCount(uint Type)
Definition: mythplayercaptionsui.cpp:324
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:922
kDisplayAllTextCaptions
@ kDisplayAllTextCaptions
Definition: videoouttypes.h:23
build_compdb.filename
filename
Definition: build_compdb.py:21
LOC
#define LOC
Definition: mythplayercaptionsui.cpp:8
MythPlayerCaptionsUI::HasCaptionTrack
bool HasCaptionTrack(uint Mode)
Definition: mythplayercaptionsui.cpp:421
kOSDTimeout_Med
@ kOSDTimeout_Med
Definition: osd.h:60
InteractiveTV::Restart
void Restart(int chanid, int sourceid, bool isLive)
Definition: interactivetv.cpp:35
MythMainWindow
Definition: mythmainwindow.h:28
MythPlayer::Play
bool Play(float speed=1.0, bool normal=true, bool unpauseaudio=true)
Definition: mythplayer.cpp:189
mythplayercaptionsui.h
DecoderBase::GetTrackLanguageIndex
virtual int GetTrackLanguageIndex(uint Type, uint TrackNo)
Definition: decoderbase.cpp:931
TVPlaybackState::ChangeTrack
void ChangeTrack(uint Type, int Direction)
MythMediaBuffer::GetType
MythBufferType GetType() const
Definition: mythmediabuffer.cpp:203
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:385
MythCaptionsOverlay::DisableForcedSubtitles
void DisableForcedSubtitles()
Definition: mythcaptionsoverlay.cpp:196
MythPlayerCaptionsUI::HandleTeletextAction
void HandleTeletextAction(const QString &Action, bool &Handled)
Definition: mythplayercaptionsui.cpp:512
TV
Control TV playback.
Definition: tv_play.h:152