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, [this](bool Enable) { this->SetCaptionsEnabled(Enable, false); });
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  if (auto * subs = m_captionsOverlay.InitSubtitles(); subs)
89  {
90  auto newval = std::clamp(subs->GetZoom() + Delta, 50, 200);
91  UpdateOSDStatus(tr("Adjust Subtitle Zoom"), tr("Subtitle Zoom"),
92  QString::number(newval), kOSDFunctionalType_SubtitleZoomAdjust,
93  "%", newval * 1000 / 200, kOSDTimeout_None);
95  subs->SetZoom(newval);
96  }
97 }
98 
99 void MythPlayerCaptionsUI::AdjustSubtitleDelay(std::chrono::milliseconds Delta)
100 {
103  if (!showing || (m_browsing || m_editing))
104  return;
105 
106  if (auto * subs = m_captionsOverlay.InitSubtitles(); subs)
107  {
108  auto newval = std::clamp(subs->GetDelay() + (Delta * 10), -5000ms, 5000ms);
109  // range of -5000ms..+5000ms, scale to 0..1000
110  UpdateOSDStatus(tr("Adjust Subtitle Delay"), tr("Subtitle Delay"),
111  QString::number(newval.count()), kOSDFunctionalType_SubtitleDelayAdjust,
112  "ms", (newval.count() / 10) + 500, kOSDTimeout_None);
114  subs->SetDelay(newval);
115  }
116 
117 }
118 
120 {
123 }
124 
125 static uint toCaptionType(uint Type)
126 {
127  if (kTrackTypeCC608 == Type) return kDisplayCC608;
128  if (kTrackTypeCC708 == Type) return kDisplayCC708;
129  if (kTrackTypeSubtitle == Type) return kDisplayAVSubtitle;
131  if (kTrackTypeTextSubtitle == Type) return kDisplayTextSubtitle;
132  if (kTrackTypeRawText == Type) return kDisplayRawTextSubtitle;
133  return 0;
134 }
135 
136 static uint toTrackType(uint Type)
137 {
138  if (kDisplayCC608 == Type) return kTrackTypeCC608;
139  if (kDisplayCC708 == Type) return kTrackTypeCC708;
140  if (kDisplayAVSubtitle == Type) return kTrackTypeSubtitle;
142  if (kDisplayTextSubtitle == Type) return kTrackTypeTextSubtitle;
143  if (kDisplayRawTextSubtitle == Type) return kTrackTypeRawText;
144  return kTrackTypeUnknown;
145 }
146 
148 {
149  auto oldcaptions = m_captionsState.m_textDisplayMode;
153  if (oldcaptions != m_captionsState.m_textDisplayMode)
155  ResetCaptions();
156 
157  QMutexLocker locker(&m_osdLock);
158 
159  bool newTextDesired = (m_captionsState.m_textDisplayMode & kDisplayAllTextCaptions) != 0U;
160  // Only turn off textDesired if the Operator requested it.
161  if (UpdateOSD || newTextDesired)
162  m_textDesired = newTextDesired;
163 
164  auto msg = (kDisplayNUVTeletextCaptions & Mode) ? tr("TXT CAP") : "";
166  {
167  if (auto track = GetTrack(kTrackTypeTeletextCaptions); (track > 1) && (m_decoder != nullptr))
168  msg += m_decoder->GetTrackDesc(kTrackTypeTeletextCaptions, static_cast<uint>(track));
169  DisableTeletext();
170  }
174  if ((kDisplayCC608 & Mode) || (kDisplayCC708 & Mode) ||
176  {
177  if (uint type = toTrackType(Mode); m_decoder != nullptr)
178  if (auto track = GetTrack(type); track > -1)
179  msg += m_decoder->GetTrackDesc(type, static_cast<uint>(track));
180 
182  }
183 
185  {
186  msg += tr("Text subtitles");
188  }
189 
190  if (!msg.isEmpty() && UpdateOSD)
191  {
192  msg += " " + tr("Off");
194  }
195 }
196 
198 {
199  QMutexLocker locker(&m_osdLock);
200  bool newTextDesired = (Mode & kDisplayAllTextCaptions) != 0U;
201  // Only turn off textDesired if the Operator requested it.
202  if (UpdateOSD || newTextDesired)
203  m_textDesired = newTextDesired;
204  QString msg;
205  if ((kDisplayCC608 & Mode) || (kDisplayCC708 & Mode) ||
207  {
208  if (auto type = toTrackType(Mode); m_decoder != nullptr)
209  if (auto track = GetTrack(type); track > -1)
210  msg += m_decoder->GetTrackDesc(type, static_cast<uint>(track));
211 
212  m_captionsOverlay.EnableSubtitles(static_cast<int>(Mode));
213  }
214 
216  {
219  subs->m_needSync = true;
220  msg += tr("Text subtitles");
221  }
222 
224  msg += tr("TXT %1").arg(m_ttPageNum, 3, 16);
225 
226  if ((kDisplayTeletextCaptions & Mode) && (m_decoder != nullptr))
227  {
229  static_cast<uint>(GetTrack(kTrackTypeTeletextCaptions)));
230 
232  static_cast<uint>(GetTrack(kTrackTypeTeletextCaptions)));
233 
234  EnableTeletext(page);
235  }
236 
237  msg += " " + tr("On");
238  LOG(VB_PLAYBACK, LOG_INFO, QString("EnableCaptions(%1) msg: %2").arg(Mode).arg(msg));
239 
240  auto oldcaptions = m_captionsState.m_textDisplayMode;
244  if (oldcaptions != m_captionsState.m_textDisplayMode)
246  if (UpdateOSD)
248 }
249 
254 {
256  SetCaptionsEnabled(true, false);
257 }
258 
260 {
261  m_allowForcedSubtitles = Allow;
262  UpdateOSDMessage(m_allowForcedSubtitles ? tr("Forced Subtitles On") : tr("Forced Subtitles Off"));
263 }
264 
266 {
268 }
269 
271 {
272  QMutexLocker locker(&m_osdLock);
273  auto mode = toCaptionType(Type);
274  auto origmode = m_captionsState.m_textDisplayMode;
276  DisableCaptions(m_captionsState.m_textDisplayMode, (origmode & mode) != 0U);
277  if (origmode & mode)
278  return;
279  if (mode)
280  EnableCaptions(mode);
281 }
282 
283 void MythPlayerCaptionsUI::SetCaptionsEnabled(bool Enable, bool UpdateOSD)
284 {
285  QMutexLocker locker(&m_osdLock);
286  auto origmode = m_captionsState.m_textDisplayMode;
287 
288  // Only turn off textDesired if the Operator requested it.
289  if (UpdateOSD || Enable)
290  m_textDesired = Enable;
291 
292  if (!Enable)
293  {
294  DisableCaptions(origmode, UpdateOSD);
295  return;
296  }
297 
300  {
301  DisableCaptions(origmode, false);
302  if (kDisplayNone == mode)
303  {
304  if (UpdateOSD)
305  UpdateOSDMessage(tr("No captions", "CC/Teletext/Subtitle text not available"), kOSDTimeout_Med);
306  LOG(VB_PLAYBACK, LOG_INFO, "No captions available yet to enable.");
307  }
308  else
309  {
310  EnableCaptions(mode, UpdateOSD);
311  }
312  }
313  ResetCaptions();
314 }
315 
317 {
318  if (m_decoder)
319  return m_decoder->GetTracks(Type);
320  return {};
321 }
322 
324 {
325  if (m_decoder)
326  return m_decoder->GetTrackCount(Type);
327  return 0;
328 }
329 
331 {
332  if (!m_decoder)
333  return;
334 
335  m_decoder->SetTrack(Type, static_cast<int>(TrackNo));
336  if (kTrackTypeAudio == Type)
337  {
338  UpdateOSDMessage(m_decoder->GetTrackDesc(Type, static_cast<uint>(GetTrack(Type))), kOSDTimeout_Med);
339  }
340  else if (auto subtype = toCaptionType(Type); subtype)
341  {
343  EnableCaptions(subtype, true);
344  if ((kDisplayCC708 == subtype || kDisplayCC608 == subtype) && m_decoder)
345  if (auto sid = m_decoder->GetTrackInfo(Type, TrackNo).m_stream_id; sid > 0)
346  (kDisplayCC708 == subtype) ? m_cc708.SetCurrentService(sid) : m_cc608.SetMode(sid);
347  }
348 }
349 
351 {
352  m_disableForcedSubtitles = false;
353  m_osdLock.lock();
355  m_osdLock.unlock();
356 }
357 
359 {
360  m_enableForcedSubtitles = false;
362  return;
363 
364  m_osdLock.lock();
366  m_osdLock.unlock();
367 }
368 
370 {
371  if (m_decoder)
372  return m_decoder->GetTrack(Type);
373  return -1;
374 }
375 
376 void MythPlayerCaptionsUI::ChangeTrack(uint Type, int Direction)
377 {
378  if (!m_decoder)
379  return;
380  if (auto ret = m_decoder->ChangeTrack(Type, Direction); ret >= 0)
381  UpdateOSDMessage(m_decoder->GetTrackDesc(Type, static_cast<uint>(GetTrack(Type))), kOSDTimeout_Med);
382 }
383 
385 {
386  if (!m_decoder || (Direction < 0))
387  return;
388 
392  {
394  if (GetTrack(tracktype) < m_decoder->NextTrack(tracktype))
395  {
396  SetTrack(tracktype, static_cast<uint>(m_decoder->NextTrack(tracktype)));
397  return;
398  }
399  }
401  if ((nextmode == kDisplayTextSubtitle) || (nextmode == kDisplayNUVTeletextCaptions) ||
402  (nextmode == kDisplayNone))
403  {
405  if (nextmode != kDisplayNone)
406  EnableCaptions(nextmode, true);
407  }
408  else
409  {
410  uint tracktype = toTrackType(nextmode);
411  uint tracks = m_decoder->GetTrackCount(tracktype);
412  if (tracks)
413  {
415  SetTrack(tracktype, 0);
416  }
417  }
418 }
419 
421 {
422  if (Mode == kDisplayNone)
423  return false;
425  return true;
426  // External subtitles are now decoded with FFmpeg and are AVSubtitles.
428  return true;
430  return true;
431  return false;
432 }
433 
435 {
436  // Text->TextStream->708->608->AVSubs->Teletext->NUV->None
437  // NUV only offerred if PAL
438  bool pal = (m_vbiMode == VBIMode::PAL_TT);
439  uint nextmode = kDisplayNone;
440 
441  if (kDisplayTextSubtitle == Mode)
442  nextmode = kDisplayRawTextSubtitle;
443  else if (kDisplayRawTextSubtitle == Mode)
444  nextmode = kDisplayCC708;
445  else if (kDisplayCC708 == Mode)
446  nextmode = kDisplayCC608;
447  else if (kDisplayCC608 == Mode)
448  nextmode = kDisplayAVSubtitle;
449  else if (kDisplayAVSubtitle == Mode)
450  nextmode = kDisplayTeletextCaptions;
451  else if (kDisplayTeletextCaptions == Mode)
452  nextmode = pal ? kDisplayNUVTeletextCaptions : kDisplayNone;
453  else if ((kDisplayNUVTeletextCaptions == Mode) && pal)
454  nextmode = kDisplayNone;
455  else if (kDisplayNone == Mode)
456  nextmode = kDisplayTextSubtitle;
457 
458  if (nextmode == kDisplayNone || HasCaptionTrack(nextmode))
459  return nextmode;
460 
461  return NextCaptionTrack(nextmode);
462 }
463 
465 {
466  QMutexLocker locker(&m_osdLock);
467  auto oldcaptions = m_captionsState.m_textDisplayMode;
468  m_captionsOverlay.EnableTeletext(true, Page);
471  if (oldcaptions != m_captionsState.m_textDisplayMode)
473 }
474 
476 {
477  QMutexLocker locker(&m_osdLock);
479  auto oldcaptions = m_captionsState.m_textDisplayMode;
481  if (oldcaptions != m_captionsState.m_textDisplayMode)
483 
484  // If subtitles were enabled before the teletext menu was displayed then re-enable them
487 }
488 
490 {
491  QMutexLocker locker(&m_osdLock);
493 }
494 
498 {
499  m_osdLock.lock();
501  auto oldcaptions = m_captionsState.m_textDisplayMode;
502  m_ttPageNum = static_cast<int>(Page);
506  if (oldcaptions != m_captionsState.m_textDisplayMode)
508  m_osdLock.unlock();
509 }
510 
511 void MythPlayerCaptionsUI::HandleTeletextAction(const QString& Action, bool &Handled)
512 {
514  return;
515 
516  bool exit = false;
517  m_osdLock.lock();
518  Handled = m_captionsOverlay.TeletextAction(Action, exit);
519  m_osdLock.unlock();
520  if (exit)
521  DisableTeletext();
522 }
523 
525 {
526 #ifdef USING_MHEG
527  bool update = false;
528  {
529  QMutexLocker lock1(&m_osdLock);
530  QMutexLocker lock2(&m_itvLock);
532  {
533  m_interactiveTV = new InteractiveTV(this);
534  m_captionsState.m_haveITV = true;
535  update = true;
536  }
537  }
538  if (update)
540 #endif
541  return m_interactiveTV;
542 }
543 
551 void MythPlayerCaptionsUI::ITVHandleAction([[maybe_unused]] const QString &Action,
552  [[maybe_unused]] bool& Handled)
553 {
554 #ifdef USING_MHEG
555  if (!GetInteractiveTV())
556  {
557  Handled = false;
558  return;
559  }
560 
561  QMutexLocker locker(&m_itvLock);
562  Handled = m_interactiveTV->OfferKey(Action);
563 #endif
564 }
565 
567 void MythPlayerCaptionsUI::ITVRestart([[maybe_unused]] uint Chanid,
568  [[maybe_unused]] uint Cardid,
569  [[maybe_unused]] bool IsLiveTV)
570 {
571 #ifdef USING_MHEG
572  if (!GetInteractiveTV())
573  return;
574 
575  QMutexLocker locker(&m_itvLock);
576  m_interactiveTV->Restart(static_cast<int>(Chanid), static_cast<int>(Cardid), IsLiveTV);
577  m_itvVisible = false;
578 #endif
579 }
580 
589 {
590  QMutexLocker locker(&m_decoderChangeLock);
591  if (m_decoder)
592  return m_decoder->SetAudioByComponentTag(Tag);
593  return false;
594 }
595 
601 {
602  QMutexLocker locker(&m_decoderChangeLock);
603  if (m_decoder)
604  return m_decoder->SetVideoByComponentTag(Tag);
605  return false;
606 }
607 
609 {
610  QMutexLocker locker(&m_decoderChangeLock);
611  if (!m_decoder)
612  return 25;
613  double fps = m_decoder->GetFPS();
614  return fps > 0 ? fps : 25.0;
615 }
616 
617 void MythPlayerCaptionsUI::SetStream(const QString& Stream)
618 {
619  // The stream name is empty if the stream is closing
620  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("SetStream '%1'").arg(Stream));
621 
622  // Stream will be changed by JumpToStream called from EventLoop
623  // If successful will call m_interactiveTV->StreamStarted();
624  m_newStream = Stream;
625 
626  if (Stream.isEmpty() && m_playerCtx->m_tvchain && m_playerCtx->m_buffer->GetType() == kMythBufferMHEG)
627  {
628  // Restore livetv
630  m_playerCtx->m_tvchain->JumpToNext(false, 0s);
631  m_playerCtx->m_tvchain->JumpToNext(true, 0s);
632  }
633 }
634 
635 // Called from the interactiveTV (MHIContext) thread
636 std::chrono::milliseconds MythPlayerCaptionsUI::GetStreamPos()
637 {
638  return millisecondsFromFloat((1000 * GetFramesPlayed()) / SafeFPS());
639 }
640 
641 // Called from the interactiveTV (MHIContext) thread
642 std::chrono::milliseconds MythPlayerCaptionsUI::GetStreamMaxPos()
643 {
644  std::chrono::seconds maxsecs = m_totalDuration > 0s ? m_totalDuration : m_totalLength;
645  auto maxpos = duration_cast<std::chrono::milliseconds>(maxsecs);
646  auto pos = GetStreamPos();
647  return maxpos > pos ? maxpos : pos;
648 }
649 
650 void MythPlayerCaptionsUI::SetStreamPos(std::chrono::milliseconds Position)
651 {
652  auto frameNum = static_cast<uint64_t>((Position.count() * SafeFPS()) / 1000);
653  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("SetStreamPos %1 mS = frame %2, now=%3")
654  .arg(Position.count()).arg(frameNum).arg(GetFramesPlayed()) );
655  JumpToFrame(frameNum);
656 }
657 
659 {
660  if (Playing)
661  Play();
662  else
663  Pause();
664 }
MythPlayerCaptionsUI::NextCaptionTrack
uint NextCaptionTrack(uint Mode)
Definition: mythplayercaptionsui.cpp:434
MythPlayerCaptionsUI::GetInteractiveTV
InteractiveTV * GetInteractiveTV() override
Definition: mythplayercaptionsui.cpp:524
MythPlayerCaptionsUI::PlayInteractiveStream
void PlayInteractiveStream(bool Play)
kTrackTypeCC708
@ kTrackTypeCC708
Definition: decoderbase.h:34
kTrackTypeUnknown
@ kTrackTypeUnknown
Definition: decoderbase.h:29
MythPlayerCaptionsUI::SetTrack
virtual void SetTrack(uint Type, uint TrackNo)
Definition: mythplayercaptionsui.cpp:330
DecoderBase::SetVideoByComponentTag
virtual bool SetVideoByComponentTag(int)
Definition: decoderbase.h:247
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: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:259
kTrackTypeSubtitle
@ kTrackTypeSubtitle
Definition: decoderbase.h:32
MythPlayer::m_subReader
SubtitleReader m_subReader
Definition: mythplayer.h:458
kDisplayNUVTeletextCaptions
@ kDisplayNUVTeletextCaptions
Definition: videoouttypes.h:13
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)
kDisplayCC608
@ kDisplayCC608
Definition: videoouttypes.h:16
MythPlayerCaptionsUI::GetTrack
int GetTrack(uint Type)
Definition: mythplayercaptionsui.cpp:369
kDisplayCC708
@ kDisplayCC708
Definition: videoouttypes.h:17
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:105
MythPlayerCaptionsUI::ToggleCaptions
void ToggleCaptions()
Definition: mythplayercaptionsui.cpp:265
MythCaptionsOverlay::ClearSubtitles
void ClearSubtitles()
Definition: mythcaptionsoverlay.cpp:206
kOSDTimeout_Med
@ kOSDTimeout_Med
Definition: osd.h:60
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:475
MythCaptionsOverlay::InitSubtitles
SubtitleScreen * InitSubtitles()
Definition: mythcaptionsoverlay.cpp:160
toTrackType
static uint toTrackType(uint Type)
Definition: mythplayercaptionsui.cpp:136
TVPlaybackState::ResetTeletext
void ResetTeletext()
MythPlayerCaptionsUI::AdjustSubtitleDelay
void AdjustSubtitleDelay(std::chrono::milliseconds Delta)
Definition: mythplayercaptionsui.cpp:99
MythPlayer::m_cc708
CC708Reader m_cc708
Definition: mythplayer.h:469
MythPlayerCaptionsUI::GetStreamPos
std::chrono::milliseconds GetStreamPos()
Definition: mythplayercaptionsui.cpp:636
kDisplayTeletextMenu
@ kDisplayTeletextMenu
Definition: videoouttypes.h:22
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:246
PlayerFlags
PlayerFlags
Definition: mythplayer.h:64
MythPlayer::Pause
bool Pause(void)
Definition: mythplayer.cpp:156
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:551
kMythBufferMHEG
@ kMythBufferMHEG
Definition: mythmediabuffer.h:56
MythPlayerCaptionsUI::ChangeTrack
void ChangeTrack(uint Type, int Direction)
Definition: mythplayercaptionsui.cpp:376
MythPlayerCaptionsUI::InitialiseState
void InitialiseState() override
Definition: mythplayercaptionsui.cpp:60
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:83
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
InteractiveTV::OfferKey
bool OfferKey(const QString &key)
Definition: interactivetv.cpp:68
toCaptionType
static uint toCaptionType(uint Type)
Definition: mythplayercaptionsui.cpp:125
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:927
DecoderBase::GetTrackCount
virtual uint GetTrackCount(uint Type)
Definition: decoderbase.cpp:897
CC608Reader::SetMode
void SetMode(int mode)
Definition: cc608reader.cpp:149
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)
kDisplayAllCaptions
@ kDisplayAllCaptions
Definition: videoouttypes.h:21
kDisplayRawTextSubtitle
@ kDisplayRawTextSubtitle
Definition: videoouttypes.h:20
kOSDTimeout_None
@ kOSDTimeout_None
Definition: osd.h:58
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: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)
kTrackTypeTextSubtitle
@ kTrackTypeTextSubtitle
Definition: decoderbase.h:43
MythPlayerOverlayUI::ChangeOSDPositionUpdates
void ChangeOSDPositionUpdates(bool Enable)
Definition: mythplayeroverlayui.cpp:43
MythPlayerOverlayUI::m_editing
bool m_editing
Definition: mythplayeroverlayui.h:48
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:253
MythPlayerCaptionsUI::SetAudioByComponentTag
bool SetAudioByComponentTag(int Tag)
Selects the audio stream using the DVB component tag.
Definition: mythplayercaptionsui.cpp:588
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
kDisplayAVSubtitle
@ kDisplayAVSubtitle
Definition: videoouttypes.h:15
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:567
TVPlaybackState::HandleITVAction
void HandleITVAction(const QString &Action, bool &Handled)
MythPlayerCaptionsUI::ResetTeletext
void ResetTeletext()
Definition: mythplayercaptionsui.cpp:489
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:316
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:33
MythPlayerOverlayUI::m_browsing
bool m_browsing
Definition: mythplayeroverlayui.h:47
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:190
MythPlayerCaptionsUI::SetTeletextPage
void SetTeletextPage(uint Page)
Set Teletext NUV Caption page.
Definition: mythplayercaptionsui.cpp:497
MythPlayerCaptionsUI::SetStreamPos
void SetStreamPos(std::chrono::milliseconds Position)
Definition: mythplayercaptionsui.cpp:650
MythPlayerCaptionsUI::SetCaptionsEnabled
void SetCaptionsEnabled(bool Enable, bool UpdateOSD=true)
Definition: mythplayercaptionsui.cpp:283
MythPlayer::m_disableForcedSubtitles
bool m_disableForcedSubtitles
Definition: mythplayer.h:464
MythPlayerCaptionsUI::SafeFPS
double SafeFPS()
Definition: mythplayercaptionsui.cpp:608
kNoITV
@ kNoITV
Definition: mythplayer.h:75
MythPlayer::RequestResetCaptions
void RequestResetCaptions()
MythPlayerCaptionsUI::EnableTeletext
void EnableTeletext(int Page=0x100)
Definition: mythplayercaptionsui.cpp:464
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:55
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:147
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:119
SubtitleReader::GetAVSubtitles
AVSubtitles * GetAVSubtitles(void)
Definition: subtitlereader.h:57
MythCoreContext::GetBoolSetting
bool GetBoolSetting(const QString &key, bool defaultval=false)
Definition: mythcorecontext.cpp:910
MythPlayerCaptionsUI::DoEnableForcedSubtitles
void DoEnableForcedSubtitles()
Definition: mythplayercaptionsui.cpp:358
MythPlayerCaptionsUI::GetStreamMaxPos
std::chrono::milliseconds GetStreamMaxPos()
Definition: mythplayercaptionsui.cpp:642
MythPlayerCaptionsUI::EnableCaptions
virtual void EnableCaptions(uint Mode, bool UpdateOSD=true)
Definition: mythplayercaptionsui.cpp:197
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:270
MythPlayerCaptionsUI::m_textDesired
bool m_textDesired
Definition: mythplayercaptionsui.h:72
MythPlayerCaptionsUI::ExternalSubtitlesUpdated
void ExternalSubtitlesUpdated()
Definition: mythplayercaptionsui.cpp:77
TVPlaybackState::EnableTeletext
void EnableTeletext(int Page=0x100)
livetvchain.h
MythPlayerCaptionsUI::LoadExternalSubtitles
void LoadExternalSubtitles()
Definition: mythplayercaptionsui.cpp:68
MythCaptionsOverlay::TeletextClear
void TeletextClear()
Definition: mythcaptionsoverlay.cpp:150
kEofStateDelayed
@ kEofStateDelayed
Definition: decoderbase.h:71
MythPlayerOverlayUI::m_osdLock
QRecursiveMutex m_osdLock
Definition: mythplayeroverlayui.h:46
MythPlayerCaptionsUI::SetStream
void SetStream(const QString &Stream)
Definition: mythplayercaptionsui.cpp:617
OptionalCaptionEnabled
bool OptionalCaptionEnabled(uint Captions)
Return whether any optional captions are enabled.
Definition: videoouttypes.h:30
MythPlayerCaptionsUI::SetInteractiveStreamPos
void SetInteractiveStreamPos(std::chrono::milliseconds Position)
kDisplayAllTextCaptions
@ kDisplayAllTextCaptions
Definition: videoouttypes.h:23
MythPlayerCaptionsUI::m_itvEnabled
bool m_itvEnabled
Definition: mythplayercaptionsui.h:77
kDisplayNone
@ kDisplayNone
Definition: videoouttypes.h:12
MythPlayerCaptionsUI::StreamPlay
void StreamPlay(bool Playing=true)
Definition: mythplayercaptionsui.cpp:658
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:350
kTrackTypeTeletextCaptions
@ kTrackTypeTeletextCaptions
Definition: decoderbase.h:35
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: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
kTrackTypeAudio
@ kTrackTypeAudio
Definition: decoderbase.h:30
MythPlayerCaptionsUI::SetVideoByComponentTag
bool SetVideoByComponentTag(int Tag)
Selects the video stream using the DVB component tag.
Definition: mythplayercaptionsui.cpp:600
TVPlaybackState::CaptionsStateChanged
void CaptionsStateChanged(MythCaptionsState CaptionsState)
Definition: tvplaybackstate.cpp:33
kTrackTypeRawText
@ kTrackTypeRawText
Definition: decoderbase.h:37
MythPlayer::JumpToFrame
virtual bool JumpToFrame(uint64_t frame)
Definition: mythplayer.cpp:889
kDisplayTextSubtitle
@ kDisplayTextSubtitle
Definition: videoouttypes.h:18
MythPlayerCaptionsUI::MythPlayerCaptionsUI
MythPlayerCaptionsUI(MythMainWindow *MainWindow, TV *Tv, PlayerContext *Context, PlayerFlags Flags)
Definition: mythplayercaptionsui.cpp:10
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:27
MythPlayerCaptionsUI::GetTrackCount
uint GetTrackCount(uint Type)
Definition: mythplayercaptionsui.cpp:323
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
LOC
#define LOC
Definition: mythplayercaptionsui.cpp:8
MythPlayerCaptionsUI::HasCaptionTrack
bool HasCaptionTrack(uint Mode)
Definition: mythplayercaptionsui.cpp:420
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:189
kDisplayTeletextCaptions
@ kDisplayTeletextCaptions
Definition: videoouttypes.h:14
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
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:384
MythCaptionsOverlay::DisableForcedSubtitles
void DisableForcedSubtitles()
Definition: mythcaptionsoverlay.cpp:196
MythPlayerCaptionsUI::HandleTeletextAction
void HandleTeletextAction(const QString &Action, bool &Handled)
Definition: mythplayercaptionsui.cpp:511
TV
Control TV playback.
Definition: tv_play.h:154