Go to the documentation of this file.
11 #include <QApplication>
12 #include <QDomDocument>
13 #include <QDomElement>
18 #include <QRegularExpression>
20 #include <QTimerEvent>
23 #include "libmythbase/mythconfig.h"
77 #define DEBUG_CHANNEL_PREFIX 0
78 #define DEBUG_ACTIONS 0
80 #define LOC QString("TV::%1(): ").arg(__func__)
90 query.
prepare(
"SELECT COUNT(cardid) FROM capturecard;");
92 count = query.
value(0).toInt();
94 LOG(VB_RECORD, LOG_INFO,
95 "ConfiguredTunerCards() = " + QString::number(count));
109 static QMutex s_lock;
110 static TV* s_tv =
nullptr;
111 QMutexLocker locker(&s_lock);
123 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Ref count error");
169 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Already have a player");
175 auto flags =
static_cast<PlayerFlags>(playerflags);
208 LOG(VB_GENERAL, LOG_ERR,
LOC +
"StartPlaying() Failed to start player");
213 MaxWait = (MaxWait <= 0ms) ? 20s : MaxWait;
214 #ifdef USING_VALGRIND
215 MaxWait = std::chrono::milliseconds::max();
216 #endif // USING_VALGRIND
225 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
226 QString(
"StartPlaying(): took %1 ms to start player.")
227 .arg(
t.elapsed().count()));
230 LOG(VB_GENERAL, LOG_ERR,
LOC +
"StartPlaying() Failed to start player");
262 LOG(VB_GENERAL, LOG_WARNING,
LOC +
"Already have a TV object.");
267 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"-- begin");
270 bool quitAll =
false;
271 bool showDialogs =
true;
272 bool playCompleted =
false;
274 bool startSysEventSent =
false;
275 bool startLivetvEventSent =
false;
288 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Failed initializing TV");
310 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"tv->Playback() -- begin");
315 else if (!startSysEventSent)
317 startSysEventSent =
true;
321 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"tv->Playback() -- end");
325 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"tv->LiveTV() -- begin");
326 if (!tv->
LiveTV(showDialogs, Selection))
331 else if (!startSysEventSent)
333 startSysEventSent =
true;
334 startLivetvEventSent =
true;
338 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"tv->LiveTV() -- end");
343 LOG(VB_GENERAL, LOG_ERR,
LOC +
"No tuners configured");
345 LOG(VB_GENERAL, LOG_ERR,
LOC +
"No tuners free for live tv");
356 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Entering main playback loop.");
358 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Exiting main playback loop.");
366 curProgram = nextProgram;
380 quitAll |= !playerError.isEmpty();
383 QCoreApplication::processEvents();
387 playCompleted =
true;
397 if (startSysEventSent)
405 list.push_back(allowrerecord ?
"1" :
"0");
406 MythEvent me(
"LOCAL_PBB_DELETE_RECORDINGS", list);
417 else if (startSysEventSent)
420 if (!playerError.isEmpty())
430 if (startLivetvEventSent)
433 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"-- end");
435 return playCompleted;
445 if (name ==
"playbackbox")
447 else if (name ==
"viewscheduled")
449 else if (name ==
"programguide")
451 else if (name ==
"programfinder")
453 else if (name ==
"scheduleeditor")
460 "Play Program"),
"P");
462 "Stop Program"),
"");
464 "Toggle recording status of current program"),
"R");
466 "Page the program guide back one day"),
"Home");
468 "Page the program guide forward one day"),
"End");
470 "Page the program guide left"),
",,<");
472 "Page the program guide right"),
">,.");
474 "Toggle the current channel as a favorite"),
"?");
476 "Reverse the channel order in the program guide"),
"");
478 "Show the Program Guide"),
"S");
480 "Show the Program Finder"),
"#");
482 "Show the Channel Search"),
"");
483 REG_KEY(
"TV Frontend",
"NEXTFAV", QT_TRANSLATE_NOOP(
"MythControls",
484 "Cycle through channel groups and all channels in the "
485 "program guide."),
"/");
486 REG_KEY(
"TV Frontend",
"CHANUPDATE", QT_TRANSLATE_NOOP(
"MythControls",
487 "Switch channels without exiting guide in Live TV mode."),
"X");
489 "Volume down"),
"[,{,F10,Volume Down");
491 "Volume up"),
"],},F11,Volume Up");
493 "Mute"),
"|,\\,F9,Volume Mute");
494 REG_KEY(
"TV Frontend",
"CYCLEAUDIOCHAN", QT_TRANSLATE_NOOP(
"MythControls",
495 "Cycle audio channels"),
"");
496 REG_KEY(
"TV Frontend",
"RANKINC", QT_TRANSLATE_NOOP(
"MythControls",
497 "Increase program or channel rank"),
"Right");
498 REG_KEY(
"TV Frontend",
"RANKDEC", QT_TRANSLATE_NOOP(
"MythControls",
499 "Decrease program or channel rank"),
"Left");
500 REG_KEY(
"TV Frontend",
"UPCOMING", QT_TRANSLATE_NOOP(
"MythControls",
501 "List upcoming episodes"),
"O");
503 "List scheduled upcoming episodes"),
"");
505 "List previously recorded episodes"),
"");
506 REG_KEY(
"TV Frontend",
"DETAILS", QT_TRANSLATE_NOOP(
"MythControls",
507 "Show details"),
"U");
508 REG_KEY(
"TV Frontend",
"VIEWINPUT", QT_TRANSLATE_NOOP(
"MythControls",
509 "Switch Recording Input view"),
"C");
510 REG_KEY(
"TV Frontend",
"CUSTOMEDIT", QT_TRANSLATE_NOOP(
"MythControls",
511 "Edit Custom Record Rule"),
"");
512 REG_KEY(
"TV Frontend",
"CHANGERECGROUP", QT_TRANSLATE_NOOP(
"MythControls",
513 "Change Recording Group"),
"");
514 REG_KEY(
"TV Frontend",
"CHANGEGROUPVIEW", QT_TRANSLATE_NOOP(
"MythControls",
515 "Change Group View"),
"");
517 "List recorded episodes"),
"");
537 if (selectKeys !=
"?")
540 togBkmKeys = selectKeys;
542 bkmKeys = selectKeys;
546 "Add Bookmark"), bkmKeys);
548 "Toggle Bookmark"), togBkmKeys);
549 REG_KEY(
"TV Playback",
"BACK", QT_TRANSLATE_NOOP(
"MythControls",
550 "Exit or return to DVD menu"),
"Esc");
552 "Playback Compact Menu"),
"Alt+M");
554 "Clear OSD"),
"Backspace");
556 "Pause"),
"P,Space");
558 "Fast Forward"),
"Right");
562 "Arbitrary Seek"),
"*");
564 "Seek to a position in seconds"),
"");
566 "Channel up"),
"Up");
568 "Channel down"),
"Down");
569 REG_KEY(
"TV Playback",
"NEXTFAV", QT_TRANSLATE_NOOP(
"MythControls",
570 "Switch to the next favorite channel"),
"/");
571 REG_KEY(
"TV Playback",
"PREVCHAN", QT_TRANSLATE_NOOP(
"MythControls",
572 "Switch to the previous channel"),
"H");
574 "Jump ahead"),
"PgDown");
576 "Jump back"),
"PgUp");
577 REG_KEY(
"TV Playback",
"INFOWITHCUTLIST", QT_TRANSLATE_NOOP(
"MythControls",
578 "Info utilizing cutlist"),
"");
580 "Jump to bookmark"),
"K");
581 REG_KEY(
"TV Playback",
"FFWDSTICKY", QT_TRANSLATE_NOOP(
"MythControls",
582 "Fast Forward (Sticky) or Forward one second while paused"),
">,.");
583 REG_KEY(
"TV Playback",
"RWNDSTICKY", QT_TRANSLATE_NOOP(
"MythControls",
584 "Rewind (Sticky) or Rewind one second while paused"),
",,<");
585 REG_KEY(
"TV Playback",
"NEXTSOURCE", QT_TRANSLATE_NOOP(
"MythControls",
586 "Next Video Source"),
"Y");
587 REG_KEY(
"TV Playback",
"PREVSOURCE", QT_TRANSLATE_NOOP(
"MythControls",
588 "Previous Video Source"),
"");
589 REG_KEY(
"TV Playback",
"NEXTINPUT", QT_TRANSLATE_NOOP(
"MythControls",
591 REG_KEY(
"TV Playback",
"NEXTCARD", QT_TRANSLATE_NOOP(
"MythControls",
593 REG_KEY(
"TV Playback",
"SKIPCOMMERCIAL", QT_TRANSLATE_NOOP(
"MythControls",
594 "Skip Commercial"),
"Z,End");
595 REG_KEY(
"TV Playback",
"SKIPCOMMBACK", QT_TRANSLATE_NOOP(
"MythControls",
596 "Skip Commercial (Reverse)"),
"Q,Home");
598 "Jump to the start of the recording."),
"Ctrl+B");
599 REG_KEY(
"TV Playback",
"TOGGLEBROWSE", QT_TRANSLATE_NOOP(
"MythControls",
600 "Toggle channel browse mode"),
"O");
602 "Toggle recording status of current program"),
"R");
604 "Toggle the current channel as a favorite"),
"?");
606 "Volume down"),
"[,{,F10,Volume Down");
608 "Volume up"),
"],},F11,Volume Up");
610 "Mute"),
"|,\\,F9,Volume Mute");
612 "Set the volume"),
"");
613 REG_KEY(
"TV Playback",
"CYCLEAUDIOCHAN", QT_TRANSLATE_NOOP(
"MythControls",
614 "Cycle audio channels"),
"");
616 "Toggle audio upmixer"),
"Ctrl+U");
618 QT_TRANSLATE_NOOP(
"MythControls",
"Move BottomLine off screen"),
"L");
620 QT_TRANSLATE_NOOP(
"MythControls",
"Save manual zoom for BottomLine"),
"");
621 REG_KEY(
"TV Playback",
"TOGGLEASPECT", QT_TRANSLATE_NOOP(
"MythControls",
622 "Toggle the video aspect ratio"),
"Ctrl+W");
623 REG_KEY(
"TV Playback",
"TOGGLEFILL", QT_TRANSLATE_NOOP(
"MythControls",
624 "Next Preconfigured Zoom mode"),
"W");
626 "Toggle any captions"),
"T");
628 "Enable any captions"),
"");
630 "Disable any captions"),
"");
631 REG_KEY(
"TV Playback",
"TOGGLETTC", QT_TRANSLATE_NOOP(
"MythControls",
632 "Toggle Teletext Captions"),
"");
633 REG_KEY(
"TV Playback",
"TOGGLESUBTITLE", QT_TRANSLATE_NOOP(
"MythControls",
634 "Toggle Subtitles"),
"");
635 REG_KEY(
"TV Playback",
"TOGGLECC608", QT_TRANSLATE_NOOP(
"MythControls",
636 "Toggle VBI CC"),
"");
637 REG_KEY(
"TV Playback",
"TOGGLECC708", QT_TRANSLATE_NOOP(
"MythControls",
638 "Toggle ATSC CC"),
"");
639 REG_KEY(
"TV Playback",
"TOGGLETTM", QT_TRANSLATE_NOOP(
"MythControls",
640 "Toggle Teletext Menu"),
"");
642 "Toggle External Subtitles"),
"");
644 "Enable External Subtitles"),
"");
646 "Disable External Subtitles"),
"");
647 REG_KEY(
"TV Playback",
"TOGGLERAWTEXT", QT_TRANSLATE_NOOP(
"MythControls",
648 "Toggle Text Subtitles"),
"");
650 REG_KEY(
"TV Playback",
"SELECTAUDIO_0", QT_TRANSLATE_NOOP(
"MythControls",
651 "Play audio track 1"),
"");
652 REG_KEY(
"TV Playback",
"SELECTAUDIO_1", QT_TRANSLATE_NOOP(
"MythControls",
653 "Play audio track 2"),
"");
654 REG_KEY(
"TV Playback",
"SELECTSUBTITLE_0",QT_TRANSLATE_NOOP(
"MythControls",
655 "Display subtitle 1"),
"");
656 REG_KEY(
"TV Playback",
"SELECTSUBTITLE_1",QT_TRANSLATE_NOOP(
"MythControls",
657 "Display subtitle 2"),
"");
658 REG_KEY(
"TV Playback",
"SELECTRAWTEXT_0",QT_TRANSLATE_NOOP(
"MythControls",
659 "Display Text Subtitle 1"),
"");
660 REG_KEY(
"TV Playback",
"SELECTCC608_0", QT_TRANSLATE_NOOP(
"MythControls",
661 "Display VBI CC1"),
"");
662 REG_KEY(
"TV Playback",
"SELECTCC608_1", QT_TRANSLATE_NOOP(
"MythControls",
663 "Display VBI CC2"),
"");
664 REG_KEY(
"TV Playback",
"SELECTCC608_2", QT_TRANSLATE_NOOP(
"MythControls",
665 "Display VBI CC3"),
"");
666 REG_KEY(
"TV Playback",
"SELECTCC608_3", QT_TRANSLATE_NOOP(
"MythControls",
667 "Display VBI CC4"),
"");
668 REG_KEY(
"TV Playback",
"SELECTCC708_0", QT_TRANSLATE_NOOP(
"MythControls",
669 "Display ATSC CC1"),
"");
670 REG_KEY(
"TV Playback",
"SELECTCC708_1", QT_TRANSLATE_NOOP(
"MythControls",
671 "Display ATSC CC2"),
"");
672 REG_KEY(
"TV Playback",
"SELECTCC708_2", QT_TRANSLATE_NOOP(
"MythControls",
673 "Display ATSC CC3"),
"");
674 REG_KEY(
"TV Playback",
"SELECTCC708_3", QT_TRANSLATE_NOOP(
"MythControls",
675 "Display ATSC CC4"),
"");
677 "Enable Forced Subtitles"),
"");
679 "Disable Forced Subtitles"),
"");
681 REG_KEY(
"TV Playback",
"NEXTAUDIO", QT_TRANSLATE_NOOP(
"MythControls",
682 "Next audio track"),
"+");
683 REG_KEY(
"TV Playback",
"PREVAUDIO", QT_TRANSLATE_NOOP(
"MythControls",
684 "Previous audio track"),
"-");
685 REG_KEY(
"TV Playback",
"NEXTSUBTITLE", QT_TRANSLATE_NOOP(
"MythControls",
686 "Next subtitle track"),
"");
687 REG_KEY(
"TV Playback",
"PREVSUBTITLE", QT_TRANSLATE_NOOP(
"MythControls",
688 "Previous subtitle track"),
"");
689 REG_KEY(
"TV Playback",
"NEXTRAWTEXT", QT_TRANSLATE_NOOP(
"MythControls",
690 "Next Text track"),
"");
691 REG_KEY(
"TV Playback",
"PREVRAWTEXT", QT_TRANSLATE_NOOP(
"MythControls",
692 "Previous Text track"),
"");
693 REG_KEY(
"TV Playback",
"NEXTCC608", QT_TRANSLATE_NOOP(
"MythControls",
694 "Next VBI CC track"),
"");
695 REG_KEY(
"TV Playback",
"PREVCC608", QT_TRANSLATE_NOOP(
"MythControls",
696 "Previous VBI CC track"),
"");
697 REG_KEY(
"TV Playback",
"NEXTCC708", QT_TRANSLATE_NOOP(
"MythControls",
698 "Next ATSC CC track"),
"");
699 REG_KEY(
"TV Playback",
"PREVCC708", QT_TRANSLATE_NOOP(
"MythControls",
700 "Previous ATSC CC track"),
"");
701 REG_KEY(
"TV Playback",
"NEXTCC", QT_TRANSLATE_NOOP(
"MythControls",
702 "Next of any captions"),
"");
704 REG_KEY(
"TV Playback",
"NEXTSCAN", QT_TRANSLATE_NOOP(
"MythControls",
705 "Next video scan overidemode"),
"");
706 REG_KEY(
"TV Playback",
"QUEUETRANSCODE", QT_TRANSLATE_NOOP(
"MythControls",
707 "Queue the current recording for transcoding"),
"X");
708 REG_KEY(
"TV Playback",
"SPEEDINC", QT_TRANSLATE_NOOP(
"MythControls",
709 "Increase the playback speed"),
"U");
710 REG_KEY(
"TV Playback",
"SPEEDDEC", QT_TRANSLATE_NOOP(
"MythControls",
711 "Decrease the playback speed"),
"J");
712 REG_KEY(
"TV Playback",
"ADJUSTSTRETCH", QT_TRANSLATE_NOOP(
"MythControls",
713 "Turn on time stretch control"),
"A");
714 REG_KEY(
"TV Playback",
"STRETCHINC", QT_TRANSLATE_NOOP(
"MythControls",
715 "Increase time stretch speed"),
"");
716 REG_KEY(
"TV Playback",
"STRETCHDEC", QT_TRANSLATE_NOOP(
"MythControls",
717 "Decrease time stretch speed"),
"");
718 REG_KEY(
"TV Playback",
"TOGGLESTRETCH", QT_TRANSLATE_NOOP(
"MythControls",
719 "Toggle time stretch speed"),
"");
721 QT_TRANSLATE_NOOP(
"MythControls",
722 "Turn on audio sync adjustment controls"),
"");
724 QT_TRANSLATE_NOOP(
"MythControls",
725 "Set the audio sync adjustment"),
"");
726 REG_KEY(
"TV Playback",
"TOGGLEPICCONTROLS",
727 QT_TRANSLATE_NOOP(
"MythControls",
"Playback picture adjustments"),
730 QT_TRANSLATE_NOOP(
"MythControls",
"Set the picture brightness"),
"");
732 QT_TRANSLATE_NOOP(
"MythControls",
"Set the picture contrast"),
"");
734 QT_TRANSLATE_NOOP(
"MythControls",
"Set the picture color"),
"");
736 QT_TRANSLATE_NOOP(
"MythControls",
"Set the picture hue"),
"");
738 QT_TRANSLATE_NOOP(
"MythControls",
"Recording picture adjustments "
739 "for this channel"),
"Ctrl+G");
741 QT_TRANSLATE_NOOP(
"MythControls",
"Recording picture adjustments "
742 "for this recorder"),
"G");
743 REG_KEY(
"TV Playback",
"CYCLECOMMSKIPMODE",
744 QT_TRANSLATE_NOOP(
"MythControls",
"Cycle Commercial Skip mode"),
747 "Show the Program Guide"),
"S");
749 "Show the Program Finder"),
"#");
751 "Toggle the Sleep Timer"),
"F8");
755 "Jump to previously played recording"),
"");
757 "Display menu of recorded programs to jump to"),
"");
759 "Display scheduled recording list"),
"");
761 "Display previously recorded episodes"),
"");
763 "Monitor Signal Quality"),
"Alt+F7");
765 QT_TRANSLATE_NOOP(
"MythControls",
"Jump to the DVD Root Menu"),
"");
767 QT_TRANSLATE_NOOP(
"MythControls",
"Jump to the Popup Menu"),
"");
769 QT_TRANSLATE_NOOP(
"MythControls",
"Jump to the DVD Chapter Menu"),
"");
771 QT_TRANSLATE_NOOP(
"MythControls",
"Jump to the DVD Title Menu"),
"");
773 QT_TRANSLATE_NOOP(
"MythControls",
"Exit Show without any prompts"),
776 "Jump to a chapter"),
"");
778 "Switch title"),
"");
780 "Switch angle"),
"");
782 "OSD Navigation"),
"");
784 "Zoom mode - shift up"),
"");
786 "Zoom mode - shift down"),
"");
788 "Zoom mode - shift left"),
"");
790 "Zoom mode - shift right"),
"");
792 QT_TRANSLATE_NOOP(
"MythControls",
793 "Zoom mode - increase aspect ratio"),
"3");
795 QT_TRANSLATE_NOOP(
"MythControls",
796 "Zoom mode - decrease aspect ratio"),
"7");
798 "Zoom mode - zoom in"),
"9");
800 "Zoom mode - zoom out"),
"1");
802 QT_TRANSLATE_NOOP(
"MythControls",
803 "Zoom mode - vertical zoom in"),
"8");
805 QT_TRANSLATE_NOOP(
"MythControls",
806 "Zoom mode - vertical zoom out"),
"2");
808 QT_TRANSLATE_NOOP(
"MythControls",
809 "Zoom mode - horizontal zoom in"),
"6");
811 QT_TRANSLATE_NOOP(
"MythControls",
812 "Zoom mode - horizontal zoom out"),
"4");
814 "Zoom mode - quit and abandon changes"),
"");
816 "Zoom mode - commit changes"),
"");
822 "Menu Green"),
"F3");
824 "Menu Yellow"),
"F4");
836 "Clear editing cut points"),
"C,Q,Home");
838 "Invert Begin/End cut points"),
"I");
842 "Load cuts from detected commercials"),
"Z,End");
844 "Jump to the next cut point"),
"PgDown");
846 "Jump to the previous cut point"),
"PgUp");
848 "Jump back 10x the normal amount"),
",,<");
850 "Jump forward 10x the normal amount"),
">,.");
852 "Cut point editor compact menu"),
"Alt+M");
856 "Next Page"),
"Down");
858 "Previous Page"),
"Up");
860 "Next Subpage"),
"Right");
862 "Previous Subpage"),
"Left");
864 "Toggle Teletext"),
"T");
868 "Menu Green"),
"F3");
870 "Menu Yellow"),
"F4");
874 "Menu White"),
"F6");
876 QT_TRANSLATE_NOOP(
"MythControls",
"Toggle Background"),
"F7");
878 "Reveal hidden Text"),
"F8");
882 QT_TRANSLATE_NOOP(
"MythControls",
"Toggle audio visualisation"),
"");
886 QT_TRANSLATE_NOOP(
"MythControls",
"Toggle OSD playback information"),
"");
890 QT_TRANSLATE_NOOP(
"MythControls",
"Auto 3D"),
"");
892 QT_TRANSLATE_NOOP(
"MythControls",
"Ignore 3D"),
"");
894 QT_TRANSLATE_NOOP(
"MythControls",
"Discard 3D Side by Side"),
"");
896 QT_TRANSLATE_NOOP(
"MythControls",
"Discard 3D Top and Bottom"),
"");
950 { tr(
"Off",
"Sleep timer"), 0min },
951 { tr(
"30m",
"Sleep timer"), 30min },
952 { tr(
"1h",
"Sleep timer"), 60min },
953 { tr(
"1h30m",
"Sleep timer"), 90min },
954 { tr(
"2h",
"Sleep timer"), 120min }
971 m_mainWindow(MainWindow)
974 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Creating TV object");
976 QObject::setObjectName(
"TV");
993 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Finished creating TV object");
998 QMap<QString,QString> kv;
999 kv[
"LiveTVIdleTimeout"] =
"0";
1000 kv[
"BrowseMaxForward"] =
"240";
1001 kv[
"PlaybackExitPrompt"] =
"0";
1002 kv[
"AutomaticSetWatched"] =
"0";
1003 kv[
"EndOfRecordingExitPrompt"] =
"0";
1004 kv[
"JumpToProgramOSD"] =
"1";
1005 kv[
"GuiSizeForTV"] =
"0";
1006 kv[
"UseVideoModes"] =
"0";
1007 kv[
"JobsRunOnRecordHost"] =
"0";
1008 kv[
"ContinueEmbeddedTVPlay"] =
"0";
1009 kv[
"UseFixedWindowSize"] =
"1";
1010 kv[
"RunFrontendInWindow"] =
"0";
1011 kv[
"PersistentBrowseMode"] =
"0";
1012 kv[
"BrowseAllTuners"] =
"0";
1013 kv[
"ChannelOrdering"] =
"channum";
1015 kv[
"CustomFilters"] =
"";
1016 kv[
"ChannelFormat"] =
"<num> <sign>";
1018 kv[
"TryUnflaggedSkip"] =
"0";
1020 kv[
"ChannelGroupDefault"] =
"-1";
1021 kv[
"BrowseChannelGroup"] =
"0";
1022 kv[
"SmartForward"] =
"0";
1023 kv[
"FFRewReposTime"] =
"100";
1024 kv[
"FFRewReverse"] =
"1";
1026 kv[
"BrowseChannelGroup"] =
"0";
1027 kv[
"ChannelGroupDefault"] =
"-1";
1028 kv[
"ChannelGroupRememberLast"] =
"0";
1030 kv[
"VbiFormat"] =
"";
1031 kv[
"DecodeVBIFormat"] =
"";
1034 kv[
"PlaybackScreenPressKeyMap"] =
"P,Up,Z,],Left,Return,Return,Right,A,Down,Q,[";
1035 kv[
"LiveTVScreenPressKeyMap"] =
"P,Up,Z,S,Left,Return,Return,Right,A,Down,Q,F";
1037 constexpr std::array<const int,8> ff_rew_def { 3, 5, 10, 20, 30, 60, 120, 180 };
1038 for (
size_t i = 0; i < ff_rew_def.size(); i++)
1039 kv[QString(
"FFRewSpeed%1").arg(i)] = QString::number(ff_rew_def[i]);
1046 QString db_channel_ordering;
1048 m_dbIdleTimeout = std::chrono::minutes(kv[
"LiveTVIdleTimeout"].toUInt());
1049 auto db_browse_max_forward = std::chrono::minutes(kv[
"BrowseMaxForward"].toUInt());
1060 db_channel_ordering = kv[
"ChannelOrdering"];
1070 QString beVBI = kv[
"VbiFormat"];
1071 QString feVBI = kv[
"DecodeVBIFormat"];
1088 for (
size_t i = 0; i <
sizeof(ff_rew_def)/
sizeof(ff_rew_def[0]); i++)
1089 m_ffRewSpeeds.push_back(kv[QString(
"FFRewSpeed%1").arg(i)].toInt());
1106 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"-- begin");
1110 LOG(VB_GENERAL, LOG_ERR,
LOC +
"No MythMainWindow");
1131 fullscreen |= (0 == gui_width && 0 == gui_height);
1146 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Created TvPlayWindow.");
1157 QCoreApplication::processEvents();
1182 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"-- end");
1188 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"-- begin");
1209 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"-- lock");
1242 lcd->setFunctionLEDs(
FUNC_TV,
false);
1244 lcd->switchToTime();
1252 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"-- end");
1262 QCoreApplication::processEvents();
1338 .toUTC().toString(
"yyyy-MM-ddThh:mm:ssZ"));
1349 if (!info.
text[
"totalchapters"].isEmpty())
1351 QList<std::chrono::seconds> chapters;
1354 for (std::chrono::seconds chapter : std::as_const(chapters))
1355 var << QVariant((
long long)chapter.count());
1356 status.insert(
"chaptertimes", var);
1363 int currenttrack = -1;
1366 for (
int i = 0; i < list.size(); i++)
1368 if (i == currenttrack)
1369 status.insert(
"currentsubtitletrack", list[i]);
1370 tracks.insert(
"SELECTSUBTITLE_" + QString::number(i), list[i]);
1377 for (
int i = 0; i < list.size(); i++)
1379 if (i == currenttrack)
1380 status.insert(
"currentsubtitletrack", list[i]);
1381 tracks.insert(
"SELECTTTC_" + QString::number(i), list[i]);
1388 for (
int i = 0; i < list.size(); i++)
1390 if (i == currenttrack)
1391 status.insert(
"currentsubtitletrack", list[i]);
1392 tracks.insert(
"SELECTCC708_" + QString::number(i), list[i]);
1399 for (
int i = 0; i < list.size(); i++)
1401 if (i == currenttrack)
1402 status.insert(
"currentsubtitletrack", list[i]);
1403 tracks.insert(
"SELECTCC608_" + QString::number(i), list[i]);
1410 for (
int i = 0; i < list.size(); i++)
1412 if (i == currenttrack)
1413 status.insert(
"currentsubtitletrack", list[i]);
1414 tracks.insert(
"SELECTRAWTEXT_" + QString::number(i), list[i]);
1420 status.insert(
"currentsubtitletrack", tr(
"External Subtitles"));
1424 status.insert(
"totalsubtitletracks", tracks.size());
1425 if (!tracks.isEmpty())
1426 status.insert(
"subtitletracks", tracks);
1431 for (
int i = 0; i < list.size(); i++)
1433 if (i == currenttrack)
1434 status.insert(
"currentaudiotrack", list[i]);
1435 tracks.insert(
"SELECTAUDIO_" + QString::number(i), list[i]);
1438 status.insert(
"totalaudiotracks", tracks.size());
1439 if (!tracks.isEmpty())
1440 status.insert(
"audiotracks", tracks);
1464 for (
auto tit =info.
text.cbegin(); tit != info.
text.cend(); ++tit)
1465 status.insert(tit.key(), tit.value());
1467 QHashIterator<QString,int> vit(info.
values);
1468 while (vit.hasNext())
1471 status.insert(vit.key(), vit.value());
1499 LOG(VB_GENERAL, LOG_INFO, QString(
"Using Idle Timer. %1 minutes")
1521 else if (!Selection.empty())
1523 for (
const auto & ci : Selection)
1525 uint chanid = ci.m_chanId;
1526 QString channum = ci.m_chanNum;
1527 if (!chanid || channum.isEmpty())
1531 if (chanid && !channum.isEmpty() && !cards.isEmpty())
1569 if (!info->GetChanID())
1576 QString key = info->MakeUniqueKey();
1581 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
"AskAllowRecording -- " +
1582 QString(
"adding '%1'").arg(info->m_title));
1590 LOG(VB_GENERAL, LOG_INFO,
LOC +
"-- " +
1591 QString(
"removing '%1'").arg(info->GetTitle()));
1595 delete (*it).m_info;
1612 QString single_rec = tr(
"MythTV wants to record \"%1\" on %2 in %d seconds. Do you want to:");
1614 QString record_watch = tr(
"Record and watch while it records");
1615 QString let_record1 = tr(
"Let it record and go back to the Main Menu");
1616 QString let_recordm = tr(
"Let them record and go back to the Main Menu");
1617 QString record_later1 = tr(
"Record it later, I want to watch TV");
1618 QString record_laterm = tr(
"Record them later, I want to watch TV");
1619 QString do_not_record1= tr(
"Don't let it record, I want to watch TV");
1620 QString do_not_recordm= tr(
"Don't let them record, I want to watch TV");
1627 if ((*it).m_expiry <= timeNow)
1630 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
"-- " +
1631 QString(
"removing '%1'").arg((*it).m_info->m_title));
1633 delete (*it).m_info;
1641 std::chrono::milliseconds timeuntil = 0ms;
1648 (*it).m_isInSameInputGroup = (*it).m_isConflicting =
true;
1653 bool busy_input_grps_loaded =
false;
1654 std::vector<uint> busy_input_grps;
1661 (*it).m_isInSameInputGroup =
1662 (cardid == (*it).m_info->GetInputID());
1664 if ((*it).m_isInSameInputGroup)
1668 if (!busy_input_grps_loaded)
1671 busy_input_grps_loaded =
true;
1674 std::vector<uint> input_grps =
1677 for (
uint grp : input_grps)
1679 if (
find(busy_input_grps.begin(), busy_input_grps.end(),
1680 grp) != busy_input_grps.end())
1682 (*it).m_isInSameInputGroup =
true;
1692 if (!(*it).m_isInSameInputGroup)
1693 (*it).m_isConflicting =
false;
1694 else if (cardid == (*it).m_info->GetInputID())
1695 (*it).m_isConflicting =
true;
1697 (*it).m_isConflicting =
true;
1699 (busy_input.
m_mplexId == (*it).m_info->QueryMplexID())) ||
1701 (busy_input.
m_chanId == (*it).m_info->GetChanID())))
1702 (*it).m_isConflicting =
false;
1704 (*it).m_isConflicting =
true;
1706 conflict_count += (*it).m_isConflicting ? 1 : 0;
1713 if (conflict_count == 0)
1715 LOG(VB_GENERAL, LOG_INFO,
LOC +
"The scheduler wants to make "
1716 "a non-conflicting recording.");
1720 else if (conflict_count == 1 && ((*it).m_info->GetInputID() == cardid))
1723 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
"UpdateOSDAskAllowDialog -- " +
1731 .replace(
"<num>", (*it).m_info->GetChanNum())
1732 .replace(
"<sign>", (*it).m_info->GetChannelSchedulingID())
1733 .replace(
"<name>", (*it).m_info->GetChannelName());
1735 message = single_rec.arg((*it).m_info->GetTitle(), channel);
1740 dialog.m_buttons.push_back({ record_watch,
"DIALOG_ASKALLOW_WATCH_0",
false, !((*it).m_hasRec)} );
1741 dialog.m_buttons.push_back({ let_record1,
"DIALOG_ASKALLOW_EXIT_0" });
1742 dialog.m_buttons.push_back({ ((*it).m_hasLater) ? record_later1 : do_not_record1,
1743 "DIALOG_ASKALLOW_CANCELRECORDING_0",
false, ((*it).m_hasRec) });
1748 if (conflict_count > 1)
1751 "MythTV wants to record these programs in %d seconds:");
1755 bool has_rec =
false;
1758 if (!(*it).m_isConflicting)
1761 QString title = (*it).m_info->GetTitle();
1762 if ((title.length() < 10) && !(*it).m_info->GetSubtitle().isEmpty())
1763 title +=
": " + (*it).m_info->GetSubtitle();
1764 if (title.length() > 20)
1765 title = title.left(17) +
"...";
1769 .replace(
"<num>", (*it).m_info->GetChanNum())
1770 .replace(
"<sign>", (*it).m_info->GetChannelSchedulingID())
1771 .replace(
"<name>", (*it).m_info->GetChannelName());
1773 if (conflict_count > 1)
1775 message += tr(
"\"%1\" on %2").arg(title, channel);
1780 message = single_rec.arg((*it).m_info->GetTitle(), channel);
1781 has_rec = (*it).m_hasRec;
1785 if (conflict_count > 1)
1788 message += tr(
"Do you want to:");
1791 bool all_have_later =
true;
1792 timeuntil = 9999999ms;
1795 if ((*it).m_isConflicting)
1797 all_have_later &= (*it).m_hasLater;
1799 timeuntil = std::clamp(
tmp, 0ms, timeuntil);
1802 timeuntil = (9999999ms == timeuntil) ? 0ms : timeuntil;
1804 if (conflict_count > 1)
1808 { let_recordm,
"DIALOG_ASKALLOW_EXIT_0",
false,
true },
1809 { all_have_later ? record_laterm : do_not_recordm,
"DIALOG_ASKALLOW_CANCELCONFLICTING_0" }
1816 { let_record1,
"DIALOG_ASKALLOW_EXIT_0",
false, !has_rec},
1817 { all_have_later ? record_later1 : do_not_record1,
"DIALOG_ASKALLOW_CANCELRECORDING_0",
false, has_rec}
1830 LOG(VB_GENERAL, LOG_ERR,
"allowrecordingbox : askAllowLock is locked");
1834 if (
Action ==
"CANCELRECORDING")
1839 else if (
Action ==
"CANCELCONFLICTING")
1843 if (pgm.m_isConflicting)
1847 else if (
Action ==
"WATCH")
1911 #define TRANSITION(ASTATE,BSTATE) ((ctxState == (ASTATE)) && (desiredNextState == (BSTATE)))
1913 #define SET_NEXT() do { nextState = desiredNextState; changed = true; } while(false)
1914 #define SET_LAST() do { nextState = ctxState; changed = true; } while(false)
1919 QByteArray msg_arr = msg.toLatin1();
1920 QString msg_i18n = TV::tr(msg_arr.constData());
1921 QByteArray msg_i18n_arr = msg_i18n.toLatin1();
1922 return (msg_arr == msg_i18n_arr) ? msg_i18n : msg;
1937 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Called after fatal error detected.");
1941 bool changed =
false;
1947 LOG(VB_GENERAL, LOG_WARNING,
LOC +
"Warning, called with no state to change to.");
1955 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Attempting to change from %1 to %2")
1960 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Attempting to set to an error state!");
1985 QString channum =
"";
1989 QStringList reclist;
1992 query.
prepare(
"SELECT channum FROM channel "
1993 "WHERE chanid = :CHANID");
1996 channum = query.
value(0).toString();
1998 channum = QString::number(chanid);
2001 QString::number(chanid));
2006 if (!reclist.empty())
2021 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
"Spawning LiveTV Recorder -- begin");
2023 if (chanid && !channum.isEmpty())
2028 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
"Spawning LiveTV Recorder -- end");
2032 LOG(VB_GENERAL, LOG_ERR,
LOC +
"LiveTV not successfully started");
2046 LOG(VB_GENERAL, LOG_INFO,
LOC +
2047 QString(
"playbackURL(%1) inputtype(%2)")
2052 playbackURL,
false,
true,
2066 LOG(VB_GENERAL, LOG_ERR,
LOC +
"LiveTV not successfully started");
2120 LOG(VB_GENERAL, LOG_ERR,
LOC +
2121 "Couldn't find recorder for in-progress recording");
2140 QString message =
"COMMFLAG_REQUEST ";
2155 TV::tr(
"TV Player" ),
2182 LOG(VB_GENERAL, LOG_ERR,
LOC + QString(
"Unknown state transition: %1 to %2")
2187 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Changing from %1 to %2")
2198 LOG(VB_GENERAL, LOG_INFO,
LOC +
"State is LiveTV");
2200 LOG(VB_GENERAL, LOG_INFO,
LOC +
"UpdateOSDInput done");
2202 LOG(VB_GENERAL, LOG_INFO,
LOC +
"UpdateLCD done");
2204 LOG(VB_GENERAL, LOG_INFO,
LOC +
"ITVRestart done");
2210 QString msg = tr(
"%1 Settings")
2263 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Main UI disabled.");
2266 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
" -- end");
2281 MaxWait = (MaxWait <= 0ms) ? 40s : MaxWait;
2284 bool recording =
false;
2288 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Invalid Remote Encoder");
2296 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Lost contact with backend");
2300 std::this_thread::sleep_for(5us);
2306 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Timed out waiting for recorder to start");
2310 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"Took %1 ms to start recorder.")
2311 .arg(
t.elapsed().count()));
2330 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"-- begin");
2344 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Stopping ring buffer");
2355 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"stopping recorder");
2360 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"-- end");
2365 const int timer_id =
Event->timerId();
2373 bool handled =
true;
2434 if (!netCmd.isEmpty())
2459 LOG(VB_PLAYBACK, LOG_ERR,
LOC +
"Last Program File does not exist");
2576 LOG(VB_GENERAL, LOG_WARNING,
LOC + QString(
"Unknown timer: %1").arg(timer_id));
2586 QString lcd_time_string;
2587 bool showProgress =
true;
2604 lcd_time_string = info.
text[
"playedtime"] +
" / " + info.
text[
"totaltime"];
2606 if (lcd_time_string.length() >
static_cast<int>(lcd->
getLCDWidth()))
2607 lcd_time_string.remove(
' ');
2637 int timer = startTimer(Interval);
2639 LOG(VB_GENERAL, LOG_ERR,
LOC + QString(
"Failed to start timer on line %1 of %2").arg(Line).arg(__FILE__));
2656 auto StateChange = [&]()
2674 QTimer::singleShot(0,
this, StateChange);
2679 auto InputChange = [&]()
2691 QTimer::singleShot(0,
this, InputChange);
2703 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Switching to program: %1")
2773 bool is_playing =
false;
2858 bool restartTimer =
false;
2864 restartTimer =
true;
2868 LOG(VB_CHANNEL, LOG_INFO,
"REC_PROGRAM -- channel change");
2934 if ((
Event->type() == QEvent::Resize))
2940 if ( (QEvent::KeyPress ==
Event->type() || QEvent::KeyRelease ==
Event->type())
2942 return TVPlaybackState::eventFilter(Object,
Event);
2944 QScopedPointer<QEvent> sNewEvent(
nullptr);
2948 if (QEvent::KeyPress ==
Event->type())
2963 switch (
Event->type())
2966 case QEvent::UpdateRequest:
2970 return TVPlaybackState::eventFilter(Object,
Event);
2973 return TVPlaybackState::eventFilter(Object,
Event);
2980 if (
Event ==
nullptr)
2981 return TVPlaybackState::event(
Event);
2983 if (QEvent::Resize ==
Event->type())
2988 const auto *qre =
dynamic_cast<const QResizeEvent*
>(
Event);
2991 return TVPlaybackState::event(
Event);
3000 if (QEvent::KeyPress ==
Event->type())
3002 const auto * ke =
dynamic_cast<QKeyEvent*
>(
Event);
3005 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"keypress: %1 '%2'")
3006 .arg(ke->key()).arg(ke->text()));
3014 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"mythgesture: g:%1 pos:%2,%3 b:%4")
3015 .arg(ge->GetGesture()).arg(ge->GetPosition().x())
3016 .arg(ge->GetPosition().y()).arg(ge->GetButton()));
3020 bool handled =
false;
3029 switch (
Event->type())
3032 case QEvent::UpdateRequest:
3042 return QObject::event(
Event);
3047 bool handled =
true;
3102 else if (
Action.startsWith(
"TOGGLE"))
3112 else if (
Action.startsWith(
"SELECT"))
3121 else if (
Action.startsWith(
"NEXT") ||
Action.startsWith(
"PREV"))
3123 int dir = (
Action.startsWith(
"NEXT")) ? +1 : -1;
3127 else if (
Action.endsWith(
"CC"))
3150 QStringList::const_iterator it;
3151 for (it = actions.begin(); it != actions.end(); ++it)
3153 if ((*it).startsWith(
"SYSEVENT") ||
3166 QList<QKeyEvent*> keyPressList;
3168 QStringList stringKeyList = KeyList.split(
',');
3169 for (
const auto & str : std::as_const(stringKeyList))
3171 QKeySequence keySequence(str);
3172 for (i = 0; i < keySequence.count(); i++)
3174 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
3175 int keynum = keySequence[i];
3176 int keyCode = keynum & ~Qt::KeyboardModifierMask;
3177 auto modifiers =
static_cast<Qt::KeyboardModifiers
>(keynum & Qt::KeyboardModifierMask);
3179 int keyCode = keySequence[i].key();
3180 Qt::KeyboardModifiers modifiers = keySequence[i].keyboardModifiers();
3182 auto * keyEvent =
new QKeyEvent(QEvent::None, keyCode, modifiers);
3183 keyPressList.append(keyEvent);
3191 auto * keyEvent =
new QKeyEvent(QEvent::None, Qt::Key_Escape, Qt::NoModifier);
3192 keyPressList.append(keyEvent);
3195 return keyPressList;
3199 QStringList &Actions,
bool IsLiveTV)
3201 if (
Event && Context ==
"TV Playback")
3208 (
Event->GetButton() == Qt::LeftButton))
3212 QPoint pos =
Event->GetPosition();
3214 const int widthDivider = 4;
3215 int w4 = size.width() / widthDivider;
3216 region = pos.x() / w4;
3217 int h3 = size.height() / 3;
3218 region += (pos.y() / h3) * widthDivider;
3230 QStringList &Actions,
bool IsLiveTV,
bool AllowJumps)
3234 if (QEvent::KeyPress ==
Event->type())
3244 if (
Event ==
nullptr)
3250 LOG(VB_GENERAL, LOG_DEBUG,
LOC + QString(
"ignoreKeys: %1").arg(ignoreKeys));
3261 auto* eKeyEvent =
dynamic_cast<QKeyEvent*
>(
Event);
3263 if (eKeyEvent->key() <= 0)
3266 switch(eKeyEvent->nativeScanCode())
3269 keycode = Qt::Key_MediaPause;
3277 auto *key =
new QKeyEvent(QEvent::KeyPress, keycode, eKeyEvent->modifiers());
3278 QCoreApplication::postEvent(
this, key);
3284 QStringList actions;
3285 bool handled =
false;
3286 bool alreadyTranslatedPlayback =
false;
3294 alreadyTranslatedPlayback =
true;
3296 if (handled || actions.isEmpty())
3299 bool esc =
IsActionable({
"ESCAPE",
"BACK" }, actions);
3310 if (QEvent::KeyPress ==
Event->type())
3312 auto *qke =
dynamic_cast<QKeyEvent*
>(
Event);
3370 if (QEvent::KeyPress ==
Event->type())
3372 auto *qke =
dynamic_cast<QKeyEvent*
>(
Event);
3375 const QString txt = qke->text();
3379 (void)txt.toInt(&ok, 16);
3380 if (ok || txt==
"_" || txt==
"-" || txt==
"#" || txt==
".")
3391 QStringList tt_actions;
3394 if (!handled && !tt_actions.isEmpty())
3396 for (
const QString&
action : std::as_const(tt_actions))
3408 if (!alreadyTranslatedPlayback)
3411 alreadyTranslatedPlayback =
true;
3414 if (!handled && !actions.isEmpty())
3416 for (
const QString&
action : std::as_const(actions))
3425 if (!alreadyTranslatedPlayback)
3428 if (handled || actions.isEmpty())
3436 if (QEvent::KeyPress ==
Event->type())
3452 for (
int i = 0; i < actions.size(); ++i)
3453 LOG(VB_GENERAL, LOG_DEBUG,
LOC + QString(
"handled(%1) actions[%2](%3)")
3454 .arg(handled).arg(i).arg(actions[i]));
3455 #endif // DEBUG_ACTIONS
3462 for (
int i = 0; i < actions.size() && !handled; i++)
3464 QString
action = actions[i];
3466 int val =
action.toInt(&ok);
3484 bool handled =
true;
3505 for (
const auto&
action : std::as_const(Actions))
3516 static const QStringList passthrough =
3519 ACTION_MUTEAUDIO,
"CYCLEAUDIOCHAN",
"BOTTOMLINEMOVE",
"BOTTOMLINESAVE",
"TOGGLEASPECT"
3529 bool endmanualzoom =
false;
3530 bool handled =
true;
3531 bool updateOSD =
true;
3560 endmanualzoom =
true;
3564 endmanualzoom =
true;
3571 static const QStringList passthrough =
3579 QString msg = tr(
"Zoom Committed");
3583 msg = endmanualzoom ? tr(
"Zoom Ignored") :
3588 else if (endmanualzoom)
3635 bool handled =
true;
3660 bool handled =
true;
3683 bool handled =
true;
3706 bool handled =
true;
3741 bool IsDVD,
bool IsDVDStillFrame)
3743 bool handled =
true;
3747 else if (
IsActionable(
"SKIPCOMMBACK", Actions) && !IsDVD)
3749 else if (
IsActionable(
"QUEUETRANSCODE", Actions) && !IsDVD)
3751 else if (
IsActionable(
"QUEUETRANSCODE_AUTO", Actions) && !IsDVD)
3753 else if (
IsActionable(
"QUEUETRANSCODE_HIGH", Actions) && !IsDVD)
3755 else if (
IsActionable(
"QUEUETRANSCODE_MEDIUM", Actions) && !IsDVD)
3757 else if (
IsActionable(
"QUEUETRANSCODE_LOW", Actions) && !IsDVD)
3763 else if (
IsActionable(
"SPEEDINC", Actions) && !IsDVDStillFrame)
3765 else if (
IsActionable(
"SPEEDDEC", Actions) && !IsDVDStillFrame)
3769 else if (
IsActionable(
"CYCLECOMMSKIPMODE",Actions) && !IsDVD)
3825 DoSeek(0, tr(
"Jump to Beginning"),
false,
true);
3849 std::chrono::milliseconds rate =
m_sigMonMode ? 0ms : 100ms;
3884 bool visible =
false;
3954 else if (
IsActionable({
"INFO",
"INFOWITHCUTLIST" }, Actions))
3973 for (
auto it = Actions.cbegin(); it != Actions.cend() && !handled; ++it)
3982 bool handled =
false;
3986 for (
int i = 0; i < Actions.size() && !handled; i++)
3988 const QString&
action = Actions[i];
3990 int val =
action.toInt(&ok);
4019 bool handled =
true;
4098 info.
text[
"title"] = tr(
"Position");
4106 bool handled =
true;
4126 else if (
IsActionable(
"NEXTSOURCE", Actions) && islivetv)
4128 else if (
IsActionable(
"PREVSOURCE", Actions) && islivetv)
4130 else if (
IsActionable(
"NEXTINPUT", Actions) && islivetv)
4134 else if (
IsActionable(
"PREVCHAN", Actions) && islivetv)
4188 #ifdef DEBUG_ACTIONS
4189 LOG(VB_GENERAL, LOG_DEBUG,
LOC + QString(
"(%1) ignoreKeys: %2").arg(
Command).arg(ignoreKeys));
4194 LOG(VB_GENERAL, LOG_WARNING,
LOC +
"Ignoring network control command because ignoreKeys is set");
4198 QStringList tokens =
Command.split(
" ", Qt::SkipEmptyParts);
4199 if (tokens.size() < 2)
4201 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Not enough tokens in network control command " + QString(
"'%1'").arg(
Command));
4213 LOG(VB_GENERAL, LOG_WARNING,
LOC +
4214 "Ignoring network control command\n\t\t\t" +
4215 QString(
"because dialog is waiting for a response"));
4219 if (tokens[1] !=
"QUERY")
4222 if (tokens.size() == 3 && tokens[1] ==
"CHANID")
4228 else if (tokens.size() == 3 && tokens[1] ==
"CHANNEL")
4232 static const QRegularExpression kChannelNumRE { R
"(^[-\.\d_#]+$)" };
4233 if (tokens[2] ==
"UP")
4235 else if (tokens[2] ==
"DOWN")
4237 else if (tokens[2].contains(kChannelNumRE))
4241 else if (tokens.size() == 3 && tokens[1] ==
"SPEED")
4245 if (tokens[2] ==
"0x")
4252 else if (tokens[2] ==
"normal")
4262 static const QRegularExpression kSpeedRE { R
"(^\-*(\d*\.)?\d+x$)" };
4263 float tmpSpeed = 1.0F;
4266 if (tokens[2].contains(kSpeedRE))
4268 QString speed = tokens[2].left(tokens[2].length()-1);
4269 tmpSpeed = speed.toFloat(&ok);
4273 static const QRegularExpression re { R
"(^(\-*\d+)\/(\d+)x$)" };
4274 auto match = re.match(tokens[2]);
4275 if (match.hasMatch())
4277 QStringList matches = match.capturedTexts();
4278 int numerator = matches[1].toInt(&ok);
4279 int denominator = matches[2].toInt(&ok);
4281 if (ok && denominator != 0)
4282 tmpSpeed =
static_cast<float>(numerator) /
static_cast<float>(denominator);
4290 float searchSpeed = fabs(tmpSpeed);
4295 if (tmpSpeed == 0.0F)
4303 else if (tmpSpeed == 1.0F)
4322 else if (tmpSpeed > 1)
4330 else if (0.125F <= tmpSpeed && tmpSpeed <= 2.0F)
4338 LOG(VB_GENERAL, LOG_WARNING, QString(
"Couldn't find %1 speed. Setting Speed to 1x")
4339 .arg(
static_cast<double>(searchSpeed)));
4346 LOG(VB_GENERAL, LOG_ERR, QString(
"Found an unknown speed of %1").arg(tokens[2]));
4350 else if (tokens.size() == 2 && tokens[1] ==
"STOP")
4357 static const QRegularExpression kDigitsRE {
"^\\d+$" };
4361 if (tokens[2] ==
"BEGINNING")
4363 DoSeek(0, tr(
"Jump to Beginning"),
false,
true);
4365 else if (tokens[2] ==
"FORWARD")
4369 else if (tokens[2] ==
"BACKWARD")
4373 else if ((tokens[2] ==
"POSITION" ||
4374 tokens[2] ==
"POSITIONWITHCUTLIST") &&
4375 (tokens.size() == 4) &&
4376 (tokens[3].contains(kDigitsRE)))
4378 DoSeekAbsolute(tokens[3].toInt(), tokens[2] ==
"POSITIONWITHCUTLIST");
4381 else if (tokens.size() >= 3 && tokens[1] ==
"SUBTITLES")
4384 uint track = tokens[2].toUInt(&ok);
4396 uint size =
static_cast<uint>(subs.size());
4399 if (track >=
start && track < finish)
4408 finish =
start + size;
4409 if (track >=
start && track < finish)
4418 finish =
start + size;
4419 if (track >=
start && track < finish)
4428 finish =
start + size;
4429 if (track >=
start && track < finish)
4438 finish =
start + size;
4439 if (track >=
start && track < finish)
4448 finish =
start + size;
4449 if (track >=
start && track < finish)
4457 else if (tokens.size() >= 3 && tokens[1] ==
"VOLUME")
4459 static const QRegularExpression re {
"(\\d+)%?" };
4460 auto match = re.match(tokens[2]);
4461 if (match.hasMatch())
4463 QStringList matches = match.capturedTexts();
4465 LOG(VB_GENERAL, LOG_INFO, QString(
"Set Volume to %1%").arg(matches[1]));
4468 int vol = matches[1].toInt(&ok);
4472 if (0 <= vol && vol <= 100)
4476 else if (tokens.size() >= 3 && tokens[1] ==
"QUERY")
4478 if (tokens[2] ==
"POSITION")
4493 static const QRegularExpression re {
"Play (.*)x" };
4495 if (match.hasMatch())
4497 QStringList matches = match.capturedTexts();
4498 speedStr = QString(
"%1x").arg(matches[1]);
4510 QString infoStr =
"";
4534 infoStr =
"Recorded";
4542 QString bufferFilename =
4544 if ((infoStr ==
"Recorded") || (infoStr ==
"LiveTV"))
4546 infoStr += QString(
" %1 %2 %3 %4 %5 %6 %7")
4547 .arg(info.
text[
"description"],
4552 QString::number(fplay),
4554 QString::number(rate));
4558 QString position = info.
text[
"description"].section(
" ",0,0);
4559 infoStr += QString(
" %1 %2 %3 %4 %5")
4563 QString::number(fplay),
4564 QString::number(rate));
4567 infoStr += QString(
" Subtitles:");
4572 infoStr += QString(
" *0:[None]*");
4574 infoStr += QString(
" 0:[None]");
4579 for (
int i = 0; i < subs.size(); i++)
4582 infoStr += QString(
" *%1:[%2]*").arg(n).arg(subs[i]);
4584 infoStr += QString(
" %1:[%2]").arg(n).arg(subs[i]);
4589 for (
int i = 0; i < subs.size(); i++)
4592 infoStr += QString(
" *%1:[%2]*").arg(n).arg(subs[i]);
4594 infoStr += QString(
" %1:[%2]").arg(n).arg(subs[i]);
4599 for (
int i = 0; i < subs.size(); i++)
4602 infoStr += QString(
" *%1:[%2]*").arg(n).arg(subs[i]);
4604 infoStr += QString(
" %1:[%2]").arg(n).arg(subs[i]);
4609 for (
int i = 0; i < subs.size(); i++)
4612 infoStr += QString(
" *%1:[%2]*").arg(n).arg(subs[i]);
4614 infoStr += QString(
" %1:[%2]").arg(n).arg(subs[i]);
4619 for (
int i = 0; i < subs.size(); i++)
4622 infoStr += QString(
" *%1:[%2]*").arg(n).arg(subs[i]);
4624 infoStr += QString(
" %1:[%2]").arg(n).arg(subs[i]);
4629 for (
int i = 0; i < subs.size(); i++)
4632 infoStr += QString(
" *%1:[%2]*").arg(n).arg(subs[i]);
4634 infoStr += QString(
" %1:[%2]").arg(n).arg(subs[i]);
4640 QString message = QString(
"NETWORK_CONTROL ANSWER %1").arg(infoStr);
4644 else if (tokens[2] ==
"VOLUME")
4647 QString message = QString(
"NETWORK_CONTROL ANSWER %1").arg(infoStr);
4656 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC + QString(
"(%1) -- begin").arg(
StateToString(desiredState)));
4663 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Created player."));
4668 LOG(VB_GENERAL, LOG_CRIT,
LOC + QString(
"Failed to create player."));
4671 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC + QString(
"(%1) -- end %2")
4777 bool paused =
false;
4799 bool ignore =
false;
4800 bool paused =
false;
4825 if (Time > -0.001F && Time < +0.001F)
4828 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"%1 seconds").arg(
static_cast<double>(Time)));
4849 else if (Time < 0.0F)
4861 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"%1").arg(FrameNum));
4887 const int kRewind = 4;
4888 const int kForward = 8;
4889 const int kSticky = 16;
4890 const int kSlippery = 32;
4891 const int kRelative = 64;
4892 const int kAbsolute = 128;
4893 const int kIgnoreCutlist = 256;
4894 const int kWhenceMask = 3;
4899 flags =
ARBSEEK_END | kForward | kSticky | kAbsolute;
4905 flags =
ARBSEEK_SET | kRewind | kSticky | kAbsolute;
4911 int direction = (flags & kRewind) ? -1 : 1;
4920 QString message = (flags & kRewind) ? tr(
"Rewind") :
4922 if (flags & kAbsolute)
4924 float time = direction;
4925 DoSeek(time, message,
true, (flags & kIgnoreCutlist) == 0);
4932 uint64_t targetRel = frameRel +
static_cast<uint64_t
>(direction);
4933 if (frameRel == 0 && direction < 0)
4937 if (targetRel > maxRel)
4946 else if (flags & kSticky)
4950 else if (flags & kRewind)
4970 void TV::DoSeek(
float Time,
const QString &Msg,
bool TimeIsOffset,
bool HonorCutlist)
4975 bool limitkeys =
false;
5015 DoSeek(Seconds, tr(
"Jump To"),
false, HonorCutlist);
5027 int64_t time = (int(seek / 100) * 3600) + ((seek % 100) * 60);
5031 DoSeek(time, tr(
"Jump Ahead"),
true, HonorCutlist);
5035 DoSeek(-time, tr(
"Jump Back"),
true, HonorCutlist);
5048 DoSeek(std::max(0.0F, dur -
static_cast<float>(time)), tr(
"Jump To"),
false, HonorCutlist);
5182 auto index =
static_cast<size_t>(Index);
5251 QString jobHost =
"";
5256 QString msg = tr(
"Try Again");
5263 msg = tr(
"Transcoding");
5273 int num_chapters = 0;
5278 return num_chapters;
5326 int currentTitle = 0;
5331 return currentTitle;
5346 int currentAngle = 0;
5351 return currentAngle;
5366 std::chrono::seconds seconds = 0s;
5429 info.
text[
"title"] = tr(
"Skip");
5430 info.
text[
"description"] = tr(
"Searching");
5442 QMap<uint,InputInfo> sources;
5447 uint sourceid = info[
"sourceid"].toUInt();
5450 for (
auto & input : inputs)
5453 if ((sources.find(input.m_sourceId) == sources.end()) ||
5454 ((cardid == input.m_inputId) && (cardid != sources[input.m_sourceId].m_inputId)))
5456 sources[input.m_sourceId] = input;
5461 QMap<uint,InputInfo>::const_iterator beg = sources.constFind(sourceid);
5462 QMap<uint,InputInfo>::const_iterator sit = beg;
5464 if (sit == sources.constEnd())
5470 if (sit == sources.constEnd())
5471 sit = sources.constBegin();
5476 if (sit != sources.constBegin())
5480 QMap<uint,InputInfo>::const_iterator
tmp = sources.constBegin();
5481 while (
tmp != sources.constEnd())
5508 QCoreApplication::processEvents();
5510 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"(%1,'%2',%3)").arg(ChanID).arg(ChanNum).arg(InputID));
5517 QStringList reclist;
5520 reclist.push_back(QString::number(InputID));
5522 else if (ChanID || !ChanNum.isEmpty())
5529 if (!reclist.empty())
5537 if (ChanID && ChanNum.isEmpty())
5540 if (!ChanNum.isEmpty())
5583 if (ChanNum.isEmpty() && ChanID)
5585 if (ChanNum.isEmpty() && InputID)
5591 LOG(VB_GENERAL, LOG_ERR,
LOC +
"LiveTV not successfully restarted");
5604 playbackURL,
false,
true,
5631 LOG(VB_GENERAL, LOG_ERR,
LOC +
"LiveTV not successfully started");
5645 LOG(VB_GENERAL, LOG_ERR,
LOC +
"No recorder to switch to...");
5659 LOG(VB_GENERAL, LOG_ERR,
"TV::ToggleChannelFavorite() -- currently disabled");
5727 bool commitSmart =
false;
5739 inputStr = inputStr.isEmpty() ?
"?" : inputStr;
5743 inputStr = entryStr +
" " + inputStr;
5747 inputStr = tr(
"Seek:",
"seek to location") +
" " + inputStr;
5757 static QString
add_spacer(
const QString &chan,
const QString &spacer)
5759 if ((chan.length() >= 2) && !spacer.isEmpty())
5760 return chan.left(chan.length()-1) + spacer + chan.right(1);
5772 int size =
static_cast<int>(chan.size());
5773 if ((size > 2) && (chan.at(size - 1) == chan.at(size - 2)))
5776 chan.right(1).toUInt(&ok);
5779 chan = chan.left(chan.length()-1);
5787 QString needed_spacer;
5788 uint pref_cardid = 0;
5789 bool is_not_complete =
true;
5791 bool valid_prefix =
false;
5795 chan, pref_cardid, is_not_complete, needed_spacer);
5798 #if DEBUG_CHANNEL_PREFIX
5799 LOG(VB_GENERAL, LOG_DEBUG, QString(
"valid_pref(%1) cardid(%2) chan(%3) "
5800 "pref_cardid(%4) complete(%5) sp(%6)")
5801 .arg(valid_prefix).arg(0).arg(chan)
5802 .arg(pref_cardid).arg(is_not_complete).arg(needed_spacer));
5810 else if (!needed_spacer.isEmpty())
5816 #if DEBUG_CHANNEL_PREFIX
5817 LOG(VB_GENERAL, LOG_DEBUG, QString(
" ValidPref(%1) CardId(%2) Chan(%3) "
5818 " PrefCardId(%4) Complete(%5) Sp(%6)")
5820 .arg(pref_cardid).arg(is_not_complete).arg(needed_spacer));
5827 return !is_not_complete;
5832 bool commited =
false;
5834 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
5835 QString(
"livetv(%1) qchannum(%2) qchanid(%3)")
5865 if (channum.isEmpty())
5888 uint old_chanid = 0;
5894 LOG(VB_GENERAL, LOG_ERR,
LOC +
5895 "no active ctx playingInfo.");
5957 uint cardid,
const QString &channum)
5960 uint cur_sourceid = 0;
5973 if (cur_sourceid != sourceid && sourceid)
5980 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"(%1, '%2')").arg(Chanid).arg(
Channum));
5986 QStringList reclist;
5987 QVector<uint> tunable_on;
5991 if (channum.isEmpty() && Chanid)
6012 QString needed_spacer;
6013 uint pref_cardid = 0;
6018 dummy, needed_spacer);
6020 LOG(VB_CHANNEL, LOG_INFO,
LOC +
6021 QString(
"CheckChannelPrefix(%1, pref_cardid %2, %3, '%4') "
6023 .arg(
Channum).arg(pref_cardid).arg(dummy).arg(needed_spacer)
6027 if (pref_cardid != cardid)
6036 getit = !tunable_on.contains(cardid);
6044 if (tunable_on.empty())
6050 for (
const auto& rec : std::as_const(
tmp))
6052 if ((Chanid == 0U) || tunable_on.contains(rec.toUInt()))
6053 reclist.push_back(rec);
6058 if (!reclist.empty())
6121 for (
const auto & option : Options)
6123 uint chanid = option.m_chanId;
6124 QString channum = option.m_chanNum;
6143 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"Previous channel number '%1'").arg(channum));
6144 if (channum.isEmpty())
6154 if (!ImmediateChange)
6160 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"'%1'->'%2'")
6161 .arg(cur_channum, prev_channum));
6164 if (cur_channum != prev_channum && !prev_channum.isEmpty())
6173 if (ImmediateChange)
6187 emit
HideAll(
true,
nullptr,
true);
6205 bool hideAll =
false;
6221 else if (is_prog_info_disp && !paused)
6225 else if (IncludeStatusOSD)
6243 info.
text[
"title"] = (paused ? tr(
"Paused") : tr(
"Position"));
6289 const QString& Value,
int Type,
const QString& Units,
6293 info.
values.insert(
"position", Position);
6294 info.
values.insert(
"relposition", Position);
6295 info.
text.insert(
"title", Title);
6296 info.
text.insert(
"description", Desc);
6297 info.
text.insert(
"value", Value);
6298 info.
text.insert(
"units", Units);
6304 LOG(VB_PLAYBACK, LOG_INFO, QString(
"UpdateOSDSeekMessage(%1, %2)").arg(Msg).arg(Timeout));
6310 info.
text[
"title"] = Msg;
6345 infoMap[
"callsign"].isEmpty())
6357 SignalMonitorList::const_iterator it;
6358 for (it = slist.begin(); it != slist.end(); ++it)
6359 if (
"error" == it->GetShortName())
6360 infoMap[QString(
"error%1").arg(i++)] = it->GetName();
6362 for (it = slist.begin(); it != slist.end(); ++it)
6363 if (
"message" == it->GetShortName())
6364 infoMap[QString(
"message%1").arg(i++)] = it->GetName();
6368 uint ber = 0xffffffff;
6380 for (it = slist.begin(); it != slist.end(); ++it)
6382 if (
"error" == it->GetShortName())
6384 err = it->GetName();
6388 if (
"message" == it->GetShortName())
6390 msg = it->GetName();
6391 LOG(VB_GENERAL, LOG_INFO,
"msg: " + msg);
6395 infoMap[it->GetShortName()] = QString::number(it->GetValue());
6396 if (
"signal" == it->GetShortName())
6397 sig = it->GetNormalizedValue(0, 100);
6398 else if (
"snr" == it->GetShortName())
6399 snr = it->GetValue();
6400 else if (
"ber" == it->GetShortName())
6401 ber =
static_cast<uint>(it->GetValue());
6402 else if (
"pos" == it->GetShortName())
6403 pos = it->GetValue();
6404 else if (
"script" == it->GetShortName())
6405 tuned = it->GetValue();
6406 else if (
"seen_pat" == it->GetShortName())
6407 pat = it->IsGood() ?
"a" :
"_";
6408 else if (
"matching_pat" == it->GetShortName())
6409 pat = it->IsGood() ?
"A" : pat;
6410 else if (
"seen_pmt" == it->GetShortName())
6411 pmt = it->IsGood() ?
"m" :
"_";
6412 else if (
"matching_pmt" == it->GetShortName())
6413 pmt = it->IsGood() ?
"M" : pmt;
6414 else if (
"seen_mgt" == it->GetShortName())
6415 mgt = it->IsGood() ?
"g" :
"_";
6416 else if (
"matching_mgt" == it->GetShortName())
6417 mgt = it->IsGood() ?
"G" : mgt;
6418 else if (
"seen_vct" == it->GetShortName())
6419 vct = it->IsGood() ?
"v" :
"_";
6420 else if (
"matching_vct" == it->GetShortName())
6421 vct = it->IsGood() ?
"V" : vct;
6422 else if (
"seen_nit" == it->GetShortName())
6423 nit = it->IsGood() ?
"n" :
"_";
6424 else if (
"matching_nit" == it->GetShortName())
6425 nit = it->IsGood() ?
"N" : nit;
6426 else if (
"seen_sdt" == it->GetShortName())
6427 sdt = it->IsGood() ?
"s" :
"_";
6428 else if (
"matching_sdt" == it->GetShortName())
6429 sdt = it->IsGood() ?
"S" : sdt;
6430 else if (
"seen_crypt" == it->GetShortName())
6431 crypt = it->IsGood() ?
"c" :
"_";
6432 else if (
"matching_crypt" == it->GetShortName())
6433 crypt = it->IsGood() ?
"C" : crypt;
6436 infoMap[
"signal"] = QString::number(sig);
6440 QString slock = (
"1" == infoMap[
"slock"]) ?
"L" :
"l";
6441 QString lockMsg = (slock==
"L") ? tr(
"Partial Lock") : tr(
"No Lock");
6442 QString sigMsg = allGood ? tr(
"Lock") : lockMsg;
6444 QString sigDesc = tr(
"Signal %1%").arg(sig,2);
6446 sigDesc +=
" | " + tr(
"S/N %1dB").arg(log10(snr), 3,
'f', 1);
6447 if (ber != 0xffffffff)
6448 sigDesc +=
" | " + tr(
"BE %1",
"Bit Errors").arg(ber, 2);
6449 if ((pos >= 0) && (pos < 100))
6450 sigDesc +=
" | " + tr(
"Rotor %1%").arg(pos,2);
6454 else if (tuned == 2)
6456 else if (tuned == 3)
6461 sigDesc = sigDesc + QString(
" | (%1%2%3%4%5%6%7%8%9) %10")
6462 .arg(tuneCode, slock, pat, pmt, mgt, vct,
6468 else if (!msg.isEmpty())
6471 infoMap[
"description"] = sigDesc;
6478 if (allGood || (pmt ==
"M"))
6487 bool timed_out =
false;
6502 LOG(VB_GENERAL, LOG_ERR,
LOC +
6503 "You have no OSD, but tuning has already taken too long.");
6529 static QString s_nextSrc =
GET_KEY(
"TV Playback",
"NEXTSOURCE");
6530 static QString s_togCards =
GET_KEY(
"TV Playback",
"NEXTINPUT");
6532 QString message = tr(
6533 "You should have received a channel lock by now. "
6534 "You can continue to wait for a signal, or you "
6535 "can change the channel with %1 or %2, change "
6536 "video source (%3), inputs (%4), etc.")
6537 .arg(s_chanUp, s_chanDown, s_nextSrc, s_togCards);
6540 { {tr(
"OK"),
"DIALOG_INFO_CHANNELLOCK_0" } },
6541 {
"",
"DIALOG_INFO_CHANNELLOCK_0",
true } });
6546 bool result =
false;
6612 dvdName = tr(
"DVD");
6616 mainStatus = tr(
"Menu");
6620 mainStatus = tr(
"Still Frame");
6624 int playingTitle = 0;
6625 int playingPart = 0;
6630 mainStatus = tr(
"Title: %1 (%2)").arg(playingTitle)
6632 subStatus = tr(
"Chapter: %1/%2").arg(playingPart).arg(totalParts);
6667 for (
uint i : std::as_const(list))
6668 ret += QString(
"%1,").arg(i);
6671 return ret.left(ret.length()-1);
6678 QVector<uint> tunable_cards;
6682 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"ChanId (%1) - no").arg(ChanId));
6683 return tunable_cards;
6687 mplexid = (32767 == mplexid) ? 0 : mplexid;
6689 uint excluded_input = 0;
6697 for (
auto & input : inputs)
6699 if (input.m_sourceId != sourceid)
6702 if (input.m_mplexId &&
6703 input.m_mplexId != mplexid)
6706 if (!input.m_mplexId && input.m_chanId &&
6707 input.m_chanId != ChanId)
6710 tunable_cards.push_back(input.m_inputId);
6713 if (tunable_cards.empty())
6714 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"ChanId (%1) - no").arg(ChanId));
6716 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"ChanId (%1) yes { %2 }").arg(ChanId).arg(
toCommaList(tunable_cards)));
6717 return tunable_cards;
6720 void TV::Embed(
bool Embed, QRect Rect,
const QStringList& Data)
6745 if (!Data.isEmpty())
6757 if (Pause ^ waspaused)
6759 if (Pause ^ waspaused)
6784 LOG(VB_GENERAL, LOG_ERR,
LOC +
"no active ctx playingInfo.");
6811 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC + QString(
"Pausing player: %1").arg(pause));
6884 QString message = QString(
"START_EPG %1").arg(EditType);
6886 QCoreApplication::postEvent(
this, me);
6903 QString appName = tr(
"Video");
6909 appName = tr(
"DVD");
6911 lcd->switchToVolume(appName);
6937 const float kTimeStretchMin = 0.125;
6938 const float kTimeStretchMax = 2.0;
6939 const float kTimeStretchStep = 0.05F;
6943 if (new_ts_normal > kTimeStretchMax &&
6946 new_ts_normal = kTimeStretchMax;
6948 else if (new_ts_normal < kTimeStretchMin &&
6951 new_ts_normal = kTimeStretchMin;
6954 if (new_ts_normal > kTimeStretchMax ||
6955 new_ts_normal < kTimeStretchMin)
7018 QString message = tr(
"MythTV was set to sleep after %1 minutes and will exit in %d seconds.\n"
7019 "Do you wish to continue watching?")
7023 { { tr(
"Yes"),
"DIALOG_SLEEP_YES_0" },
7024 { tr(
"No"),
"DIALOG_SLEEP_NO_0" } }});
7045 LOG(VB_GENERAL, LOG_INFO,
LOC +
"No longer watching TV, exiting");
7055 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Sleep timeout reached, exiting player.");
7073 QString message = tr(
"MythTV has been idle for %1 minutes and "
7074 "will exit in %d seconds. Are you still watching?")
7078 { { tr(
"Yes"),
"DIALOG_IDLE_YES_0" },
7079 { tr(
"No"),
"DIALOG_IDLE_NO_0" }}});
7102 LOG(VB_GENERAL, LOG_INFO,
LOC +
"No longer watching LiveTV, exiting");
7115 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Idle timeout reached, leaving LiveTV");
7155 QString message = me->
Message();
7157 if (message.isEmpty())
7160 std::chrono::milliseconds
timeout = 0ms;
7161 if (me->ExtraDataCount() == 1)
7163 auto t = std::chrono::seconds(me->ExtraData(0).toInt());
7164 if (
t > 0s &&
t < 1000s)
7185 if (dce->GetData().userType() == qMetaTypeId<MythTVMenuNodeTuple>())
7189 QDomNode Node = Menu.GetNodeFromPath(data.m_path);
7190 if (dce->GetResult() == -1)
7197 OSDDialogEvent(dce->GetResult(), dce->GetResultText(), dce->GetData().toString());
7222 LOG(VB_GENERAL, LOG_NOTICE,
"DVD has been ejected, exiting playback");
7237 QString message = me->
Message();
7240 QStringList tokens = message.split(
" ", Qt::SkipEmptyParts);
7242 if (me->ExtraDataCount() == 1)
7245 int value = me->ExtraData(0).toInt();
7275 if (me->ExtraDataCount() >= 2)
7277 width = me->ExtraData(0).toInt();
7278 height = me->ExtraData(1).toInt();
7280 if (me->ExtraDataCount() == 3)
7289 else if (message.startsWith(
"DONE_RECORDING"))
7291 std::chrono::seconds seconds = 0s;
7294 if (tokens.size() == NUMTOKENS)
7296 cardnum = tokens[1].toUInt();
7297 seconds = std::chrono::seconds(tokens[2].toInt());
7302 LOG(VB_GENERAL, LOG_ERR, QString(
"DONE_RECORDING event received "
7303 "with invalid number of arguments, "
7304 "%1 expected, %2 actual")
7306 .arg(tokens.size()-1));
7346 if (message.startsWith(
"ASK_RECORDING "))
7349 bool hasrec =
false;
7350 bool haslater =
false;
7351 if (tokens.size() >= 5)
7353 cardnum = tokens[1].toUInt();
7354 timeuntil = tokens[2].toInt();
7355 hasrec = (tokens[3].toInt() != 0);
7356 haslater = (tokens[4].toInt() != 0);
7358 LOG(VB_GENERAL, LOG_DEBUG,
7359 LOC + message + QString(
" hasrec: %1 haslater: %2")
7360 .arg(hasrec).arg(haslater));
7369 if (message.startsWith(
"QUIT_LIVETV"))
7371 cardnum = (tokens.size() >= 2) ? tokens[1].toUInt() : 0;
7384 if (message.startsWith(
"LIVETV_WATCH"))
7387 if (tokens.size() >= 3)
7389 cardnum = tokens[1].toUInt();
7390 watch = tokens[2].toInt();
7414 if (message.startsWith(
"LIVETV_CHAIN"))
7417 if ((tokens.size() >= 2) && tokens[1] ==
"UPDATE")
7426 if (message.startsWith(
"EXIT_TO_MENU"))
7435 if (message.startsWith(
"SIGNAL"))
7437 cardnum = (tokens.size() >= 2) ? tokens[1].toUInt() : 0;
7438 const QStringList& signalList = me->ExtraDataList();
7454 if (message.startsWith(
"NETWORK_CONTROL"))
7456 if ((tokens.size() >= 2) &&
7457 (tokens[1] !=
"ANSWER") && (tokens[1] !=
"RESPONSE"))
7459 QStringList tokens2 = message.split(
" ", Qt::SkipEmptyParts);
7460 if ((tokens2.size() >= 2) &&
7461 (tokens2[1] !=
"ANSWER") && (tokens2[1] !=
"RESPONSE"))
7470 if (message.startsWith(
"START_EPG"))
7472 int editType = tokens[1].toInt();
7476 if (message.startsWith(
"COMMFLAG_START") && (tokens.size() >= 2))
7479 QDateTime evrecstartts;
7491 QString msg =
"COMMFLAG_REQUEST ";
7498 if (message.startsWith(
"COMMFLAG_UPDATE") && (tokens.size() >= 3))
7501 QDateTime evrecstartts;
7515 QStringList
marks = tokens[2].split(
",", Qt::SkipEmptyParts);
7516 for (
int j = 0; j <
marks.size(); j++)
7518 mark =
marks[j].split(
":", Qt::SkipEmptyParts);
7519 if (
marks.size() >= 2)
7530 if (message ==
"NOTIFICATION")
7551 recinfo.
ToMap(infoMap);
7568 map.insert(
"message_text", tr(
"Record"));
7576 LOG(VB_GENERAL, LOG_CRIT,
LOC +
"Unknown recording during live tv.");
7589 cmdmsg = tr(
"Record");
7592 LOG(VB_RECORD, LOG_INFO,
LOC +
"Toggling Record on");
7601 cmdmsg = tr(
"Cancel Record");
7604 LOG(VB_RECORD, LOG_INFO,
LOC +
"Toggling Record off");
7686 title = tr(
"Adjust Volume");
7703 if (Type ==
"EDIT_CUT_POINTS")
7709 "menu_cutlist.xml", tr(
"Edit Cut Points"),
7710 metaObject()->className(),
"TV Editing");
7716 else if (Type ==
"EDIT_CUT_POINTS_COMPACT")
7722 "menu_cutlist_compact.xml", tr(
"Edit Cut Points"),
7723 metaObject()->className(),
"TV Editing");
7729 else if (Type ==
"EXIT_EDIT_MODE")
7732 dialog.m_buttons.push_back( { tr(
"Save Cuts and Exit"),
"DIALOG_CUTPOINT_SAVEEXIT_0" } );
7733 dialog.m_buttons.push_back( { tr(
"Exit Without Saving"),
"DIALOG_CUTPOINT_REVERTEXIT_0" } );
7734 dialog.m_buttons.push_back( { tr(
"Save Cuts"),
"DIALOG_CUTPOINT_SAVEMAP_0" } );
7735 dialog.m_buttons.push_back( { tr(
"Undo Changes"),
"DIALOG_CUTPOINT_REVERT_0" } );
7736 dialog.m_back = {
"",
"DIALOG_CUTPOINT_DONOTHING_0",
true };
7740 map.insert(
"title", tr(
"Edit"));
7752 if (
Action ==
"DONOTHING" && osd)
7757 QStringList actions(
Action);
7759 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Unrecognised cutpoint action");
7789 QString message = tr(
"This program is currently being edited");
7790 QString def = QString(
"DIALOG_EDITING_CONTINUE_%1").arg(
static_cast<int>(paused));
7792 { { tr(
"Continue Editing"), def,
false,
true },
7793 { tr(
"Do not edit"), QString(
"DIALOG_EDITING_STOP_%1").arg(
static_cast<int>(paused)) }},
7794 {
"", def,
true} });
7810 if (!WasPaused && paused)
7827 for (
auto it = newMap.cbegin(); it != newMap.cend(); ++it)
7828 infoMap.insert(it.key(), *it);
7887 if (osd &&
Action ==
"PROBE")
7895 else if (osd &&
Action ==
"OK")
7903 else if (osd &&
Action ==
"QUIT")
7917 const QString keys[4] = {
"XMLTV",
"callsign",
"channame",
"channum", };
7926 QMap<QString,bool> modifiable;
7927 if (!(modifiable[
"callsign"] = Info[
"callsign"].isEmpty()))
7929 QString unsetsign = tr(
"UNKNOWN%1",
"Synthesized callsign");
7930 int unsetcmpl = unsetsign.length() - 2;
7931 unsetsign = unsetsign.left(unsetcmpl);
7932 if (Info[
"callsign"].left(unsetcmpl) == unsetsign)
7933 modifiable[
"callsign"] =
true;
7935 modifiable[
"channame"] = Info[
"channame"].isEmpty();
7937 const std::array<const QString,2> xds_keys {
"callsign",
"channame", };
7938 for (
const auto & key : xds_keys)
7940 if (!modifiable[key])
7950 if ((key ==
"callsign") &&
7951 ((
tmp.length() > 5) || (
tmp.indexOf(
" ") >= 0)))
7963 LOG(VB_GENERAL, LOG_DEBUG,
LOC + QString(
"result %1 text %2 action %3")
7964 .arg(QString::number(Result), Text,
Action));
7970 bool handled =
true;
7971 if (
Action.startsWith(
"DIALOG_"))
7973 Action.remove(
"DIALOG_");
7974 QStringList desc =
Action.split(
"_");
7975 bool valid = desc.size() == 3;
7981 else if (valid && desc[0] ==
"VIDEOEXIT")
7985 else if (valid && desc[0] ==
"SLEEP")
7989 else if (valid && desc[0] ==
"IDLE")
7993 else if (valid && desc[0] ==
"INFO")
7997 else if (valid && desc[0] ==
"EDITING")
8001 else if (valid && desc[0] ==
"ASKALLOW")
8005 else if (valid && desc[0] ==
"EDITOR")
8009 else if (valid && desc[0] ==
"CUTPOINT")
8013 else if ((valid && desc[0] ==
"DELETE") ||
8014 (valid && desc[0] ==
"CONFIRM"))
8023 LOG(VB_GENERAL, LOG_ERR,
"Unrecognised dialog event.");
8026 else if (Result < 0)
8037 else if (
Action ==
"CANCELPLAYLIST")
8053 else if (
Action ==
"TOGGLEMANUALZOOM")
8059 else if (
Action ==
"TOGGLESTRETCH")
8065 else if (
Action.startsWith(
"ADJUSTSTRETCH"))
8067 bool floatRead =
false;
8068 float stretch =
Action.right(
Action.length() - 13).toFloat(&floatRead);
8083 else if (
Action.startsWith(
"SELECTSCAN_"))
8099 else if (
Action.startsWith(
"TOGGLEPICCONTROLS"))
8104 else if (
Action ==
"TOGGLEASPECT")
8106 else if (
Action.startsWith(
"TOGGLEASPECT"))
8108 else if (
Action ==
"TOGGLEFILL")
8110 else if (
Action.startsWith(
"TOGGLEFILL"))
8112 else if (
Action ==
"MENU")
8114 else if (
Action ==
"AUTODETECT_FILL")
8120 if (
Action ==
"CHANGROUP_ALL_CHANNELS")
8126 Action.remove(
"CHANGROUP_");
8132 QString cur_channum;
8133 QString new_channum;
8139 new_channum = cur_channum;
8141 auto it = list.cbegin();
8142 for (; it != list.cend(); ++it)
8144 if ((*it).m_chanNum == cur_channum)
8150 if (it == list.end())
8155 if (it != list.end())
8156 new_channum = (*it).m_chanNum;
8159 LOG(VB_CHANNEL, LOG_INFO,
LOC +
8160 QString(
"Channel Group: '%1'->'%2'")
8161 .arg(cur_channum, new_channum));
8167 if (cur_channum != new_channum && !new_channum.isEmpty())
8184 else if (
Action ==
"SCHEDULE")
8188 else if (
Action.startsWith(
"VISUALISER"))
8190 else if (
Action.startsWith(
"3D"))
8197 if (
Action ==
"TOGGLEBROWSE")
8199 else if (
Action ==
"PREVCHAN")
8201 else if (
Action.startsWith(
"SWITCHTOINPUT_"))
8206 else if (
Action ==
"EDIT")
8233 int chapter =
Action.right(3).toInt();
8238 int title =
Action.right(3).toInt();
8243 int angle =
Action.right(3).toInt();
8246 else if (
Action ==
"EDIT")
8251 else if (
Action ==
"TOGGLEAUTOEXPIRE")
8253 else if (
Action.startsWith(
"TOGGLECOMMSKIP"))
8257 else if (
Action ==
"QUEUETRANSCODE")
8261 else if (
Action ==
"QUEUETRANSCODE_AUTO")
8265 else if (
Action ==
"QUEUETRANSCODE_HIGH")
8269 else if (
Action ==
"QUEUETRANSCODE_MEDIUM")
8273 else if (
Action ==
"QUEUETRANSCODE_LOW")
8295 LOG(VB_GENERAL, LOG_ERR,
LOC +
8296 "Unknown menu action selected: " +
Action);
8307 bool visible =
false;
8320 if (
Action ==
"CHANNELLOCK")
8325 #define BUTTON(action, text) \
8326 result = Context.AddButton(Menu, active, (action), (text), "", false, "")
8327 #define BUTTON2(action, textActive, textInactive) \
8328 result = Context.AddButton(Menu, active, (action), (textActive), (textInactive), false, "")
8329 #define BUTTON3(action, textActive, textInactive, isMenu) \
8330 result = Context.AddButton(Menu, active, (action), (textActive), (textInactive), (isMenu), "")
8345 const QString &actionName = Context.
m_action;
8347 bool result =
false;
8350 result = Context.
m_menu.
Show(Context.
m_node, QDomNode(), *
this, Menu,
false);
8367 if (actionName ==
"DIALOG_CUTPOINT_MOVEPREV_0")
8375 BUTTON2(actionName, tr(
"Move Previous Cut End Here"), tr(
"Move Start of Cut Here"));
8378 else if (actionName ==
"DIALOG_CUTPOINT_MOVENEXT_0")
8386 BUTTON2(actionName, tr(
"Move Next Cut Start Here"), tr(
"Move End of Cut Here"));
8389 else if (actionName ==
"DIALOG_CUTPOINT_CUTTOBEGINNING_0")
8392 BUTTON(actionName, tr(
"Cut to Beginning"));
8394 else if (actionName ==
"DIALOG_CUTPOINT_CUTTOEND_0")
8399 BUTTON(actionName, tr(
"Cut to End"));
8402 else if (actionName ==
"DIALOG_CUTPOINT_DELETE_0")
8405 BUTTON2(actionName, tr(
"Delete This Cut"), tr(
"Join Surrounding Cuts"));
8407 else if (actionName ==
"DIALOG_CUTPOINT_NEWCUT_0")
8410 BUTTON(actionName, tr(
"Add New Cut"));
8412 else if (actionName ==
"DIALOG_CUTPOINT_UNDO_0")
8416 QString text = tr(
"Undo - %1");
8417 result = Context.
AddButton(Menu, active, actionName, text,
"",
false,
8420 else if (actionName ==
"DIALOG_CUTPOINT_REDO_0")
8424 QString text = tr(
"Redo - %1");
8425 result = Context.
AddButton(Menu, active, actionName, text,
"",
false,
8428 else if (actionName ==
"DIALOG_CUTPOINT_CLEARMAP_0")
8430 BUTTON(actionName, tr(
"Clear Cuts"));
8432 else if (actionName ==
"DIALOG_CUTPOINT_INVERTMAP_0")
8434 BUTTON(actionName, tr(
"Reverse Cuts"));
8436 else if (actionName ==
"DIALOG_CUTPOINT_LOADCOMMSKIP_0")
8438 BUTTON(actionName, tr(
"Load Detected Commercials"));
8440 else if (actionName ==
"DIALOG_CUTPOINT_REVERT_0")
8442 BUTTON(actionName, tr(
"Undo Changes"));
8444 else if (actionName ==
"DIALOG_CUTPOINT_REVERTEXIT_0")
8446 BUTTON(actionName, tr(
"Exit Without Saving"));
8448 else if (actionName ==
"DIALOG_CUTPOINT_SAVEMAP_0")
8450 BUTTON(actionName, tr(
"Save Cuts"));
8452 else if (actionName ==
"DIALOG_CUTPOINT_SAVEEXIT_0")
8454 BUTTON(actionName, tr(
"Save Cuts and Exit"));
8468 if (!text.isEmpty())
8469 BUTTON(actionName, text);
8480 const QString &actionName = Context.
m_action;
8482 bool result =
false;
8487 result = Context.
m_menu.
Show(Context.
m_node, QDomNode(), *
this, Menu,
false);
8574 if (
prefix ==
"SELECTSUBTITLE_")
8576 else if (
prefix ==
"SELECTRAWTEXT_")
8578 else if (
prefix ==
"SELECTCC708_")
8580 else if (
prefix ==
"SELECTCC608_")
8582 else if (
prefix ==
"SELECTTTC_")
8584 else if (
prefix ==
"SELECTAUDIO_")
8607 static const std::array<const speed,9> s_speeds {{
8608 { 0,
"", tr(
"Adjust")},
8609 { 50,
"0.5", tr(
"0.5x")},
8610 { 90,
"0.9", tr(
"0.9x")},
8611 {100,
"1.0", tr(
"1.0x")},
8612 {110,
"1.1", tr(
"1.1x")},
8613 {120,
"1.2", tr(
"1.2x")},
8614 {130,
"1.3", tr(
"1.3x")},
8615 {140,
"1.4", tr(
"1.4x")},
8616 {150,
"1.5", tr(
"1.5x")},
8619 for (
const auto & speed : s_speeds)
8641 BUTTON(
"CHANGROUP_ALL_CHANNELS", tr(
"All Channels"));
8642 ChannelGroupList::const_iterator it;
8646 QString
action =
prefix + QString::number(it->m_grpId);
8656 static constexpr std::array<const uint,3> kCasOrd { 0, 2, 1 };
8657 for (
uint csm : kCasOrd)
8674 QString chapter1 = QString(
"%1").arg(i+1, size, 10, QChar(48));
8675 QString chapter2 = QString(
"%1").arg(i+1, 3 , 10, QChar(48));
8677 QString desc = chapter1 + QString(
" (%1)").arg(timestr);
8690 QString angleIdx = QString(
"%1").arg(i, 3, 10, QChar(48));
8705 QString titleIdx = QString(
"%1").arg(i, 3, 10, QChar(48));
8718 QVector <QString> addednames;
8720 for (
auto & input : inputs)
8722 if (input.m_inputId == inputid ||
8723 addednames.contains(input.m_displayName))
8726 addednames += input.m_displayName;
8727 QString
action = QString(
"SWITCHTOINPUT_") +
8728 QString::number(input.m_inputId);
8740 uint sourceid = info[
"sourceid"].toUInt();
8741 QMap<uint, bool> sourceids;
8743 for (
auto & input : inputs)
8745 if (input.m_sourceId == sourceid ||
8746 sourceids[input.m_sourceId])
8749 sourceids[input.m_sourceId] =
true;
8750 QString
action = QString(
"SWITCHTOINPUT_") +
8751 QString::number(input.m_inputId);
8758 if (actionName ==
"TOGGLEAUDIOSYNC")
8760 BUTTON(actionName, tr(
"Adjust Audio Sync"));
8764 BUTTON(actionName, tr(
"None"));
8766 else if (actionName ==
"DISABLEUPMIX")
8771 BUTTON(actionName, tr(
"Disable Audio Upmixer"));
8774 else if (actionName ==
"ENABLEUPMIX")
8779 BUTTON(actionName, tr(
"Auto Detect"));
8782 else if (actionName ==
"AUTODETECT_FILL")
8789 BUTTON(actionName, tr(
"Auto Detect"));
8792 else if (actionName ==
"TOGGLEMANUALZOOM")
8794 BUTTON(actionName, tr(
"Manual Zoom Mode"));
8796 else if (actionName ==
"DISABLESUBS")
8800 BUTTON(actionName, tr(
"Disable Subtitles"));
8802 else if (actionName ==
"ENABLESUBS")
8806 BUTTON(actionName, tr(
"Enable Subtitles"));
8808 else if (actionName ==
"DISABLEFORCEDSUBS")
8814 BUTTON(actionName, tr(
"Disable Forced Subtitles"));
8817 else if (actionName ==
"ENABLEFORCEDSUBS")
8823 BUTTON(actionName, tr(
"Enable Forced Subtitles"));
8826 else if (actionName ==
"DISABLEEXTTEXT")
8830 BUTTON(actionName, tr(
"Disable External Subtitles"));
8832 else if (actionName ==
"ENABLEEXTTEXT")
8836 BUTTON(actionName, tr(
"Enable External Subtitles"));
8838 else if (actionName ==
"TOGGLETTM")
8841 BUTTON(actionName, tr(
"Toggle Teletext Menu"));
8843 else if (actionName ==
"TOGGLESUBZOOM")
8846 BUTTON(actionName, tr(
"Adjust Subtitle Zoom"));
8848 else if (actionName ==
"TOGGLESUBDELAY")
8854 BUTTON(actionName, tr(
"Adjust Subtitle Delay"));
8857 else if (actionName ==
"PAUSE")
8860 BUTTON2(actionName, tr(
"Play"), tr(
"Pause"));
8862 else if (actionName ==
"TOGGLESTRETCH")
8864 BUTTON(actionName, tr(
"Toggle"));
8866 else if (actionName ==
"TOGGLEBROWSE")
8869 BUTTON(actionName, tr(
"Toggle Browse Mode"));
8871 else if (actionName ==
"CANCELPLAYLIST")
8874 BUTTON(actionName, tr(
"Cancel Playlist"));
8876 else if (actionName ==
"DEBUGOSD")
8878 BUTTON(actionName, tr(
"Playback Data"));
8880 else if (actionName ==
"JUMPFFWD")
8883 BUTTON(actionName, tr(
"Jump Ahead"));
8885 else if (actionName ==
"JUMPRWND")
8888 BUTTON(actionName, tr(
"Jump Back"));
8890 else if (actionName ==
"JUMPTODVDROOTMENU")
8895 BUTTON2(actionName, tr(
"DVD Root Menu"), tr(
"Top menu"));
8898 else if (actionName ==
"JUMPTOPOPUPMENU")
8901 BUTTON(actionName, tr(
"Popup menu"));
8903 else if (actionName ==
"JUMPTODVDTITLEMENU")
8906 BUTTON(actionName, tr(
"DVD Title Menu"));
8908 else if (actionName ==
"JUMPTODVDCHAPTERMENU")
8911 BUTTON(actionName, tr(
"DVD Chapter Menu"));
8913 else if (actionName ==
"PREVCHAN")
8916 BUTTON(actionName, tr(
"Previous Channel"));
8918 else if (actionName ==
"GUIDE")
8920 BUTTON(actionName, tr(
"Program Guide"));
8922 else if (actionName ==
"FINDER")
8924 BUTTON(actionName, tr(
"Program Finder"));
8926 else if (actionName ==
"VIEWSCHEDULED")
8928 BUTTON(actionName, tr(
"Upcoming Recordings"));
8930 else if (actionName ==
"SCHEDULE")
8932 BUTTON(actionName, tr(
"Edit Recording Schedule"));
8934 else if (actionName ==
"DIALOG_JUMPREC_X_0")
8936 BUTTON3(actionName, tr(
"Recorded Program"),
"",
true);
8942 else if (actionName ==
"JUMPPREV")
8957 else if (actionName ==
"EDIT")
8963 BUTTON2(actionName, tr(
"Edit Channel"), tr(
"Edit Recording"));
8966 else if (actionName ==
"TOGGLEAUTOEXPIRE")
8972 tr(
"Turn Auto-Expire OFF"), tr(
"Turn Auto-Expire ON"));
8975 else if (actionName ==
"QUEUETRANSCODE")
8980 BUTTON2(actionName, tr(
"Stop Transcoding"), tr(
"Default"));
8983 else if (actionName ==
"QUEUETRANSCODE_AUTO")
8988 BUTTON(actionName, tr(
"Autodetect"));
8991 else if (actionName ==
"QUEUETRANSCODE_HIGH")
8996 BUTTON(actionName, tr(
"High Quality"));
8999 else if (actionName ==
"QUEUETRANSCODE_MEDIUM")
9004 BUTTON(actionName, tr(
"Medium Quality"));
9007 else if (actionName ==
"QUEUETRANSCODE_LOW")
9012 BUTTON(actionName, tr(
"Low Quality"));
9024 if (!text.isEmpty())
9025 BUTTON(actionName, text);
9085 QString cur_channum = QString();
9088 if (!prev_channum.isEmpty() && prev_channum != cur_channum)
9140 QString text = Menu.
Translate(Node.toElement().attribute(
"text", Menu.
GetName()));
9142 Menu.
Show(Node, Selected, *
this, &
menu);
9143 QDomNode parent = Node.parentNode();
9144 if (!parent.parentNode().isNull())
9148 menu.m_back = {
"", v };
9157 map.insert(
"title", tr(
"Edit"));
9166 (void)tr(
"Playback Menu");
9167 (void)tr(
"Playback Compact Menu");
9169 (void)tr(
"Select Audio Track");
9170 (void)tr(
"Visualisation");
9172 (void)tr(
"Change Aspect Ratio");
9173 (void)tr(
"Adjust Fill");
9174 (void)tr(
"Adjust Picture");
9176 (void)tr(
"Advanced");
9177 (void)tr(
"Video Scan");
9178 (void)tr(
"Deinterlacer");
9179 (void)tr(
"Subtitles");
9180 (void)tr(
"Select Subtitle");
9181 (void)tr(
"Text Subtitles");
9182 (void)tr(
"Select ATSC CC");
9183 (void)tr(
"Select VBI CC");
9184 (void)tr(
"Select Teletext CC");
9185 (void)tr(
"Playback");
9186 (void)tr(
"Adjust Time Stretch");
9187 (void)tr(
"Picture-in-Picture");
9189 (void)tr(
"Channel Groups");
9190 (void)tr(
"Navigate");
9191 (void)tr(
"Commercial Auto-Skip");
9192 (void)tr(
"Chapter");
9195 (void)tr(
"Schedule");
9197 (void)tr(
"Jump to Program");
9198 (void)tr(
"Switch Input");
9199 (void)tr(
"Switch Source");
9201 (void)tr(
"Begin Transcoding");
9204 (void)tr(
"Edit Cut Points");
9205 (void)tr(
"Edit Cut Points (Compact)");
9206 (void)tr(
"Cut List Options");
9214 "menu_playback.xml", tr(
"Playback Menu"),
9215 metaObject()->className(),
"TV Playback");
9217 "menu_playback_compact.xml", tr(
"Playback Compact Menu"),
9218 metaObject()->className(),
"TV Playback");
9230 if (Level < 0 || Level > 1)
9244 QList<QString> titles_seen;
9250 for (
auto *pi : *infoList)
9252 if (pi->GetRecordingGroup() !=
"LiveTV" || LiveTVInAllPrograms ||
9253 pi->GetRecordingGroup() == currecgroup)
9261 QMap<QString,ProgramList>::const_iterator Iprog;
9265 auto progIndex =
static_cast<uint>(plist.
size());
9266 const QString& group = Iprog.key();
9271 if (progIndex == 1 && Level == 0)
9273 dialog.m_buttons.push_back( {Iprog.key(), QString(
"JUMPPROG %1 0").arg(group) });
9275 else if (progIndex > 1 && Level == 0)
9277 QString act = QString(
"DIALOG_%1_%2_1")
9279 dialog.m_buttons.push_back( {group, act,
true, Selected == group });
9281 else if (Level == 1 && Iprog.key() == Category)
9283 for (
auto pit = plist.
begin(); pit != plist.
end(); ++pit)
9287 if (titles_seen.contains(
p->GetTitle()))
9290 titles_seen.push_back(
p->GetTitle());
9293 for (
auto *q : plist)
9297 if (q->GetTitle() !=
p->GetTitle())
9300 dialog.m_buttons.push_back( { q->GetSubtitle().isEmpty() ?
9301 q->GetTitle() : q->GetSubtitle(),
9302 QString(
"JUMPPROG %1 %2").arg(Iprog.key()).arg(j) });
9310 while (!infoList->empty())
9312 delete infoList->back();
9313 infoList->pop_back();
9318 if (!Category.isEmpty())
9321 dialog.m_back = { Category,
"DIALOG_" +
ACTION_JUMPREC +
"_X_0" };
9322 else if (Level == 0)
9346 if (!message.isEmpty())
9359 desc = tr(
"Auto-Expire OFF");
9364 desc = tr(
"Auto-Expire ON");
9369 if (!desc.isEmpty())
9385 if (!desc.isEmpty())
9394 if (!Desc.isEmpty())
9409 for (
const auto&
action : std::as_const(Actions))
9411 if (!
action.startsWith(
"JUMPPROG"))
9415 QString key =
action.section(
" ",1,-2);
9416 uint index =
action.section(
" ",-1,-1).toUInt(&ok);
9433 LOG(VB_GENERAL, LOG_ERR,
LOC + QString(
"Failed to locate jump to program '%1' @ %2")
9434 .arg(key,
action.section(
" ",-1,-1)));
9456 QTimer::singleShot(0,
this, Jump);
9464 LOG(VB_GENERAL, LOG_ERR,
"Failed to open jump to program GUI");
9472 std::chrono::minutes mins { 0min };
9495 if (Time.length() > 11)
9497 bool intRead =
false;
9498 mins = std::chrono::minutes(Time.right(Time.length() - 11).toUInt(&intRead));
9511 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Invalid time " + Time);
9516 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Invalid time string " + Time);
9528 out = tr(
"Sleep") +
" " + QString::number(mins.count());
9541 errorText = tr(
"MythTV is already using all available "
9542 "inputs for the channel you selected. "
9543 "If you want to watch an in-progress recording, "
9544 "select one from the playback menu. If you "
9545 "want to watch Live TV, cancel one of the "
9546 "in-progress recordings from the delete "
9550 errorText = tr(
"Error: MythTV is using all inputs, "
9551 "but there are no active recordings?");
9554 errorText = tr(
"MythTV has no capture cards defined. "
9555 "Please run the mythtv-setup program.");
9692 else if (!dvd->StartOfTitle())
9698 std::chrono::seconds titleLength = dvd->GetTotalTimeOfTitle();
9699 std::chrono::seconds
chapterLength = dvd->GetChapterLength();
9722 bool in_menu = dvd->IsInMenu();
9723 if (in_still && !dvd->NumMenuButtons())
9725 dvd->SkipStillFrame();
9728 else if (!dvd->EndOfTitle() && !in_still && !in_menu)
9732 else if (!in_still && !in_menu)
9734 std::chrono::seconds titleLength = dvd->GetTotalTimeOfTitle();
9735 std::chrono::seconds
chapterLength = dvd->GetChapterLength();
9736 std::chrono::seconds currentTime = dvd->GetCurrentTime();
9781 bool allowed =
false;
9804 videotype = tr(
"Live TV");
9806 videotype = tr(
"this DVD");
9810 videotype = tr(
"this Video");
9813 if (videotype.isEmpty())
9814 videotype = tr(
"this recording");
9818 dialog.m_buttons.push_back({tr(
"Exit %1").arg(videotype),
ACTION_STOP});
9820 dialog.m_buttons.push_back({tr(
"Exit Without Saving"),
"DIALOG_VIDEOEXIT_CLEARLASTPLAYEDPOSITION_0"});
9823 dialog.m_buttons.push_back({tr(
"Delete this recording"),
"DIALOG_VIDEOEXIT_CONFIRMDELETE_0"});
9825 dialog.m_buttons.push_back({tr(
"Keep watching"),
"DIALOG_VIDEOEXIT_KEEPWATCHING_0"});
9826 dialog.m_back = {
"",
"DIALOG_VIDEOEXIT_KEEPWATCHING_0",
true };
9827 emit ChangeOSDDialog(dialog);
9829 if (m_videoExitDialogTimerId)
9830 KillTimer(m_videoExitDialogTimerId);
9831 m_videoExitDialogTimerId = StartTimer(kVideoExitDialogTimeout, __LINE__);
9841 LOG(VB_GENERAL, LOG_ERR,
"It is unsafe to delete at the moment");
9849 LOG(VB_GENERAL, LOG_ERR,
"This program cannot be deleted at this time.");
9856 QString message = tr(
"Cannot delete program ") + QString(
"%1 ").arg(pginfo.
GetTitle());
9859 message += QString(
"\"%1\" ").arg(pginfo.
GetSubtitle());
9863 message += tr(
"because it is not a recording.");
9867 message += tr(
"because it is in use by");
9870 for (
int i = 0; (i + 2) < byWho.size(); i += 3)
9876 message +=
" " + byWho[i+2];
9880 {{ tr(
"OK"),
"DIALOG_DELETE_OK_0" }},
9881 {
"",
"DIALOG_DELETE_OK_0",
true }});
9904 QString message = QString(
"%1\n%2\n%3")
9905 .arg(Title, infoMap[
"title"], infoMap[
"timedate"]);
9911 if (Title ==
"End Of Recording")
9913 dialog.m_buttons.push_back({tr(
"Delete it, but allow it to re-record"),
"DIALOG_VIDEOEXIT_DELETEANDRERECORD_0"});
9914 dialog.m_buttons.push_back({tr(
"Delete it"),
"DIALOG_VIDEOEXIT_JUSTDELETE_0"});
9915 dialog.m_buttons.push_back({tr(
"Save it so I can watch it again"),
ACTION_STOP,
false,
true});
9919 dialog.m_buttons.push_back({tr(
"Yes, and allow re-record"),
"DIALOG_VIDEOEXIT_DELETEANDRERECORD_0"});
9920 dialog.m_buttons.push_back({tr(
"Yes, delete it"),
"DIALOG_VIDEOEXIT_JUSTDELETE_0"});
9921 dialog.m_buttons.push_back({tr(
"No, keep it"),
ACTION_STOP,
false,
true});
9923 dialog.m_back = {
"",
"DIALOG_PLAY_0_0",
true };
9947 if (
Action ==
"DELETEANDRERECORD" && delete_ok)
9954 else if (
Action ==
"JUSTDELETE" && delete_ok)
9960 else if (
Action ==
"CONFIRMDELETE")
9965 else if (
Action ==
"KEEPWATCHING" && !near_end)
9969 else if (
Action ==
"CLEARLASTPLAYEDPOSITION")
10047 bool paused =
false;
10099 case Qt::ApplicationState::ApplicationSuspended:
10101 LOG(VB_GENERAL, LOG_NOTICE,
"Exiting playback on app suspecnd");
void ChangePictureAttribute(PictureAttribute Attribute, bool Direction, int Value)
static SignalMonitorList Parse(const QStringList &slist)
Converts a list of strings to SignalMonitorValue classes.
void HandleStateChange()
Changes the state to the state on the front of the state change queue.
bool Create(void) override
void onApplicationStateChange(Qt::ApplicationState State)
static QString toCommaList(const QVector< uint > &list)
bool IsNearEnd(void)
Returns true iff near end of recording.
static const std::chrono::milliseconds kEndOfPlaybackCheckFrequency
void emitTVPlaybackUnpaused(void)
bool IsActionable(const QString &Action, const QStringList &Actions)
static constexpr const char * OSD_DLG_MENU
void SetLength(std::chrono::seconds len)
bool isActive(void) const
@ BROWSE_LEFT
Fetch information on current channel in the past.
bool QueryIsDeleteCandidate(bool one_playback_allowed=false) const
Returns true iff this is a recording, it is not in use (except by the recorder), and at most one play...
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
void PrepToSwitchToRecordedProgram(const ProgramInfo &ProgInfo)
bool StartPlayer(TVState desiredState)
bool IsRecorderErrored(void) const
QSqlQuery wrapper that fetches a DB connection from the connection pool.
static void SetState(const QVariantMap &NewState)
MythScreenStack * GetMainStack()
void SetAutoCommercialSkip(CommSkipMode SkipMode=kCommSkipOff)
void RequestEmbedding(bool Embed, const QRect &Rect={}, const QStringList &Data={})
bool m_requestDelete
User wants last video deleted.
volatile int m_endOfPlaybackTimerId
bool IsErrored(void) const
This is set if the player encountered some irrecoverable error.
static bool IsTunerShared(uint inputidA, uint inputidB)
void DialogGetText(InfoMap &Map)
std::chrono::milliseconds elapsed(void)
Returns milliseconds elapsed since last start() or restart()
InfoMap m_lastSignalUIInfo
#define ACTION_SETCONTRAST
void GetPlayerWriteLock() const
void StartOsdNavigation()
static const std::chrono::milliseconds kSaveLastPlayPosTimeout
QString MakeUniqueKey(void) const
Creates a unique string that can be used to identify an existing recording.
bool DialogVisible(const QString &Window=QString())
bool IsSameProgram(const ProgramInfo *ProgInfo) const
std::chrono::milliseconds SetSignalMonitoringRate(std::chrono::milliseconds rate, int notifyFrontend=1)
Sets the signal monitoring rate.
bool SeekHandleAction(const QStringList &Actions, bool IsDVD)
#define ACTION_DISABLEUPMIX
TVState GetState(void) const
bool SetChannelInfo(const InfoMap &infoMap)
void SendMessage(const QString &message)
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
static bool StateIsPlaying(TVState State)
void RefreshEditorState(bool CheckSaved=false)
static constexpr const char * OSD_WIN_BROWSE
void start(QThread::Priority p=QThread::InheritPriority)
Tell MThread to start running the thread in the near future.
#define ACTION_VIEWSCHEDULED
#define ACTION_TOGGLESUBTITLEDELAY
static constexpr const char * ACTION_DOWN
void HandleSaveLastPlayPosEvent()
void BrowseEnd(bool ChangeChannel)
Ends channel browsing.
void SaveEditing(bool edit)
Sets "editing" field in "recorded" table to "edit".
bool HandleJumpToProgramAction(const QStringList &Actions)
static const Type kMythUserMessage
@ BROWSE_UP
Fetch information on previous channel.
RemoteEncoder * RemoteGetExistingRecorder(const ProgramInfo *pginfo)
@ kStartTVIgnoreProgStart
void switchToChannel(const QString &channum="", const QString &title="", const QString &subtitle="")
uint64_t TranslatePositionAbsToRel(uint64_t position) const
static QString GetDisplayName(uint inputid)
PictureAttributeSupported
bool IsTunablePriv(uint ChanId)
MythVideoOutput * GetVideoOutput(void)
static void REG_KEY(const QString &Context, const QString &Action, const QString &Description, const QString &Key)
void UnlockPlayingInfo(const char *file, int line) const
bool IsPlayerChangingBuffers(void) const
static const Type kMythEventMessage
void ProcessNetworkControlCommand(const QString &Command)
QReadWriteLock m_playerLock
lock on player and playerActive changes
int GetRecorderNumber(void) const
QString ScanTypeToUserString(FrameScanType Scan, bool Forced=false)
static constexpr std::chrono::milliseconds kSMExitTimeout
Timeout after last Signal Monitor message for ignoring OSD when exiting.
void ITVRestart(bool IsLive)
Restart the MHEG/MHP engine.
int m_ffRewIndex
Index into m_ffRewSpeeds for FF and Rewind speeds.
static const Type kUpdateBrowseInfoEventType
QStringList m_lastSignalMsg
#define ACTION_ZOOMHORIZONTALIN
bool m_subtitleZoomAdjustment
True if subtitle zoom is turned on.
@ kAdjustingPicture_Channel
bool IsHDMVNavigation(void) const
virtual int DecrRef(void)
Decrements reference count and deletes on 0.
void ShowNotificationError(const QString &msg, const QString &from, const QString &detail, const VNMask visibility, const MythNotification::Priority priority)
convenience utility to display error message as notification
void ChangeOSDDialog(const MythOSDDialogData &Data)
@ kPictureAttributeSupported_Colour
QString GetHostname(void) const
void ShowOSDMenu(bool isCompact=false)
void SetExitPlayer(bool SetIt, bool WantsTo)
MythOverlayState m_overlayState
ChannelChangeDirection
ChannelChangeDirection is an enumeration of possible channel changing directions.
void ShowNoRecorderDialog(NoRecorderMsg MsgType=kNoRecorders)
volatile int m_lcdVolumeTimerId
void MenuLazyInit(void *Field)
bool TranslateKeyPressOrGesture(const QString &Context, QEvent *Event, QStringList &Actions, bool IsLiveTV, bool AllowJumps=true)
#define ACTION_TOGGLESUBS
void SetPseudoLiveTV(const ProgramInfo *pi, PseudoState new_state)
std::vector< int > m_ffRewSpeeds
static QString GetSourceName(uint sourceid)
QString GetRecordingGroup() const
static QList< QKeyEvent * > ConvertScreenPressKeyMap(const QString &KeyList)
void UpdateBookmark(bool Clear=false)
static bool QueueJob(int jobType, uint chanid, const QDateTime &recstartts, const QString &args="", const QString &comment="", QString host="", int flags=0, int status=JOB_QUEUED, QDateTime schedruntime=QDateTime())
ProgramInfo * GetLastProgram() const
void SetPlayingInfo(const ProgramInfo *info)
assign programinfo to the context
A QElapsedTimer based timer to replace use of QTime as a timer.
void UnpauseLiveTV(bool Quietly=false)
Used in ChangeChannel() to restart video output.
void DoTogglePauseFinish(float Time, bool ShowOSD)
static constexpr const char * OSD_DLG_CUTPOINT
#define ACTION_BOTTOMLINEMOVE
void ScheduleInputChange()
static constexpr const char * ACTION_SCREENSHOT
int to_track_type(const QString &str)
void ToggleChannelFavorite(const QString &changroupname)
void ChangeAspectOverride(AspectOverrideMode AspectMode=kAspect_Toggle)
void UpdateOSDProgInfo(const char *WhichInfo)
Update and display the passed OSD set with programinfo.
bool m_wantsToQuit
True if the user told MythTV to stop playback.
const QString kRecorderInUseID
QString GetZoomString(float HorizScale, float VertScale, QPoint Move)
static bool ChangeJobCmds(int jobID, int newCmds)
void HandleTeletextAction(const QString &Action, bool &Handled)
bool HandleTrackAction(const QString &Action)
bool IsInMenu(void) const override
bool IsPlayerPlaying(void) const
virtual int GetNumAngles(void) const
void HandleOSDAlreadyEditing(const QString &Action, bool WasPaused)
MythTimer m_keyRepeatTimer
Queue of unprocessed key presses.
bool IsWindowVisible(const QString &Window)
bool DialogIsVisible(const QString &Dialog)
float m_tsNormal
Time stretch speed, 1.0F for normal playback.
bool IsInStillFrame(void) const override
int m_tvmFreeRecorderCount
void SaveTotalFrames(int64_t frames)
Store the Total Frames at frame 0 in the recordedmarkup table.
uint m_initialChanID
Initial chanid override for Live TV.
void ChangeOSDText(const QString &Window, const InfoMap &Map, OSDTimeout Timeout)
bool m_underNetworkControl
initial show started via by the network control interface
void StartChannelEditMode()
Starts channel editing mode.
void emitTVPlaybackStopped(void)
void GetPartAndTitle(int &Part, int &Title) const
std::chrono::milliseconds m_sleepTimerTimeout
Current sleep timeout in msec.
#define ACTION_ZOOMVERTICALIN
#define ACTION_LISTRECORDEDEPISODES
static bool SetStartChannel(uint inputid, const QString &channum)
bool DialogHandleGesture(MythGestureEvent *Event)
Holds information on a TV Program one might wish to record.
bool HandleOSDVideoExit(const QString &Action)
uint m_dbAutoexpireDefault
int m_idleTimerId
Timer for turning off playback after idle period.
void OSDDialogEvent(int Result, const QString &Text, QString Action)
void GetCodecDescription(InfoMap &Map)
volatile int m_ccInputTimerId
bool m_savedPause
saved pause state before embedding
void emitTVPlaybackPlaying(void)
#define ACTION_TOGGLECHANCONTROLS
#define ACTION_TOGGELAUDIOSYNC
QString GetChannelName(int pos=-1) const
void ChangeOSDMessage(const QString &Message)
uint GetRecordingID(void) const
void ShowPreviousChannel()
void UpdateTVChain(const QStringList &data=QStringList())
void EnableVisualiser(bool Enable, bool Toggle=false, const QString &Name=QString())
QString GetID(void) const
bool IsPaused(void) const
bool RequestNextRecorder(bool ShowDialogs, const ChannelInfoList &Selection=ChannelInfoList())
void UpdateOSDSeekMessage(const QString &Msg, enum OSDTimeout Timeout)
QString GetChanNum(void) const
This is the channel "number", in the form 1, 1_2, 1-2, 1#1, etc.
static bool StateIsRecording(TVState State)
bool StartRecorder(std::chrono::milliseconds MaxWait=-1ms)
Starts recorder, must be called before StartPlayer().
bool GetEndOfRecording() const
This is set to true if the player reaches the end of the recording without the user explicitly exitin...
This class is used as a container for messages.
void CancelNextRecording(bool cancel)
#define ACTION_ENABLEUPMIX
void SleepDialogTimeout()
#define ACTION_TOGGLERECORD
int RemoteGetFreeRecorderCount(void)
void TeardownPlayer(void)
bool GetPlayingInfoMap(InfoMap &infoMap) const
#define BUTTON3(action, textActive, textInactive, isMenu)
FrameScanType NextScanOverride()
virtual int GetNumTitles(void) const
QList< QKeyEvent * > m_screenPressKeyMapPlayback
void customEvent(QEvent *Event) override
This handles all custom events.
volatile int m_errorRecoveryTimerId
void ResetWindow(const QString &Window)
QStringList m_visualiserList
static constexpr const char * OSD_DLG_SLEEP
virtual QString GetAngleName(int) const
QVariant value(int i) const
void DoTogglePause(bool ShowOSD)
static void RestoreScreensaver()
void ShowOSDAlreadyEditing()
QString GetChannelSchedulingID(void) const
This is the unique programming identifier of a channel.
static constexpr const char * ACTION_LEFT
bool HasQueuedChannel() const
bool isRunning(void) const
Returns true if start() or restart() has been called at least once since construction and since any c...
bool m_clearPosOnExit
False unless requested by user on playback exit.
QMap< uint64_t, MarkTypes > frm_dir_map_t
Frame # -> Mark map.
static constexpr const char * OSD_DLG_CONFIRM
void GetChapterTimes(QList< std::chrono::seconds > &Times)
@ kPictureAttribute_Contrast
QStringList m_tvmTracks[kTrackTypeCount]
QString formatTime(std::chrono::milliseconds msecs, QString fmt)
Format a milliseconds time value.
Internal representation of a recording rule, mirrors the record table.
void(*)(void *, bool) EMBEDRETURNVOID
void emitTVPlaybackStarted(void)
static constexpr const char * OSD_DLG_INFO
bool TimeStretchHandleAction(const QStringList &Actions)
bool ToggleHandleAction(const QStringList &Actions, bool IsDVD)
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
bool FFRewHandleAction(const QStringList &Actions)
static bool ExtractKey(const QString &uniquekey, uint &chanid, QDateTime &recstartts)
Extracts chanid and recstartts from a unique key generated by MakeUniqueKey().
QString GetPlayMessage(void) const
QString GetAngleName(int Angle)
void ChangeChannel(const ChannelInfoList &Options)
#define ACTION_TOGGLEPGORDER
#define ACTION_PREVRECORDED
void ChangeZoom(ZoomDirection Zoom)
static EMBEDRETURNVOIDEPG RunProgramGuidePtr
bool IsErrored(void) const
#define ACTION_ENABLESUBS
float GetFrameRate(void) const
bool ActiveHandleAction(const QStringList &Actions, bool IsDVD, bool IsDVDStillFrame)
void start(void)
starts measuring elapsed time.
std::chrono::minutes m_jumptime
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
static EMBEDRETURNVOIDSCHEDIT RunScheduleEditorPtr
#define ACTION_MENUYELLOW
void DoArbSeek(ArbSeekWhence Whence, bool HonorCutlist)
uint64_t GetCurrentFrameCount(void) const
bool IsPlaying(std::chrono::milliseconds wait_in_msec=0ms, bool wait_for=true) const
static uint Parse(const QString &vbiformat)
QString GetPreviousChannel(void) const
volatile int m_networkControlTimerId
void StartProgramEditMode()
Starts Program Cut Map Editing mode.
bool PictureAttributeHandleAction(const QStringList &Actions)
bool SubtitleZoomHandleAction(const QStringList &Actions)
#define BUTTON2(action, textActive, textInactive)
void StopStuff(bool StopRingBuffer, bool StopPlayer, bool StopRecorder)
Can shut down the ringbuffers, the players, and in LiveTV it can shut down the recorders.
#define ACTION_LOADCOMMSKIP
static uint GetMplexID(uint sourceid, const QString &channum)
void JumpTo(int num, std::chrono::seconds pos)
static ChannelGroupList GetChannelGroups(bool includeEmpty=true)
bool HandlePlayerSpeedChangeFFRew(void)
bool IsValidRecorder(void) const
void DoSwitchTitle(int Title)
void ChannelEditXDSFill(InfoMap &Info)
QString m_queuedInput
Input key presses queued up so far...
int ChangePictureAttribute(PictureAdjustType type, PictureAttribute attr, bool up)
Changes brightness/contrast/colour/hue of a recording.
void EnableCaptions(uint Mode, bool UpdateOSD=true)
static constexpr const char * OSD_DLG_DELETE
void StopPlaying(void) const
uint GetBrowseChanId(const QString &Channum, uint PrefCardid, uint PrefSourceid) const
Returns a chanid for the channum, or 0 if none is available.
virtual uint64_t GetBookmark(void)
std::chrono::seconds m_fftime
static uint GetNextChannel(const ChannelInfoList &sorted, uint old_chanid, uint mplexid_restriction, uint chanid_restriction, ChannelChangeDirection direction, bool skip_non_visible=true, bool skip_same_channum_and_callsign=false, bool skip_other_sources=false)
@ kPictureAttributeSupported_Volume
static constexpr const char * ACTION_SELECT
static const Type kEventType
QString GetRecordingGroup(void) const
#define ACTION_TOGGLEUPMIX
bool ShouldSwitchToAnotherCard(const QString &channelid)
Checks if named channel exists on current tuner, or another tuner. This only works on local recorders...
void emitTVPlaybackSought(qint64 position)
void SkipCommercials(int direction)
bool m_inPlaylist
show is part of a playlist
bool m_endOfRecording
!player->IsPlaying() && StateIsPlaying()
void ChangeTimeStretch(int Dir, bool AllowEdit=true)
static constexpr const char * OSD_WIN_MESSAGE
static bool StateIsLiveTV(TVState State)
#define ACTION_BOTTOMLINESAVE
#define ACTION_ZOOMASPECTDOWN
void GoToDVDProgram(bool Direction)
std::chrono::seconds GetTotalTimeOfTitle(void) const
get the total time of the title in seconds 90000 ticks = 1 sec
static TV * AcquireRelease(int &RefCount, bool Acquire, bool Create=false)
Statically create, destroy or check the existence of the TV instance.
void ToggleCaptionsByType(uint Type)
static constexpr const char * OSD_WIN_PROGEDIT
QMap< QString, ProgramList > m_progLists
void DeleteAllChildren(void)
Delete all child widgets.
bool GetLimitKeyRepeat(void) const
volatile int m_endOfRecPromptTimerId
def scan(profile, smoonURL, gate)
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
QRect m_playerBounds
Prior GUI window bounds, for DoEditSchedule() and player exit().
const QString & Message() const
void Embed(bool Embed, QRect Rect={}, const QStringList &Data={})
@ kState_Error
Error State, if we ever try to enter this state errored is set.
QDateTime GetRecordingStartTime(void) const
Approximate time the recording started.
QString GetPathname(void) const
@ kPictureAttributeSupported_None
static bool StartTV(ProgramInfo *TVRec, uint Flags, const ChannelInfoList &Selection=ChannelInfoList())
Start playback of media.
const MythTVMenu & getMenuFromId(MenuTypeId id)
void GoToMenu(const QString &Menu)
QString GetTitleName(int Title)
bool IsPlayerErrored(void) const
@ kOSDFunctionalType_TimeStretchAdjust
bool HandleOSDCutpoint(const QString &Action)
An action (for this plugin) consists of a description, and a set of key sequences.
std::vector< SignalMonitorValue > SignalMonitorList
void ApplyTranscoderProfileChange(const QString &profile) const
Sets the transcoder profile for a recording.
NoRecorderMsg
Type of message displayed in ShowNoRecorderDialog()
void SetAutoCommercialSkip(CommSkipMode autoskip)
bool m_dbEndOfRecExitPrompt
QHash< QString, QString > InfoMap
static void SortChannels(ChannelInfoList &list, const QString &order, bool eliminate_duplicates=false)
@ kState_ChangingState
This is a placeholder state which we never actually enter, but is returned by GetState() when we are ...
uint GetCardID(void) const
void addListener(QObject *listener)
Add a listener to the observable.
virtual bool SwitchTitle(int)
void PushPreviousChannel(void)
most recently selected channel to the previous channel list
QElapsedTimer m_lockTimer
@ kState_WatchingRecording
Watching Recording is the state for when we are watching an in progress recording,...
@ kPictureAttributeSupported_Brightness
float GetPlaySpeed(void) const
@ kState_None
None State, this is the initial state in both TV and TVRec, it indicates that we are ready to change ...
MythDisplay * GetDisplay()
static void DisableScreensaver()
void SwitchInputs(uint ChanID=0, QString ChanNum="", uint InputID=0)
void SetSpeedChangeTimer(std::chrono::milliseconds When, int Line)
static QString GetKey(const QString &Context, const QString &Action)
void PrepareToExitPlayer(int Line)
bool MenuItemDisplayPlayback(const MythTVMenuItemContext &Context, MythOSDDialogData *Menu)
#define BUTTON(action, text)
std::chrono::seconds secsInFuture(const QDateTime &future)
#define ACTION_ENABLEFORCEDSUBS
bool KeyLongPressFilter(QEvent **Event, QScopedPointer< QEvent > &NewEvent)
void UnregisterForPlayback(QObject *sender)
static void insert_map(InfoMap &infoMap, const InfoMap &newMap)
void(*)(TV *, bool, bool) EMBEDRETURNVOIDFINDER
uint m_sleepIndex
Index into sleep_times.
bool IsRecording(bool *ok=nullptr)
@ kPictureAttributeSupported_Contrast
static std::vector< uint > GetInputGroups(uint inputid)
static constexpr const char * OSD_WIN_STATUS
bool IsVideoBD(void) const
uint64_t GetFramesPlayed(void) const
float ComputeSecs(uint64_t position, bool use_cutlist) const
StringDeque m_prevChan
Previous channels.
#define ACTION_BIGJUMPREW
static void ToggleChannelFavorite()
void HandleOSDSleep(const QString &Action)
void HandlePseudoLiveTVTimerEvent()
#define ACTION_SETAUDIOSYNC
void AskAllowRecording(const QStringList &Msg, int Timeuntil, bool HasRec, bool HasLater)
#define ACTION_ZOOMCOMMIT
int getLCDWidth(void) const
QList< std::chrono::seconds > m_tvmChapterTimes
@ kDisplayNUVTeletextCaptions
volatile int m_signalMonitorTimerId
#define ACTION_SWITCHTITLE
static constexpr const char * OSD_WIN_PROGINFO
ChannelGroupList m_dbChannelGroups
void DoSwitchAngle(int Angle)
ChannelInfoList m_channelGroupChannelList
static int GetChanID(int db_mplexid, int service_transport_id, int major_channel, int minor_channel, int program_number)
QDateTime GetScheduledStartTime(void) const
The scheduled start time of program.
bool StartPlaying(std::chrono::milliseconds MaxWait=-1ms)
static bool IsJobQueuedOrRunning(int jobType, uint chanid, const QDateTime &recstartts)
MythTVMenu m_cutlistCompactMenu
static const std::chrono::milliseconds kInputModeTimeout
void ChangeSpeed(int Direction)
bool AudioSyncHandleAction(const QStringList &Actions)
static int GetCount(void)
void SetInitialTVState(bool islivetv)
determine initial tv state and playgroup for the recording
static bool IsPaused()
Check whether playback is paused.
void HandleVideoExitDialogTimerEvent()
int GetQueuedInputAsInt(bool *OK=nullptr, int Base=10) const
static int ConfiguredTunerCards()
If any cards are configured, return the number.
int Playback(const ProgramInfo &ProgInfo)
void ToggleOSD(bool IncludeStatusOSD)
Cycle through the available Info OSDs.
std::vector< InputInfo > RemoteRequestFreeInputInfo(uint excluded_input)
InfoMap m_chanEditMap
Channel Editing initial map.
static const uint kPreviousSource
#define ACTION_3DTOPANDBOTTOMDISCARD
static QStringList lastProgramStringList
@ kOSDFunctionalType_Default
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
bool RemoteIsBusy(uint inputid, InputInfo &busy_input)
bool MenuItemDisplay(const MythTVMenuItemContext &Context, MythOSDDialogData *Menu) override
uint m_queuedChanID
Queued ChanID (from EPG channel selector)
bool m_dbUseChannelGroups
void SetRecorder(RemoteEncoder *rec)
#define ACTION_TOGGLEEXTTEXT
AspectOverrideMode m_aspectOverrideMode
ProgramInfo * m_playingInfo
Currently playing info.
void ScheduleStateChange()
void AdjustSubtitleZoom(int Delta)
void HandleLCDVolumeTimerEvent()
static constexpr const char * ACTION_TVPOWERON
int m_idleDialogTimerId
Timer for idle dialog.
#define ACTION_ENABLEVISUALISATION
void(*)(const ProgramInfo *, void *) EMBEDRETURNVOIDSCHEDIT
void SetManualZoom(bool ZoomON, const QString &Desc)
QRecursiveMutex m_chanEditMapLock
Lock for chanEditMap and ddMap.
void HandleEndOfRecordingExitPromptTimerEvent()
void SendSystemEvent(const QString &msg)
void EditSchedule(int EditType=kScheduleProgramGuide)
QHash< QString, int > values
@ kState_WatchingVideo
Watching Video is the state when we are watching a video and is not a dvd or BD.
bool eventFilter(QObject *Object, QEvent *Event) override
Prevent events from being sent to another object.
void SpawnLiveTV(const QString &chainid, bool pip, const QString &startchan)
Tells TVRec to Spawn a "Live TV" recorder.
bool m_stretchAdjustment
True if time stretch is turned on.
#define ACTION_DISABLEEXTTEXT
CommSkipMode GetAutoCommercialSkip(void)
#define ACTION_SEEKABSOLUTE
void LockPlayingInfo(const char *file, int line) const
void DoSeekAbsolute(long long Seconds, bool HonorCutlist)
bool m_dbRememberLastChannelGroup
std::chrono::milliseconds m_timecode
void ShowOSDCutpoint(const QString &Type)
void ChangeAllowForcedSubtitles(bool Allow)
#define ACTION_PREVSUBPAGE
int StartTimer(std::chrono::milliseconds Interval, int Line)
virtual std::chrono::seconds GetTitleDuration(int) const
static MythThemedMenu * menu
QString GetTitle(void) const
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
void ChangeAdjustFill(AdjustFillMode FillMode=kAdjustFill_Toggle)
std::chrono::seconds m_rewtime
void setUnderNetworkControl(bool setting)
bool ManualZoomHandleAction(const QStringList &Actions)
@ kOSDFunctionalType_SmartForward
bool GoBack(void)
Attempts to back-up by trying to jump to the 'Go up' PGC, the root menu or the title menu in turn.
MythVisualiserState m_visualiserState
std::chrono::seconds GetTitleDuration(int Title)
MythMediaBuffer * m_buffer
@ kOSDFunctionalType_SubtitleDelayAdjust
static EMBEDRETURNVOID RunPlaybackBoxPtr
void ChangeChannel(int channeldirection)
void SetTeletextPage(uint Page)
@ kStereoscopicModeIgnore3D
static const std::chrono::milliseconds kSpeedChangeCheckFrequency
void BrowseInit(std::chrono::seconds BrowseMaxForward, bool BrowseAllTuners, bool UseChannelGroups, const QString &DBChannelOrdering)
static const std::chrono::milliseconds kKeyRepeatTimeout
#define ACTION_CHANNELSEARCH
uint GetSourceID(void) const
@ kTrackTypeTeletextCaptions
void SetLiveRecording(bool recording)
void SetIgnoreLastPlayPos(bool ignore)
If "ignore" is true QueryLastPlayPos() will return 0, otherwise QueryLastPlayPos() will return the la...
void HandleITVAction(const QString &Action, bool &Handled)
PlayerContext m_playerContext
#define ACTION_TOGGLEOSDDEBUG
#define ACTION_ZOOMHORIZONTALOUT
void RestartITV(uint Chanid, uint Cardid, bool IsLiveTV)
ProgramInfo * m_pseudoLiveTVRec
QStringList GetTracks(uint Type)
volatile int m_pseudoChangeChanTimerId
void ShowOSDIdle()
After idleTimer has expired, display a dialogue warning the user that we will exit LiveTV unless they...
@ kAdjustingPicture_Playback
#define ACTION_JUMPTODVDTITLEMENU
static void showStatus(void)
static const Type kUpdateTvProgressEventType
@ kNoRecorders
No free recorders.
MythTVMenu m_playbackCompactMenu
void QuickRecord(void)
Create a kSingleRecord if not already scheduled.
static const std::chrono::milliseconds kEndOfPlaybackFirstCheckTimer
void HideAll(bool KeepSubs=true, MythScreenType *Except=nullptr, bool DropNotification=false)
static const std::chrono::milliseconds kSleepTimerDialogTimeout
uint GetSignalLockTimeout(const QString &input)
QString m_queuedChanNum
Input key presses queued up so far to form a valid ChanNum.
bool m_savePosOnExit
False until first timer event.
QString toString(Verbosity v=kLongDescription, const QString &sep=":", const QString &grp="\"") const
void LockDeletePlayer(const char *file, int line) const
prevent MythPlayer from being deleted used to ensure player can only be deleted after osd in TV() is ...
SleepTimerInfo(QString String, std::chrono::milliseconds MilliSeconds)
void PlaybackMenuShow(const MythTVMenu &Menu, const QDomNode &Node, const QDomNode &Selected)
QString GetQueuedInput() const
bool MenuItemDisplayCutlist(const MythTVMenuItemContext &Context, MythOSDDialogData *Menu)
static constexpr const char * OSD_DLG_IDLE
void SetCaptionsEnabled(bool Enable, bool UpdateOSD=true)
void HandleSpeedChangeTimerEvent()
void run(const QString &name, Class *object, void(Class::*fn)())
virtual void ToMap(InfoMap &progMap, bool showrerecord=false, uint star_range=10, uint date_format=0) const
Converts ProgramInfo into QString QHash containing each field in ProgramInfo converted into localized...
void GetResolutionSetting(const QString &type, int &width, int &height, double &forced_aspect, double &refresh_rate, int index=-1)
void PopPreviousChannel(bool ImmediateChange)
void DoEditSchedule(int EditType=kScheduleProgramGuide)
std::deque< QString > StringDeque
static bool IsTunable(uint ChanId)
void RegisterForPlayback(QObject *sender, PlaybackStartCb method)
static const uint kInputKeysMax
void SetLastProgram(const ProgramInfo *ProgInfo)
@ kPictureAttribute_Brightness
@ kStereoscopicModeTopAndBottomDiscard
#define ACTION_ZOOMVERTICALOUT
void SetFunctionalWindow(const QString &Window, enum OSDFunctionalType Type)
static uint get_chanid(const PlayerContext *ctx, uint cardid, const QString &channum)
AdjustFillMode m_adjustFillMode
std::chrono::seconds m_playingLen
Initial CalculateLength()
bool m_asInputMode
Are we in Arbitrary seek input mode?
#define ACTION_ENABLEEXTTEXT
PictureAttribute next_picattr(PictureAttributeSupported Supported, PictureAttribute Attribute)
volatile int m_lcdTimerId
#define ACTION_SETBRIGHTNESS
bool ProcessSmartChannel(QString &InputStr)
QWidget * GetPaintWindow()
static const std::chrono::milliseconds kEndOfRecPromptCheckFrequency
void ToggleMoveBottomLine()
QString GetPlaybackGroup(void) const
void HandleEndOfPlaybackTimerEvent()
#define ACTION_TOGGLESLEEP
virtual bool SwitchAngle(int)
void AddKeyToInputQueue(char Key)
static constexpr const char * OSD_DLG_VIDEOEXIT
@ kDisplayRawTextSubtitle
QString toTypeString(PictureAdjustType type)
#define TRANSITION(ASTATE, BSTATE)
void HandleOSDClosed(int OSDType)
static constexpr const char * ACTION_TVPOWEROFF
#define ACTION_DISABLEFORCEDSUBS
std::chrono::milliseconds milliseconds
MythVideoBoundsState m_videoBoundsState
bool GetEditMode(void) const
static ChannelInfoList GetChannels(uint sourceid, bool visible_only, const QString &group_by=QString(), uint channel_groupid=0)
@ CHANNEL_DIRECTION_FAVORITE
void PlaybackMenuInit(const MythTVMenu &Menu)
bool IsSameProgram(const ProgramInfo &p) const
void ShowOSDStopWatchingRecording()
virtual void GetChapterTimes(QList< std::chrono::seconds > ×)
RemoteEncoder * m_switchToRec
Main recorder to use after a successful SwitchCards() call.
static constexpr const char * OSD_DLG_NAVIGATE
int NumPartsInTitle(void) const
void UpdateProgress(void)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
virtual int GetCurrentAngle(void) const
void(*)(uint, const QString &, const QDateTime, TV *, bool, bool, int) EMBEDRETURNVOIDEPG
void ChangeAudioOffset(std::chrono::milliseconds Delta, std::chrono::milliseconds Value=-9999ms)
void InitialisePlayerState()
PictureAttributeSupported m_supportedAttributes
bool m_allowRerecord
User wants to rerecord the last video if deleted.
void FillOSDMenuJumpRec(const QString &Category="", int Level=0, const QString &Selected="")
void UnlockDeletePlayer(const char *file, int line) const
allow player to be deleted.
bool GetAllowForcedSubtitles(void) const
QString PopPreviousChannel(void)
MythTimer m_lastSignalUIInfoTime
TvPlayWindow * m_myWindow
Our screen, if it exists.
@ BROWSE_DOWN
Fetch information on next channel.
void ShowLCDChannelInfo()
int64_t QueryTotalFrames(void) const
If present in recording this loads total frames of the main video stream from database's stream marku...
int GetNumSetting(const QString &key, int defaultval=0)
#define ACTION_SETBOOKMARK
void BrowseDispInfo(const BrowseInfo &Browseinfo)
void DisableEdit(int HowToSave)
void HandleOSDAskAllow(const QString &Action)
static constexpr const char * OSD_WIN_INPUT
bool ContextIsPaused(const char *File, int Location)
QRecursiveMutex m_askAllowLock
@ kOSDFunctionalType_SubtitleZoomAdjust
static MythDB * getMythDB()
static constexpr const char * OSD_DLG_EDITOR
#define ACTION_DISABLESUBS
void SaveAutoExpire(AutoExpireType autoExpire, bool updateDelete=false)
Set "autoexpire" field in "recorded" table to "autoExpire".
void AdjustSubtitleDelay(std::chrono::milliseconds Delta)
static bool SysEventHandleAction(MythMainWindow *MainWindow, QKeyEvent *e, const QStringList &actions)
MythCaptionsState m_captionsState
@ BROWSE_RIGHT
Fetch information on current channel in the future.
static bool IsTVRunning()
Check whether media is currently playing.
static const std::chrono::milliseconds kIdleTimerDialogTimeout
bool CheckChannelPrefix(const QString &prefix, uint &complete_valid_channel_on_rec, bool &is_extra_char_useful, QString &needed_spacer)
Checks a prefix against the channels in the DB.
@ kPictureAttribute_Range
void HandleOSDInfo(const QString &Action)
bool m_dbContinueEmbedded
void SetTrack(uint Type, uint TrackNo)
BrowseInfo GetBrowsedInfo() const
QDateTime fromString(const QString &dtstr)
Converts kFilename && kISODate formats to QDateTime.
bool CalcPlayerSliderPosition(osdInfo &info, bool paddedFields=false) const
void JumpChapter(int chapter)
virtual int GetNumChapters(void)
bool HasQueuedInput() const
PictureAttribute NextPictureAdjustType(PictureAdjustType Type, PictureAttribute Attr)
static constexpr const char * ACTION_UP
bool GetBoolSetting(const QString &key, bool defaultval=false)
bool ActivePostQHandleAction(const QStringList &Actions)
#define ACTION_ZOOMASPECTUP
void ChannelEditAutoFill(InfoMap &Info)
Automatically fills in as much information as possible.
virtual int GetCurrentTitle(void) const
QString GetError(void) const
@ BROWSE_FAVORITE
Fetch information on the next favorite channel.
@ kState_WatchingPreRecorded
Watching Pre-recorded is a TV only state for when we are watching a pre-existing recording.
void LockState(void) const
PseudoState m_pseudoLiveTVState
void ReturnOSDLock() const
#define ACTION_3DSIDEBYSIDEDISCARD
std::vector< MythOSDDialogButton > m_buttons
static QString tv_i18n(const QString &msg)
bool HandleLCDTimerEvent()
void HideOSDWindow(const char *window)
bool m_ccInputMode
Are we in CC/Teletext page/stream selection mode?
void ClearInputQueues(bool Hideosd)
Clear channel key buffer of input keys.
bool HandleOSDChannelEdit(const QString &Action)
Processes channel editing key.
bool LiveTV(bool ShowDialogs, const ChannelInfoList &Selection)
Starts LiveTV.
@ kOSDFunctionalType_AudioSyncAdjust
QString GetInputType(int pos=-1) const
@ kState_WatchingBD
Watching BD is the state when we are watching a BD.
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
static QString GET_KEY(const QString &Context, const QString &Action)
void EnableTeletext(int Page=0x100)
void ReturnPlayerLock() const
AutoExpireType QueryAutoExpire(void) const
Returns "autoexpire" field from "recorded" table.
void ShowOSDPromptDeleteRecording(const QString &Title, bool Force=false)
static const uint kNextSource
@ kState_WatchingDVD
Watching DVD is the state when we are watching a DVD.
int GetValue(PictureAttribute Attribute)
void SetWatchingRecording(bool mode)
static QString GetIcon(uint chanid)
Holds information on recordings and videos.
bool LoadTemplate(const QString &title, const QString &category="Default", const QString &categoryType="Default")
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
static const std::vector< SleepTimerInfo > s_sleepTimes
void OverrideScan(FrameScanType Scan)
void VolumeChange(bool Up, int NewVolume=-1)
volatile int m_exitPlayerTimerId
QDateTime m_lastLockSeenTime
bool NextModeIsLarger(QSize Size)
Check whether the next mode is larger in size than the current mode.
void ResizeScreenForVideo(QSize Size={})
@ kPictureAttributeSupported_Range
#define ACTION_MENUCOMPACT
static constexpr const char * ACTION_GETSTATUS
bool m_subtitleDelayAdjustment
True if subtitle delay is turned on.
#define ACTION_OSDNAVIGATION
static constexpr const char * ACTION_RIGHT
void ChangeUpmix(bool Enable, bool Toggle=false)
#define ACTION_TOGGLEVISUALISATION
TVState
TVState is an enumeration of the states used by TV and TVRec.
volatile int m_asInputTimerId
void SetChannel(const QString &channel)
Dialog asking for user confirmation. Ok and optional Cancel button.
void ToStringList(QStringList &list) const
Serializes ProgramInfo into a QStringList which can be passed over a socket.
bool OptionalCaptionEnabled(uint Captions)
Return whether any optional captions are enabled.
static QString add_spacer(const QString &chan, const QString &spacer)
void SetScanOverride(FrameScanType Scan)
void SendMythSystemPlayEvent(const QString &msg, const ProgramInfo *pginfo)
void timerEvent(QTimerEvent *Event) override
bool m_sigMonMode
Are we in signal monitoring mode?
bool m_ignoreKeyPresses
should we ignore keypresses
bool CreatePlayer(TVState State, bool Muted=false)
PlayerContext * GetPlayerContext()
Return a pointer to TV::m_playerContext.
void HandleOSDIdle(const QString &Action)
bool QueryIsEditing(void) const
Queries "recorded" table for its "editing" field and returns true if it is set to true.
const QString kPlayerInUseID
bool SwitchToGUI(bool Wait=false)
Switches to the GUI resolution.
void ChangeOSDPositionUpdates(bool Enable)
MythTimer m_lastSignalMsgTime
volatile int m_channelGroupId
@ kAdjustingPicture_Recording
void SetIgnoreBookmark(bool ignore)
If "ignore" is true GetBookmark() will return 0, otherwise GetBookmark() will return the bookmark pos...
void SwitchSource(uint Direction)
bool IsFileReadable(void)
Attempts to ascertain if the main file for this ProgramInfo is readable.
@ kOSDFunctionalType_PictureAdjust
QVariant m_tvmJumprecBackHack
QString toTitleString(PictureAdjustType type)
virtual QString GetTitleName(int) const
bool GetNameAndSerialNum(QString &Name, QString &SerialNumber) override
Get the dvd title and serial num.
QString GetPlaybackURL(bool checkMaster=false, bool forceCheckLocal=false)
Returns filename or URL to be used to play back this recording.
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
#define ACTION_JUMPTODVDROOTMENU
static uint GetSourceIDForChannel(uint chanid)
MythEditorState m_editorState
#define ACTION_JUMPTOPOPUPMENU
static const std::chrono::milliseconds kErrorRecoveryCheckFrequency
void SetPlayer(MythPlayer *newplayer)
void UpdateChannelList(int GroupID)
update the channel list with channels from the selected channel group
void StopLiveTV(void)
Tells TVRec to stop a "Live TV" recorder.
void PlaybackExiting(TV *Player)
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
uint64_t TranslatePositionMsToFrame(std::chrono::milliseconds position, bool use_cutlist) const
StereoscopicMode ActionToStereoscopic(const QString &Action)
RemoteEncoder * RemoteRequestFreeRecorderFromList(const QStringList &qualifiedRecorders, uint excluded_input)
void emitTVPlaybackPaused(void)
void GetChannelInfo(InfoMap &infoMap, uint chanid=0)
void SetRingBuffer(MythMediaBuffer *Buffer)
This is the coordinating class of the Recorder Subsystem.
void PauseLiveTV()
Used in ChangeChannel() to temporarily stop video output.
MythAudioState m_audioState
static void MenuStrings()
FrameScanType GetScanTypeWithOverride() const
void ChangeMuteState(bool CycleChannels=false)
int m_ffRewSpeed
Caches value of m_ffRewSpeeds[m_ffRewIndex].
@ kAdjustFill_AutoDetect_DefaultHalf
volatile int m_speedChangeTimerId
void EmbedPlayback(bool Embed, const QRect &Rect={})
float DoTogglePauseStart()
static EMBEDRETURNVOID RunViewScheduledPtr
bool event(QEvent *Event) override
This handles all standard events.
MythNotificationCenter * GetNotificationCenter(void)
@ kStartTVIgnoreLastPlayPos
TVState DequeueNextState(void)
bool IsVideoDVD(void) const
#define ACTION_TOGGLERECCONTROLS
int m_sleepDialogTimerId
Timer for sleep dialog.
bool InStateChange(void) const
static void SetFuncPtr(const char *Name, void *Pointer)
Import pointers to functions used to embed the TV window into other containers e.g.
static const Type kEventType
static uint GetSourceID(uint inputid)
void HideWindow(const QString &Window) override
static const std::array< const mark, 16 > marks
#define ACTION_TOGGLEBOOKMARK
bool DiscMenuHandleAction(const QStringList &Actions) const
volatile int m_saveLastPlayPosTimerId
void exit(int retcode=0)
Use this to exit from the thread if you are using a Qt event loop.
void UpdateOSDStatus(const QString &Title, const QString &Desc, const QString &Value, int Type, const QString &Units, int Position=0, enum OSDTimeout Timeout=kOSDTimeout_Med)
MythMainWindow * m_mainWindow
MythMainWindow * GetMythMainWindow(void)
bool IsVideoFile(void) const
QMutex m_channelGroupLock
Lock necessary when modifying channel group variables.
@ kState_WatchingLiveTV
Watching LiveTV is the state for when we are watching a recording and the user has control over the c...
void UpdateOSDSignal(const QStringList &List)
Updates Signal portion of OSD...
void DoTogglePictureAttribute(PictureAdjustType Type)
void RemoteCancelNextRecording(uint inputid, bool cancel)
bool m_weDisabledGUI
true if this instance disabled MythUI drawing.
void SetCommBreakMap(const frm_dir_map_t &NewMap)
static const int kInitFFRWSpeed
void ForceNextStateNone()
void DisableCaptions(uint Mode, bool UpdateOSD=true)
void TVInWantingPlayback(bool b)
Let the TV class tell us if we was interrupted following a call to WantingPlayback().
PictureAttributeSupported toMask(PictureAttribute PictureAttribute)
StereoscopicMode m_stereoOverride
bool HasPlayer(void) const
void BrowseChannel(const QString &Channum)
QAtomicInt m_referenceCount
std::chrono::duration< CHRONO_TYPE, std::ratio< 1, 90000 > > pts
void SetWatched(bool ForceWatched=false)
Determines if the recording should be considered watched.
bool CheckChannel(const QString &channel)
Checks if named channel exists on current tuner.
void ChangeCaptionTrack(int Direction)
bool IsExitingToMain() const
bool HasSoftwareFrames() const
int m_dbPlaybackExitPrompt
void SetValues(const QString &Window, const QHash< QString, int > &Map, OSDTimeout Timeout)
void SetProgram(const ProgramInfo &pginfo)
void PlaybackMenuDeinit(const MythTVMenu &Menu)
QList< QKeyEvent * > m_screenPressKeyMapLiveTV
MythTVMenu m_playbackMenu
MythDeque< TVState > m_nextState
MythScreenStack * GetStack(const QString &Stackname)
ProgramInfo * m_lastProgram
last program played with this player
#define ACTION_BIGJUMPFWD
void WantingPlayback(QObject *sender)
All the objects that have registered using MythCoreContext::RegisterForPlayback but sender will be ca...
@ kPictureAttributeSupported_Hue
void DoQueueTranscode(const QString &Profile)
bool DoPlayerSeekToFrame(uint64_t FrameNum)
void SetInPlayList(bool InPlayList)
volatile int m_queueInputTimerId
CommSkipMode m_tvmCurSkip
void ClearKeyContext(const QString &Context)
bool DialogHandleKeypress(QKeyEvent *Event)
virtual bool JumpToFrame(uint64_t frame)
MythVideoColourState m_videoColourState
QString GetHostName(void)
int m_tvmCurtrack[kTrackTypeCount]
bool HandleProgramEditorActions(const QStringList &Actions)
void SetIgnoreProgStart(bool ignore)
If "ignore" is true QueryProgStart() will return 0, otherwise QueryProgStart() will return the progst...
static MythNotificationCenter * GetInstance(void)
returns the MythNotificationCenter singleton
static QStringList GetValidRecorderList(uint chanid, const QString &channum)
Returns list of the recorders that have chanid or channum in their sources.
static bool AllGood(const SignalMonitorList &slist)
Returns true if all the values in the list return true on IsGood().
QString GetProgramID(void) const
void DoSeek(float Time, const QString &Msg, bool TimeIsOffset, bool HonorCutlist)
bool QueryIsInUse(QStringList &byWho) const
Returns true if Program is in use.
void DoJumpChapter(int Chapter)
A custom event that represents a mouse gesture.
QString StateToString(TVState state)
Returns a human readable QString representing a TVState.
#define ACTION_TOGGLESUBTITLEZOOM
static const std::chrono::milliseconds kLCDTimeout
void MoveResize(QRect &Geometry)
#define ACTION_JUMPTODVDCHAPTERMENU
QString GetXDS(const QString &key) const
int GetPictureAttribute(PictureAttribute attr)
bool HandlePlayerSpeedChangeEOF(void)
void ChangeVolume(bool Direction, int Volume)
#define ACTION_DISABLEVISUALISATION
virtual bool UsingVideoModes()
std::chrono::milliseconds m_dbIdleTimeout
PictureAttribute m_adjustingPictureAttribute
Picture attribute to modify (on arrow left or right)
void GetPlayerReadLock() const
void SetBookmark(bool Clear=false)
uint GetTrackCount(uint Type)
RemoteEncoder * m_recorder
void SaveSetting(const QString &key, int newValue)
bool BrowseHandleAction(const QStringList &Actions)
int m_sleepTimerId
Timer for turning off playback.
std::vector< ProgramInfo * > * RemoteGetRecordedList(int sort)
static bool IsExiting(void)
@ kAdjustFill_AutoDetect_DefaultOff
static QString GetChanNum(int chan_id)
Returns the channel-number string of the given channel.
void ChangeStereoOverride(StereoscopicMode Mode)
void enqueue(T d)
Adds item to the back of the list. O(1).
void UnlockState(void) const
static constexpr const char * OSD_DLG_EDITING
@ kPictureAttribute_Volume
void ChangeFFRew(int Direction)
bool GetAllowRerecord() const
Returns true if the user told Mythtv to allow re-recording of the show.
#define ACTION_VOLUMEDOWN
static const int kScreenPressRegionCount
screen area to keypress translation region is now 0..11 0 1 2 3 4 5 6 7 8 9 10 11
#define ACTION_CHANNELDOWN
Simple screen shown while the video player is starting up.
void ApplyRecordRecGroupChange(const QString &newrecgroup)
Sets the recording group, both in this RecordingInfo and in the database.
QString GetQueuedChanNum() const
int m_ffRewState
0 == normal, +1 == fast forward, -1 == rewind
@ kStartTVByNetworkCommand
#define ACTION_NEXTSUBPAGE
#define ACTION_EXITSHOWNOPROMPTS
bool IsRecording(void) const
std::chrono::milliseconds m_audioOffset
void PauseRecorder(void)
Tells TVRec to pause a recorder, used for channel and input changes.
T dequeue()
Removes item from front of list and returns a copy. O(1).
static bool ScreenShot(int Width=0, int Height=0, QString Filename="")
QString GetBasename(void) const
virtual int IncrRef(void)
Increments reference count.
MythDeque< QString > m_networkControlCommands
void WindowResized(const QSize &Size)
bool DoSetPauseState(bool Pause)
void PauseAudioUntilReady()
bool DoPlayerSeek(float Time)
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
#define ACTION_JUMPCHAPTER
uint GetQueuedChanID() const
void DoSkipCommercials(int Direction)
void dispatch(const MythEvent &event)
QString GetActionText(const QString &Context, const QString &Action) const
void setChannelProgress(const QString &time, float value)
static constexpr const char * OSD_DLG_ASKALLOW
bool BrowseStart(bool SkipBrowse=false)
Begins channel browsing.
static const std::chrono::milliseconds kVideoExitDialogTimeout
@ kStereoscopicModeSideBySideDiscard
bool m_audiosyncAdjustment
True if audiosync is turned on.
@ kState_RecordingOnly
Recording Only is a TVRec only state for when we are recording a program, but there is no one current...
virtual bool FastForward(float seconds)
void removeListener(QObject *listener)
Remove a listener to the observable.
bool ProcessKeypressOrGesture(QEvent *Event)
#define ACTION_TOGGLEBACKGROUND
void ChangeState(TVState newState)
Puts a state change on the nextState queue.
virtual void UpdateSliderInfo(osdInfo &Info, bool PaddedFields=false)
#define ACTION_SWITCHANGLE
bool Init()
Performs instance initialization, returns true on success.
static QString GetStartChannel(uint inputid)
void UpdateLastPlayPosition(uint64_t frame)
void ToggleDetectLetterBox()
bool Play(float speed=1.0, bool normal=true, bool unpauseaudio=true)
General purpose reference counter.
static EMBEDRETURNVOIDFINDER RunProgramFinderPtr
bool SubtitleDelayHandleAction(const QStringList &Actions)
@ kNoCurrRec
No current recordings.
bool HasPathname(void) const
void UpdateOSDTimeoutMessage()
PictureAdjustType m_adjustingPicture
Picture attribute type to modify.
volatile int m_videoExitDialogTimerId
static pid_list_t::iterator find(const PIDInfoMap &map, pid_list_t &list, pid_list_t::iterator begin, pid_list_t::iterator end, bool find_open)
void PlaybackLoop()
The main playback loop.
void SaveLastPlayPos(uint64_t frame)
TODO Move to RecordingInfo.
bool GetJumpToProgram() const
This is set if the user asked MythTV to jump to the previous recording in the playlist.
uint64_t TranslatePositionRelToAbs(uint64_t position) const
void PauseIdleTimer(bool Pause)
Pause the idle timeout timer.
void emitTVPlaybackAborted(void)
void ChangeTrack(uint Type, int Direction)
static QVector< uint > IsTunableOn(PlayerContext *Context, uint ChanId)
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.
void ForceNextStateNone(void)
Removes any pending state changes, and puts kState_None on the queue.
void IsOSDVisible(bool &Visible)
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
bool TranslateGesture(const QString &Context, MythGestureEvent *Event, QStringList &Actions, bool IsLiveTV)
RemoteEncoder * RemoteRequestNextFreeRecorder(int inputid)
virtual MythScreenType * GetTopScreen(void) const
@ kPictureAttribute_Colour
QMap< QString, AskProgramInfo > m_askAllowPrograms
QString GetSubtitle(void) const
virtual bool Rewind(float seconds)
bool Queue(const MythNotification ¬ification)
Queue a notification Queue() is thread-safe and can be called from anywhere.
virtual int GetCurrentChapter(void)
std::vector< ChannelInfo > ChannelInfoList
@ kDisplayTeletextCaptions
@ kNoTuners
No capture cards configured.
QString m_dbChannelFormat