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  {
219  msg += tr("Text subtitles");
220  }
221 
223  msg += tr("TXT %1").arg(m_ttPageNum, 3, 16);
224 
225  if ((kDisplayTeletextCaptions & Mode) && (m_decoder != nullptr))
226  {
228  static_cast<uint>(GetTrack(kTrackTypeTeletextCaptions)));
229 
231  static_cast<uint>(GetTrack(kTrackTypeTeletextCaptions)));
232 
233  EnableTeletext(page);
234  }
235 
236  msg += " " + tr("On");
237  LOG(VB_PLAYBACK, LOG_INFO, QString("EnableCaptions(%1) msg: %2").arg(Mode).arg(msg));
238 
239  auto oldcaptions = m_captionsState.m_textDisplayMode;
243  if (oldcaptions != m_captionsState.m_textDisplayMode)
245  if (UpdateOSD)
247 }
248 
253 {
255  SetCaptionsEnabled(true, false);
256 }
257 
259 {
260  m_allowForcedSubtitles = Allow;
261  UpdateOSDMessage(m_allowForcedSubtitles ? tr("Forced Subtitles On") : tr("Forced Subtitles Off"));
262 }
263 
265 {
267 }
268 
270 {
271  QMutexLocker locker(&m_osdLock);
272  auto mode = toCaptionType(Type);
273  auto origmode = m_captionsState.m_textDisplayMode;
275  DisableCaptions(m_captionsState.m_textDisplayMode, (origmode & mode) != 0U);
276  if (origmode & mode)
277  return;
278  if (mode)
279  EnableCaptions(mode);
280 }
281 
282 void MythPlayerCaptionsUI::SetCaptionsEnabled(bool Enable, bool UpdateOSD)
283 {
284  QMutexLocker locker(&m_osdLock);
285  auto origmode = m_captionsState.m_textDisplayMode;
286 
287  // Only turn off textDesired if the Operator requested it.
288  if (UpdateOSD || Enable)
289  m_textDesired = Enable;
290 
291  if (!Enable)
292  {
293  DisableCaptions(origmode, UpdateOSD);
294  return;
295  }
296 
299  {
300  DisableCaptions(origmode, false);
301  if (kDisplayNone == mode)
302  {
303  if (UpdateOSD)
304  UpdateOSDMessage(tr("No captions", "CC/Teletext/Subtitle text not available"), kOSDTimeout_Med);
305  LOG(VB_PLAYBACK, LOG_INFO, "No captions available yet to enable.");
306  }
307  else
308  {
309  EnableCaptions(mode, UpdateOSD);
310  }
311  }
312  ResetCaptions();
313 }
314 
316 {
317  if (m_decoder)
318  return m_decoder->GetTracks(Type);
319  return {};
320 }
321 
323 {
324  if (m_decoder)
325  return m_decoder->GetTrackCount(Type);
326  return 0;
327 }
328 
330 {
331  if (!m_decoder)
332  return;
333 
334  m_decoder->SetTrack(Type, static_cast<int>(TrackNo));
335  if (kTrackTypeAudio == Type)
336  {
337  UpdateOSDMessage(m_decoder->GetTrackDesc(Type, static_cast<uint>(GetTrack(Type))), kOSDTimeout_Med);
338  }
339  else if (auto subtype = toCaptionType(Type); subtype)
340  {
342  EnableCaptions(subtype, true);
343  if ((kDisplayCC708 == subtype || kDisplayCC608 == subtype) && m_decoder)
344  if (auto sid = m_decoder->GetTrackInfo(Type, TrackNo).m_stream_id; sid > 0)
345  (kDisplayCC708 == subtype) ? m_cc708.SetCurrentService(sid) : m_cc608.SetMode(sid);
346  }
347 }
348 
350 {
351  m_disableForcedSubtitles = false;
352  m_osdLock.lock();
354  m_osdLock.unlock();
355 }
356 
358 {
359  m_enableForcedSubtitles = false;
361  return;
362 
363  m_osdLock.lock();
365  m_osdLock.unlock();
366 }
367 
369 {
370  if (m_decoder)
371  return m_decoder->GetTrack(Type);
372  return -1;
373 }
374 
375 void MythPlayerCaptionsUI::ChangeTrack(uint Type, int Direction)
376 {
377  if (!m_decoder)
378  return;
379  if (auto ret = m_decoder->ChangeTrack(Type, Direction); ret >= 0)
380  UpdateOSDMessage(m_decoder->GetTrackDesc(Type, static_cast<uint>(GetTrack(Type))), kOSDTimeout_Med);
381 }
382 
384 {
385  if (!m_decoder || (Direction < 0))
386  return;
387 
391  {
393  if (GetTrack(tracktype) < m_decoder->NextTrack(tracktype))
394  {
395  SetTrack(tracktype, static_cast<uint>(m_decoder->NextTrack(tracktype)));
396  return;
397  }
398  }
400  if ((nextmode == kDisplayTextSubtitle) || (nextmode == kDisplayNUVTeletextCaptions) ||
401  (nextmode == kDisplayNone))
402  {
404  if (nextmode != kDisplayNone)
405  EnableCaptions(nextmode, true);
406  }
407  else
408  {
409  uint tracktype = toTrackType(nextmode);
410  uint tracks = m_decoder->GetTrackCount(tracktype);
411  if (tracks)
412  {
414  SetTrack(tracktype, 0);
415  }
416  }
417 }
418 
420 {
421  if (Mode == kDisplayNone)
422  return false;
424  return true;
425  // External subtitles are now decoded with FFmpeg and are AVSubtitles.
427  return true;
429  return true;
430  return false;
431 }
432 
434 {
435  // Text->TextStream->708->608->AVSubs->Teletext->NUV->None
436  // NUV only offerred if PAL
437  bool pal = (m_vbiMode == VBIMode::PAL_TT);
438  uint nextmode = kDisplayNone;
439 
440  if (kDisplayTextSubtitle == Mode)
441  nextmode = kDisplayRawTextSubtitle;
442  else if (kDisplayRawTextSubtitle == Mode)
443  nextmode = kDisplayCC708;
444  else if (kDisplayCC708 == Mode)
445  nextmode = kDisplayCC608;
446  else if (kDisplayCC608 == Mode)
447  nextmode = kDisplayAVSubtitle;
448  else if (kDisplayAVSubtitle == Mode)
449  nextmode = kDisplayTeletextCaptions;
450  else if (kDisplayTeletextCaptions == Mode)
451  nextmode = pal ? kDisplayNUVTeletextCaptions : kDisplayNone;
452  else if ((kDisplayNUVTeletextCaptions == Mode) && pal)
453  nextmode = kDisplayNone;
454  else if (kDisplayNone == Mode)
455  nextmode = kDisplayTextSubtitle;
456 
457  if (nextmode == kDisplayNone || HasCaptionTrack(nextmode))
458  return nextmode;
459 
460  return NextCaptionTrack(nextmode);
461 }
462 
464 {
465  QMutexLocker locker(&m_osdLock);
466  auto oldcaptions = m_captionsState.m_textDisplayMode;
467  m_captionsOverlay.EnableTeletext(true, Page);
470  if (oldcaptions != m_captionsState.m_textDisplayMode)
472 }
473 
475 {
476  QMutexLocker locker(&m_osdLock);
478  auto oldcaptions = m_captionsState.m_textDisplayMode;
480  if (oldcaptions != m_captionsState.m_textDisplayMode)
482 
483  // If subtitles were enabled before the teletext menu was displayed then re-enable them
486 }
487 
489 {
490  QMutexLocker locker(&m_osdLock);
492 }
493 
497 {
498  m_osdLock.lock();
500  auto oldcaptions = m_captionsState.m_textDisplayMode;
501  m_ttPageNum = static_cast<int>(Page);
505  if (oldcaptions != m_captionsState.m_textDisplayMode)
507  m_osdLock.unlock();
508 }
509 
510 void MythPlayerCaptionsUI::HandleTeletextAction(const QString& Action, bool &Handled)
511 {
513  return;
514 
515  bool exit = false;
516  m_osdLock.lock();
517  Handled = m_captionsOverlay.TeletextAction(Action, exit);
518  m_osdLock.unlock();
519  if (exit)
520  DisableTeletext();
521 }
522 
524 {
525 #ifdef USING_MHEG
526  bool update = false;
527  {
528  QMutexLocker lock1(&m_osdLock);
529  QMutexLocker lock2(&m_itvLock);
531  {
532  m_interactiveTV = new InteractiveTV(this);
533  m_captionsState.m_haveITV = true;
534  update = true;
535  }
536  }
537  if (update)
539 #endif
540  return m_interactiveTV;
541 }
542 
550 void MythPlayerCaptionsUI::ITVHandleAction([[maybe_unused]] const QString &Action,
551  [[maybe_unused]] bool& Handled)
552 {
553 #ifdef USING_MHEG
554  if (!GetInteractiveTV())
555  {
556  Handled = false;
557  return;
558  }
559 
560  QMutexLocker locker(&m_itvLock);
561  Handled = m_interactiveTV->OfferKey(Action);
562 #endif
563 }
564 
566 void MythPlayerCaptionsUI::ITVRestart([[maybe_unused]] uint Chanid,
567  [[maybe_unused]] uint Cardid,
568  [[maybe_unused]] bool IsLiveTV)
569 {
570 #ifdef USING_MHEG
571  if (!GetInteractiveTV())
572  return;
573 
574  QMutexLocker locker(&m_itvLock);
575  m_interactiveTV->Restart(static_cast<int>(Chanid), static_cast<int>(Cardid), IsLiveTV);
576  m_itvVisible = false;
577 #endif
578 }
579 
588 {
589  QMutexLocker locker(&m_decoderChangeLock);
590  if (m_decoder)
591  return m_decoder->SetAudioByComponentTag(Tag);
592  return false;
593 }
594 
600 {
601  QMutexLocker locker(&m_decoderChangeLock);
602  if (m_decoder)
603  return m_decoder->SetVideoByComponentTag(Tag);
604  return false;
605 }
606 
608 {
609  QMutexLocker locker(&m_decoderChangeLock);
610  if (!m_decoder)
611  return 25;
612  double fps = m_decoder->GetFPS();
613  return fps > 0 ? fps : 25.0;
614 }
615 
616 void MythPlayerCaptionsUI::SetStream(const QString& Stream)
617 {
618  // The stream name is empty if the stream is closing
619  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("SetStream '%1'").arg(Stream));
620 
621  // Stream will be changed by JumpToStream called from EventLoop
622  // If successful will call m_interactiveTV->StreamStarted();
623  m_newStream = Stream;
624 
625  if (Stream.isEmpty() && m_playerCtx->m_tvchain && m_playerCtx->m_buffer->GetType() == kMythBufferMHEG)
626  {
627  // Restore livetv
629  m_playerCtx->m_tvchain->JumpToNext(false, 0s);
630  m_playerCtx->m_tvchain->JumpToNext(true, 0s);
631  }
632 }
633 
634 // Called from the interactiveTV (MHIContext) thread
635 std::chrono::milliseconds MythPlayerCaptionsUI::GetStreamPos()
636 {
637  return millisecondsFromFloat((1000 * GetFramesPlayed()) / SafeFPS());
638 }
639 
640 // Called from the interactiveTV (MHIContext) thread
641 std::chrono::milliseconds MythPlayerCaptionsUI::GetStreamMaxPos()
642 {
643  std::chrono::seconds maxsecs = m_totalDuration > 0s ? m_totalDuration : m_totalLength;
644  auto maxpos = duration_cast<std::chrono::milliseconds>(maxsecs);
645  auto pos = GetStreamPos();
646  return maxpos > pos ? maxpos : pos;
647 }
648 
649 void MythPlayerCaptionsUI::SetStreamPos(std::chrono::milliseconds Position)
650 {
651  auto frameNum = static_cast<uint64_t>((Position.count() * SafeFPS()) / 1000);
652  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("SetStreamPos %1 mS = frame %2, now=%3")
653  .arg(Position.count()).arg(frameNum).arg(GetFramesPlayed()) );
654  JumpToFrame(frameNum);
655 }
656 
658 {
659  if (Playing)
660  Play();
661  else
662  Pause();
663 }
kTrackTypeUnknown
@ kTrackTypeUnknown
Definition: decoderbase.h:28
MythPlayerCaptionsUI::NextCaptionTrack
uint NextCaptionTrack(uint Mode)
Definition: mythplayercaptionsui.cpp:433
MythPlayerCaptionsUI::GetInteractiveTV
InteractiveTV * GetInteractiveTV() override
Definition: mythplayercaptionsui.cpp:523
MythPlayerCaptionsUI::PlayInteractiveStream
void PlayInteractiveStream(bool Play)
MythPlayerCaptionsUI::SetTrack
virtual void SetTrack(uint Type, uint TrackNo)
Definition: mythplayercaptionsui.cpp:329
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:471
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:1010
MythPlayer::m_decoderChangeLock
QRecursiveMutex m_decoderChangeLock
Definition: mythplayer.h:370
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:1086
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:258
kDisplayTeletextMenu
@ kDisplayTeletextMenu
Definition: videoouttypes.h:22
MythPlayer::m_subReader
SubtitleReader m_subReader
Definition: mythplayer.h:466
MythPlayerCaptionsUI::m_newStream
QString m_newStream
Definition: mythplayercaptionsui.h:78
kDisplayNone
@ kDisplayNone
Definition: videoouttypes.h:12
MythPlayer::m_cc608
CC608Reader m_cc608
Definition: mythplayer.h:476
TVPlaybackState::HandleTeletextAction
void HandleTeletextAction(const QString &Action, bool &Handled)
MythPlayerCaptionsUI::GetTrack
int GetTrack(uint Type)
Definition: mythplayercaptionsui.cpp:368
MythPlayer::m_allowForcedSubtitles
bool m_allowForcedSubtitles
Definition: mythplayer.h:473
Mode
Mode
Definition: synaesthesia.h:23
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:435
StreamInfo::m_stream_id
int m_stream_id
Definition: decoderbase.h:99
MythPlayerCaptionsUI::ToggleCaptions
void ToggleCaptions()
Definition: mythplayercaptionsui.cpp:264
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:474
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
MythPlayer::m_cc708
CC708Reader m_cc708
Definition: mythplayer.h:477
MythPlayerCaptionsUI::GetStreamPos
std::chrono::milliseconds GetStreamPos()
Definition: mythplayercaptionsui.cpp:635
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:994
TrackType
TrackType
Track types.
Definition: decoderbase.h:26
DecoderBase::SetAudioByComponentTag
virtual bool SetAudioByComponentTag(int)
Definition: decoderbase.h:255
PlayerFlags
PlayerFlags
Definition: mythplayer.h:65
MythPlayer::Pause
bool Pause(void)
Definition: mythplayer.cpp:157
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:550
MythPlayerCaptionsUI::ChangeTrack
void ChangeTrack(uint Type, int Direction)
Definition: mythplayercaptionsui.cpp:375
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
kDisplayCC708
@ kDisplayCC708
Definition: videoouttypes.h:17
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:146
MythPlayer::m_decoder
DecoderBase * m_decoder
Definition: mythplayer.h:366
MythPlayerCaptionsUI::EnableSubtitles
void EnableSubtitles(bool Enable)
kDisplayNUVTeletextCaptions
@ kDisplayNUVTeletextCaptions
Definition: videoouttypes.h:13
DecoderBase::GetTrackInfo
StreamInfo GetTrackInfo(uint Type, uint TrackNo)
Definition: decoderbase.cpp:983
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:137
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:52
MythPlayerCaptionsUI::SetAudioByComponentTag
bool SetAudioByComponentTag(int Tag)
Selects the audio stream using the DVB component tag.
Definition: mythplayercaptionsui.cpp:587
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:120
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:566
kTrackTypeTeletextCaptions
@ kTrackTypeTeletextCaptions
Definition: decoderbase.h:34
TVPlaybackState::HandleITVAction
void HandleITVAction(const QString &Action, bool &Handled)
MythPlayerCaptionsUI::ResetTeletext
void ResetTeletext()
Definition: mythplayercaptionsui.cpp:488
TVPlaybackState::RestartITV
void RestartITV(uint Chanid, uint Cardid, bool IsLiveTV)
MythPlayerCaptionsUI::GetTracks
QStringList GetTracks(uint Type)
Definition: mythplayercaptionsui.cpp:315
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:463
TVPlaybackState::SetCaptionsEnabled
void SetCaptionsEnabled(bool Enable, bool UpdateOSD=true)
MythPlayerOverlayUI::m_browsing
bool m_browsing
Definition: mythplayeroverlayui.h:51
kMythBufferMHEG
@ kMythBufferMHEG
Definition: mythmediabuffer.h:47
MythPlayer::m_playerCtx
PlayerContext * m_playerCtx
Definition: mythplayer.h:374
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:496
MythPlayerCaptionsUI::SetStreamPos
void SetStreamPos(std::chrono::milliseconds Position)
Definition: mythplayercaptionsui.cpp:649
MythPlayerCaptionsUI::SetCaptionsEnabled
void SetCaptionsEnabled(bool Enable, bool UpdateOSD=true)
Definition: mythplayercaptionsui.cpp:282
kDisplayRawTextSubtitle
@ kDisplayRawTextSubtitle
Definition: videoouttypes.h:20
MythPlayer::m_disableForcedSubtitles
bool m_disableForcedSubtitles
Definition: mythplayer.h:472
kTrackTypeAudio
@ kTrackTypeAudio
Definition: decoderbase.h:29
MythPlayerCaptionsUI::SafeFPS
double SafeFPS()
Definition: mythplayercaptionsui.cpp:607
kTrackTypeCC708
@ kTrackTypeCC708
Definition: decoderbase.h:33
kNoITV
@ kNoITV
Definition: mythplayer.h:76
MythPlayer::RequestResetCaptions
void RequestResetCaptions()
MythPlayerCaptionsUI::EnableTeletext
void EnableTeletext(int Page=0x100)
Definition: mythplayercaptionsui.cpp:463
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:119
kDisplayAllTextCaptions
@ kDisplayAllTextCaptions
Definition: videoouttypes.h:23
MythPlayer::m_vbiMode
uint m_vbiMode
VBI decoder to use.
Definition: mythplayer.h:462
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)
TVPlaybackState::SetTrack
void SetTrack(uint Type, uint TrackNo)
MythPlayerCaptionsUI::ResetCaptions
void ResetCaptions()
Definition: mythplayercaptionsui.cpp:120
MythCoreContext::GetBoolSetting
bool GetBoolSetting(const QString &key, bool defaultval=false)
Definition: mythcorecontext.cpp:905
MythPlayerCaptionsUI::DoEnableForcedSubtitles
void DoEnableForcedSubtitles()
Definition: mythplayercaptionsui.cpp:357
MythPlayerCaptionsUI::GetStreamMaxPos
std::chrono::milliseconds GetStreamMaxPos()
Definition: mythplayercaptionsui.cpp:641
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:269
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:49
MythPlayerCaptionsUI::SetStream
void SetStream(const QString &Stream)
Definition: mythplayercaptionsui.cpp:616
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
kDisplayAllCaptions
@ kDisplayAllCaptions
Definition: videoouttypes.h:21
MythPlayerCaptionsUI::StreamPlay
void StreamPlay(bool Playing=true)
Definition: mythplayercaptionsui.cpp:657
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:349
kDisplayCC608
@ kDisplayCC608
Definition: videoouttypes.h:16
SubtitleReader::HasTextSubtitles
bool HasTextSubtitles(void)
Definition: subtitlereader.cpp:156
MythPlayer::m_totalLength
std::chrono::seconds m_totalLength
Definition: mythplayer.h:434
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:53
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:322
kTrackTypeRawText
@ kTrackTypeRawText
Definition: decoderbase.h:36
MythPlayerCaptionsUI::SetVideoByComponentTag
bool SetVideoByComponentTag(int Tag)
Selects the video stream using the DVB component tag.
Definition: mythplayercaptionsui.cpp:599
TVPlaybackState::CaptionsStateChanged
void CaptionsStateChanged(MythCaptionsState CaptionsState)
Definition: tvplaybackstate.cpp:33
MythPlayer::JumpToFrame
virtual bool JumpToFrame(uint64_t frame)
Definition: mythplayer.cpp:895
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)
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:252
MythCaptionsState::m_externalTextSubs
bool m_externalTextSubs
Definition: mythplayerstate.h:71
MythPlayerCaptionsUI::GetTrackCount
uint GetTrackCount(uint Type)
Definition: mythplayercaptionsui.cpp:322
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
kDisplayAVSubtitle
@ kDisplayAVSubtitle
Definition: videoouttypes.h:15
build_compdb.filename
filename
Definition: build_compdb.py:21
kDisplayTextSubtitle
@ kDisplayTextSubtitle
Definition: videoouttypes.h:18
LOC
#define LOC
Definition: mythplayercaptionsui.cpp:8
MythPlayerCaptionsUI::HasCaptionTrack
bool HasCaptionTrack(uint Mode)
Definition: mythplayercaptionsui.cpp:419
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:190
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:383
MythCaptionsOverlay::DisableForcedSubtitles
void DisableForcedSubtitles()
Definition: mythcaptionsoverlay.cpp:196
MythPlayerCaptionsUI::HandleTeletextAction
void HandleTeletextAction(const QString &Action, bool &Handled)
Definition: mythplayercaptionsui.cpp:510
TV
Control TV playback.
Definition: tv_play.h:154
kDisplayTeletextCaptions
@ kDisplayTeletextCaptions
Definition: videoouttypes.h:14