MythTV  master
mythplayercaptionsui.cpp
Go to the documentation of this file.
1 // MythTV
2 #include "livetvchain.h"
3 #include "tv_play.h"
4 #include "interactivetv.h"
6 #include "mythplayercaptionsui.h"
7 
8 #define LOC QString("PlayerCaptions: ")
9 
11  : MythPlayerAudioUI(MainWindow, Tv, Context, Flags),
12  m_captionsOverlay(MainWindow, Tv, nullptr, m_painter)
13 {
14  // Register state type for signalling
15  qRegisterMetaType<MythCaptionsState>();
16 
17  m_itvEnabled = gCoreContext->GetBoolSetting("EnableMHEG", false);
18 
19  // Connect outgoing
21 
22  // Inbound connections
42 
43  // Signalled connections (from MHIContext)
47 
48  // Signalled from the decoder
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 
148 void MythPlayerCaptionsUI::DisableCaptions(uint Mode, bool UpdateOSD)
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") : "";
166  if (kDisplayTeletextCaptions & Mode)
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) ||
176  (kDisplayAVSubtitle & Mode) || (kDisplayRawTextSubtitle & 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 
185  if (kDisplayTextSubtitle & Mode)
186  {
187  msg += tr("Text subtitles");
189  }
190 
191  if (!msg.isEmpty() && UpdateOSD)
192  {
193  msg += " " + tr("Off");
195  }
196 }
197 
198 void MythPlayerCaptionsUI::EnableCaptions(uint Mode, bool UpdateOSD)
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) ||
207  (kDisplayAVSubtitle & Mode) || kDisplayRawTextSubtitle & 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 
216  if (kDisplayTextSubtitle & Mode)
217  {
219  msg += tr("Text subtitles");
220  }
221 
222  if (kDisplayNUVTeletextCaptions & Mode)
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 QStringList();
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  if (!(Mode == kDisplayTextSubtitle) && m_decoder->GetTrackCount(toTrackType(Mode)))
426  return true;
427  return false;
428 }
429 
431 {
432  // Text->TextStream->708->608->AVSubs->Teletext->NUV->None
433  // NUV only offerred if PAL
434  bool pal = (m_vbiMode == VBIMode::PAL_TT);
435  uint nextmode = kDisplayNone;
436 
437  if (kDisplayTextSubtitle == Mode)
438  nextmode = kDisplayRawTextSubtitle;
439  else if (kDisplayRawTextSubtitle == Mode)
440  nextmode = kDisplayCC708;
441  else if (kDisplayCC708 == Mode)
442  nextmode = kDisplayCC608;
443  else if (kDisplayCC608 == Mode)
444  nextmode = kDisplayAVSubtitle;
445  else if (kDisplayAVSubtitle == Mode)
446  nextmode = kDisplayTeletextCaptions;
447  else if (kDisplayTeletextCaptions == Mode)
448  nextmode = pal ? kDisplayNUVTeletextCaptions : kDisplayNone;
449  else if ((kDisplayNUVTeletextCaptions == Mode) && pal)
450  nextmode = kDisplayNone;
451  else if (kDisplayNone == Mode)
452  nextmode = kDisplayTextSubtitle;
453 
454  if (nextmode == kDisplayNone || HasCaptionTrack(nextmode))
455  return nextmode;
456 
457  return NextCaptionTrack(nextmode);
458 }
459 
461 {
462  QMutexLocker locker(&m_osdLock);
463  auto oldcaptions = m_captionsState.m_textDisplayMode;
464  m_captionsOverlay.EnableTeletext(true, Page);
467  if (oldcaptions != m_captionsState.m_textDisplayMode)
469 }
470 
472 {
473  QMutexLocker locker(&m_osdLock);
475  auto oldcaptions = m_captionsState.m_textDisplayMode;
477  if (oldcaptions != m_captionsState.m_textDisplayMode)
479 
480  // If subtitles were enabled before the teletext menu was displayed then re-enable them
483 }
484 
486 {
487  QMutexLocker locker(&m_osdLock);
489 }
490 
494 {
495  m_osdLock.lock();
497  auto oldcaptions = m_captionsState.m_textDisplayMode;
498  m_ttPageNum = static_cast<int>(Page);
502  if (oldcaptions != m_captionsState.m_textDisplayMode)
504  m_osdLock.unlock();
505 }
506 
507 void MythPlayerCaptionsUI::HandleTeletextAction(const QString& Action, bool &Handled)
508 {
510  return;
511 
512  bool exit = false;
513  m_osdLock.lock();
514  Handled = m_captionsOverlay.TeletextAction(Action, exit);
515  m_osdLock.unlock();
516  if (exit)
517  DisableTeletext();
518 }
519 
521 {
522 #ifdef USING_MHEG
523  bool update = false;
524  {
525  QMutexLocker lock1(&m_osdLock);
526  QMutexLocker lock2(&m_itvLock);
528  {
529  m_interactiveTV = new InteractiveTV(this);
530  m_captionsState.m_haveITV = true;
531  update = true;
532  }
533  }
534  if (update)
536 #endif
537  return m_interactiveTV;
538 }
539 
547 void MythPlayerCaptionsUI::ITVHandleAction(const QString &Action, bool& Handled)
548 {
549 #ifdef USING_MHEG
550  if (!GetInteractiveTV())
551  {
552  Handled = false;
553  return;
554  }
555 
556  QMutexLocker locker(&m_itvLock);
557  Handled = m_interactiveTV->OfferKey(Action);
558 #else
559  Q_UNUSED(Action);
560  Q_UNUSED(Handled);
561 #endif
562 }
563 
565 void MythPlayerCaptionsUI::ITVRestart(uint Chanid, uint Cardid, bool IsLiveTV)
566 {
567 #ifdef USING_MHEG
568  if (!GetInteractiveTV())
569  return;
570 
571  QMutexLocker locker(&m_itvLock);
572  m_interactiveTV->Restart(static_cast<int>(Chanid), static_cast<int>(Cardid), IsLiveTV);
573  m_itvVisible = false;
574 #else
575  Q_UNUSED(Chanid);
576  Q_UNUSED(Cardid);
577  Q_UNUSED(IsLiveTV);
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 }
kTrackTypeUnknown
@ kTrackTypeUnknown
Definition: decoderbase.h:28
MythPlayerCaptionsUI::NextCaptionTrack
uint NextCaptionTrack(uint Mode)
Definition: mythplayercaptionsui.cpp:430
MythPlayerCaptionsUI::GetInteractiveTV
InteractiveTV * GetInteractiveTV() override
Definition: mythplayercaptionsui.cpp:520
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:333
MythPlayer::m_enableForcedSubtitles
bool m_enableForcedSubtitles
Definition: mythplayer.h:464
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
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:616
MythPlayer::SetEof
void SetEof(EofState eof)
Definition: mythplayer.cpp:1061
SubtitleReader::TextSubtitlesUpdated
void TextSubtitlesUpdated()
MythCaptionsOverlay::EnableSubtitles
void EnableSubtitles(int Type, bool ForcedOnly=false)
Definition: mythcaptionsoverlay.cpp:187
MythPlayerCaptionsUI::SetAllowForcedSubtitles
void SetAllowForcedSubtitles(bool Allow)
Definition: mythplayercaptionsui.cpp:258
kDisplayTeletextMenu
@ kDisplayTeletextMenu
Definition: videoouttypes.h:22
MythPlayer::m_subReader
SubtitleReader m_subReader
Definition: mythplayer.h:459
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:469
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:466
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:428
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:203
MythPlayerCaptionsUI::m_itvLock
QMutex m_itvLock
Definition: mythplayercaptionsui.h:75
MythPlayerCaptionsUI::m_lastTextDisplayMode
uint m_lastTextDisplayMode
Definition: mythplayercaptionsui.h:72
arg
arg(title).arg(filename).arg(doDelete))
MythPlayerCaptionsUI::DisableTeletext
void DisableTeletext()
Definition: mythplayercaptionsui.cpp:471
MythCaptionsOverlay::InitSubtitles
SubtitleScreen * InitSubtitles()
Definition: mythcaptionsoverlay.cpp:158
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:470
MythPlayerCaptionsUI::GetStreamPos
std::chrono::milliseconds GetStreamPos()
Definition: mythplayercaptionsui.cpp:636
CC608Reader::SetTTPageNum
void SetTTPageNum(int page)
Definition: cc608reader.h:85
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
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:62
MythPlayer::Pause
bool Pause(void)
Definition: mythplayer.cpp:159
kOSDTimeout_None
@ kOSDTimeout_None
Definition: osd.h:59
TVPlaybackState::EnableCaptions
void EnableCaptions(uint Mode, bool UpdateOSD=true)
MythPlayerCaptionsUI::ITVHandleAction
void ITVHandleAction(const QString &Action, bool &Handled)
Submit Action to the interactiveTV object.
Definition: mythplayercaptionsui.cpp:547
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:108
MythPlayerOverlayUI::UpdateOSDMessage
void UpdateOSDMessage(const QString &Message)
Definition: mythplayeroverlayui.cpp:74
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:150
MythPlayer::GetFramesPlayed
uint64_t GetFramesPlayed(void) const
Definition: mythplayer.h:144
MythPlayer::m_decoder
DecoderBase * m_decoder
Definition: mythplayer.h:363
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:61
SubtitleReader::LoadExternalSubtitles
void LoadExternalSubtitles(const QString &subtitleFileName, bool isInProgress)
Definition: subtitlereader.cpp:93
TVPlaybackState::AdjustSubtitleZoom
void AdjustSubtitleZoom(int Delta)
TVPlaybackState::ChangeAllowForcedSubtitles
void ChangeAllowForcedSubtitles(bool Allow)
MythPlayerOverlayUI::ChangeOSDPositionUpdates
void ChangeOSDPositionUpdates(bool Enable)
Definition: mythplayeroverlayui.cpp:41
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:588
MythMediaBuffer::GetSubtitleFilename
QString GetSubtitleFilename(void) const
Definition: mythmediabuffer.cpp:1741
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:115
kOSDFunctionalType_SubtitleDelayAdjust
@ kOSDFunctionalType_SubtitleDelayAdjust
Definition: osd.h:53
MythCaptionsOverlay::TeletextAction
bool TeletextAction(const QString &Action, bool &Exit)
Definition: mythcaptionsoverlay.cpp:127
TVPlaybackState::SetTeletextPage
void SetTeletextPage(uint Page)
TVPlaybackState::ResetCaptions
void ResetCaptions()
MythPlayerCaptionsUI::ITVRestart
void ITVRestart(uint Chanid, uint Cardid, bool IsLiveTV)
Restart the MHEG/MHP engine.
Definition: mythplayercaptionsui.cpp:565
kTrackTypeTeletextCaptions
@ kTrackTypeTeletextCaptions
Definition: decoderbase.h:34
TVPlaybackState::HandleITVAction
void HandleITVAction(const QString &Action, bool &Handled)
MythPlayerCaptionsUI::ResetTeletext
void ResetTeletext()
Definition: mythplayercaptionsui.cpp:485
TVPlaybackState::RestartITV
void RestartITV(uint Chanid, uint Cardid, bool IsLiveTV)
MythPlayerCaptionsUI::GetTracks
QStringList GetTracks(uint Type)
Definition: mythplayercaptionsui.cpp:315
clamp
float clamp(float val, float minimum, float maximum)
Definition: mythmiscutil.h:59
MythCaptionsOverlay::TeletextReset
void TeletextReset()
Definition: mythcaptionsoverlay.cpp:138
filename
QString filename
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:637
MythPlayer::m_ttPageNum
int m_ttPageNum
VBI page to display when in PAL vbimode.
Definition: mythplayer.h:456
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:367
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:493
MythPlayerCaptionsUI::SetStreamPos
void SetStreamPos(std::chrono::milliseconds Position)
Definition: mythplayercaptionsui.cpp:650
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:465
kTrackTypeAudio
@ kTrackTypeAudio
Definition: decoderbase.h:29
MythPlayerCaptionsUI::SafeFPS
double SafeFPS()
Definition: mythplayercaptionsui.cpp:608
kTrackTypeCC708
@ kTrackTypeCC708
Definition: decoderbase.h:33
kNoITV
@ kNoITV
Definition: mythplayer.h:73
MythPlayer::RequestResetCaptions
void RequestResetCaptions()
MythPlayerCaptionsUI::EnableTeletext
void EnableTeletext(int Page=0x100)
Definition: mythplayercaptionsui.cpp:460
uint
unsigned int uint
Definition: compat.h:140
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
PlayerContext::m_tvchain
LiveTVChain * m_tvchain
Definition: playercontext.h:114
kDisplayAllTextCaptions
@ kDisplayAllTextCaptions
Definition: videoouttypes.h:23
MythPlayer::m_vbiMode
uint m_vbiMode
VBI decoder to use.
Definition: mythplayer.h:455
kTrackTypeSubtitle
@ kTrackTypeSubtitle
Definition: decoderbase.h:31
kOSDFunctionalType_SubtitleZoomAdjust
@ kOSDFunctionalType_SubtitleZoomAdjust
Definition: osd.h:52
MythPlayerCaptionsUI::DisableCaptions
virtual void DisableCaptions(uint Mode, bool UpdateOSD=true)
Definition: mythplayercaptionsui.cpp: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:926
MythPlayerCaptionsUI::DoEnableForcedSubtitles
void DoEnableForcedSubtitles()
Definition: mythplayercaptionsui.cpp:357
MythPlayerCaptionsUI::GetStreamMaxPos
std::chrono::milliseconds GetStreamMaxPos()
Definition: mythplayercaptionsui.cpp:642
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:148
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
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:658
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:102
MythPlayer::m_totalLength
std::chrono::seconds m_totalLength
Definition: mythplayer.h:427
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:48
TVPlaybackState::DisableCaptions
void DisableCaptions(uint Mode, bool UpdateOSD=true)
MythPlayerOverlayUI::UpdateOSDStatus
void UpdateOSDStatus(osdInfo &Info, int Type, enum OSDTimeout Timeout)
Definition: mythplayeroverlayui.cpp:99
TVPlaybackState::ChangeCaptionTrack
void ChangeCaptionTrack(int Direction)
MythPlayerCaptionsUI::CaptionsStateChanged
void CaptionsStateChanged(MythCaptionsState &CaptionsState)
interactivetv.h
kTrackTypeRawText
@ kTrackTypeRawText
Definition: decoderbase.h:36
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
MythPlayer::JumpToFrame
virtual bool JumpToFrame(uint64_t frame)
Definition: mythplayer.cpp:870
MythPlayerCaptionsUI::MythPlayerCaptionsUI
MythPlayerCaptionsUI(MythMainWindow *MainWindow, TV *Tv, PlayerContext *Context, PlayerFlags Flags)
Definition: mythplayercaptionsui.cpp:10
MythPlayer::m_decoderChangeLock
QMutex m_decoderChangeLock
Definition: mythplayer.h:364
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
kDisplayTextSubtitle
@ kDisplayTextSubtitle
Definition: videoouttypes.h:18
FlagIsSet
#define FlagIsSet(arg)
Definition: mythplayer.h:77
LOC
#define LOC
Definition: mythplayercaptionsui.cpp:8
MythPlayerCaptionsUI::HasCaptionTrack
bool HasCaptionTrack(uint Mode)
Definition: mythplayercaptionsui.cpp:419
kOSDTimeout_Med
@ kOSDTimeout_Med
Definition: osd.h:61
InteractiveTV::Restart
void Restart(int chanid, int sourceid, bool isLive)
Definition: interactivetv.cpp:35
MythMainWindow
Definition: mythmainwindow.h:35
MythPlayer::Play
bool Play(float speed=1.0, bool normal=true, bool unpauseaudio=true)
Definition: mythplayer.cpp:192
mythplayercaptionsui.h
DecoderBase::GetTrackLanguageIndex
virtual int GetTrackLanguageIndex(uint Type, uint TrackNo)
Definition: decoderbase.cpp:931
TVPlaybackState::ChangeTrack
void ChangeTrack(uint Type, int Direction)
MythMediaBuffer::GetType
MythBufferType GetType() const
Definition: mythmediabuffer.cpp:202
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:194
MythPlayerCaptionsUI::HandleTeletextAction
void HandleTeletextAction(const QString &Action, bool &Handled)
Definition: mythplayercaptionsui.cpp:507
TV
Control TV playback.
Definition: tv_play.h:151
MythPlayerOverlayUI::m_osdLock
QMutex m_osdLock
Definition: mythplayeroverlayui.h:46
kDisplayTeletextCaptions
@ kDisplayTeletextCaptions
Definition: videoouttypes.h:14