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"
78 #define DEBUG_CHANNEL_PREFIX 0
79 #define DEBUG_ACTIONS 0
81 #define LOC QString("TV::%1(): ").arg(__func__)
93 return (dt1 > dt2 ? 1 : -1);
123 query.
prepare(
"SELECT COUNT(cardid) FROM capturecard;");
125 count = query.
value(0).toInt();
127 LOG(VB_RECORD, LOG_INFO,
128 "ConfiguredTunerCards() = " + QString::number(count));
142 static QMutex s_lock;
143 static TV* s_tv =
nullptr;
144 QMutexLocker locker(&s_lock);
156 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Ref count error");
202 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Already have a player");
208 auto flags =
static_cast<PlayerFlags>(playerflags);
241 LOG(VB_GENERAL, LOG_ERR,
LOC +
"StartPlaying() Failed to start player");
246 MaxWait = (MaxWait <= 0ms) ? 20s : MaxWait;
247 #ifdef USING_VALGRIND
248 MaxWait = std::chrono::milliseconds::max();
249 #endif // USING_VALGRIND
258 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
259 QString(
"StartPlaying(): took %1 ms to start player.")
260 .arg(
t.elapsed().count()));
263 LOG(VB_GENERAL, LOG_ERR,
LOC +
"StartPlaying() Failed to start player");
295 LOG(VB_GENERAL, LOG_WARNING,
LOC +
"Already have a TV object.");
300 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"-- begin");
303 bool quitAll =
false;
304 bool showDialogs =
true;
305 bool playCompleted =
false;
307 bool startSysEventSent =
false;
308 bool startLivetvEventSent =
false;
321 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Failed initializing TV");
343 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"tv->Playback() -- begin");
348 else if (!startSysEventSent)
350 startSysEventSent =
true;
354 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"tv->Playback() -- end");
358 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"tv->LiveTV() -- begin");
359 if (!tv->
LiveTV(showDialogs, Selection))
364 else if (!startSysEventSent)
366 startSysEventSent =
true;
367 startLivetvEventSent =
true;
371 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"tv->LiveTV() -- end");
376 LOG(VB_GENERAL, LOG_ERR,
LOC +
"No tuners configured");
378 LOG(VB_GENERAL, LOG_ERR,
LOC +
"No tuners free for live tv");
389 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Entering main playback loop.");
391 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Exiting main playback loop.");
399 curProgram = nextProgram;
413 quitAll |= !playerError.isEmpty();
416 QCoreApplication::processEvents();
420 playCompleted =
true;
430 if (startSysEventSent)
438 list.push_back(allowrerecord ?
"1" :
"0");
439 MythEvent me(
"LOCAL_PBB_DELETE_RECORDINGS", list);
450 else if (startSysEventSent)
455 if (!playerError.isEmpty())
465 if (startLivetvEventSent)
468 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"-- end");
470 return playCompleted;
480 if (name ==
"playbackbox")
482 else if (name ==
"viewscheduled")
484 else if (name ==
"programguide")
486 else if (name ==
"programfinder")
488 else if (name ==
"scheduleeditor")
490 else if (name ==
"programlist")
497 "Play Program"),
"P,Media Play");
499 "Stop Program"),
"");
501 "Toggle recording status of current program"),
"R");
503 "Page the program guide back one day"),
"Home,Media Previous");
505 "Page the program guide forward one day"),
"End,Media Next");
507 "Page the program guide left"),
",,<,Ctrl+B,Media Rewind");
509 "Page the program guide right"),
">,.,Ctrl+F,Media Fast Forward");
511 "Toggle the current channel as a favorite"),
"?");
513 "Reverse the channel order in the program guide"),
"");
515 "Show the Program Guide"),
"S");
517 "Show the Program Finder"),
"#");
519 "Show the Channel Search"),
"");
520 REG_KEY(
"TV Frontend",
"NEXTFAV", QT_TRANSLATE_NOOP(
"MythControls",
521 "Cycle through channel groups and all channels in the "
522 "program guide."),
"/");
523 REG_KEY(
"TV Frontend",
"CHANUPDATE", QT_TRANSLATE_NOOP(
"MythControls",
524 "Switch channels without exiting guide in Live TV mode."),
"X");
526 "Volume down"),
"[,{,F10,Volume Down");
528 "Volume up"),
"],},F11,Volume Up");
530 "Mute"),
"|,\\,F9,Volume Mute");
531 REG_KEY(
"TV Frontend",
"CYCLEAUDIOCHAN", QT_TRANSLATE_NOOP(
"MythControls",
532 "Cycle audio channels"),
"");
533 REG_KEY(
"TV Frontend",
"RANKINC", QT_TRANSLATE_NOOP(
"MythControls",
534 "Increase program or channel rank"),
"Right");
535 REG_KEY(
"TV Frontend",
"RANKDEC", QT_TRANSLATE_NOOP(
"MythControls",
536 "Decrease program or channel rank"),
"Left");
537 REG_KEY(
"TV Frontend",
"UPCOMING", QT_TRANSLATE_NOOP(
"MythControls",
538 "List upcoming episodes"),
"O");
540 "List scheduled upcoming episodes"),
"");
542 "List previously recorded episodes"),
"");
543 REG_KEY(
"TV Frontend",
"DETAILS", QT_TRANSLATE_NOOP(
"MythControls",
544 "Show details"),
"U");
545 REG_KEY(
"TV Frontend",
"VIEWINPUT", QT_TRANSLATE_NOOP(
"MythControls",
546 "Switch Recording Input view"),
"C");
547 REG_KEY(
"TV Frontend",
"CUSTOMEDIT", QT_TRANSLATE_NOOP(
"MythControls",
548 "Edit Custom Record Rule"),
"");
549 REG_KEY(
"TV Frontend",
"CHANGERECGROUP", QT_TRANSLATE_NOOP(
"MythControls",
550 "Change Recording Group"),
"");
551 REG_KEY(
"TV Frontend",
"CHANGEGROUPVIEW", QT_TRANSLATE_NOOP(
"MythControls",
552 "Change Group View"),
"");
554 "List recorded episodes"),
"");
574 if (selectKeys !=
"?")
577 togBkmKeys = selectKeys;
579 bkmKeys = selectKeys;
583 "Add Bookmark"), bkmKeys);
585 "Toggle Bookmark"), togBkmKeys);
586 REG_KEY(
"TV Playback",
"BACK", QT_TRANSLATE_NOOP(
"MythControls",
587 "Exit or return to DVD menu"),
"Esc,Back");
589 "Playback Compact Menu"),
"Alt+M");
591 "Clear OSD"),
"Backspace");
593 "Pause"),
"P,Space,Media Play");
595 "Fast Forward"),
"Right");
599 "Arbitrary Seek"),
"*");
601 "Seek to a position in seconds"),
"");
603 "Channel up"),
"Up");
605 "Channel down"),
"Down");
606 REG_KEY(
"TV Playback",
"NEXTFAV", QT_TRANSLATE_NOOP(
"MythControls",
607 "Switch to the next favorite channel"),
"/");
608 REG_KEY(
"TV Playback",
"PREVCHAN", QT_TRANSLATE_NOOP(
"MythControls",
609 "Switch to the previous channel"),
"H");
611 "Jump ahead"),
"PgDown");
613 "Jump back"),
"PgUp");
614 REG_KEY(
"TV Playback",
"INFOWITHCUTLIST", QT_TRANSLATE_NOOP(
"MythControls",
615 "Info utilizing cutlist"),
"");
617 "Jump to bookmark"),
"K");
618 REG_KEY(
"TV Playback",
"FFWDSTICKY", QT_TRANSLATE_NOOP(
"MythControls",
619 "Fast Forward (Sticky) or Forward one second while paused"),
">,.,Ctrl+F,Media Fast Forward");
620 REG_KEY(
"TV Playback",
"RWNDSTICKY", QT_TRANSLATE_NOOP(
"MythControls",
621 "Rewind (Sticky) or Rewind one second while paused"),
",,<,Ctrl+B,Media Rewind");
622 REG_KEY(
"TV Playback",
"NEXTSOURCE", QT_TRANSLATE_NOOP(
"MythControls",
623 "Next Video Source"),
"Y");
624 REG_KEY(
"TV Playback",
"PREVSOURCE", QT_TRANSLATE_NOOP(
"MythControls",
625 "Previous Video Source"),
"");
626 REG_KEY(
"TV Playback",
"NEXTINPUT", QT_TRANSLATE_NOOP(
"MythControls",
628 REG_KEY(
"TV Playback",
"NEXTCARD", QT_TRANSLATE_NOOP(
"MythControls",
630 REG_KEY(
"TV Playback",
"SKIPCOMMERCIAL", QT_TRANSLATE_NOOP(
"MythControls",
631 "Skip Commercial"),
"Z,End,Media Next");
632 REG_KEY(
"TV Playback",
"SKIPCOMMBACK", QT_TRANSLATE_NOOP(
"MythControls",
633 "Skip Commercial (Reverse)"),
"Q,Home,Media Previous");
635 "Jump to the start of the recording."),
"Ctrl+A");
636 REG_KEY(
"TV Playback",
"TOGGLEBROWSE", QT_TRANSLATE_NOOP(
"MythControls",
637 "Toggle channel browse mode"),
"O");
639 "Toggle recording status of current program"),
"R");
641 "Toggle the current channel as a favorite"),
"?");
643 "Volume down"),
"[,{,F10,Volume Down");
645 "Volume up"),
"],},F11,Volume Up");
647 "Mute"),
"|,\\,F9,Volume Mute");
649 "Set the volume"),
"");
650 REG_KEY(
"TV Playback",
"CYCLEAUDIOCHAN", QT_TRANSLATE_NOOP(
"MythControls",
651 "Cycle audio channels"),
"");
653 "Toggle audio upmixer"),
"Ctrl+U");
655 QT_TRANSLATE_NOOP(
"MythControls",
"Move BottomLine off screen"),
"L");
657 QT_TRANSLATE_NOOP(
"MythControls",
"Save manual zoom for BottomLine"),
"");
658 REG_KEY(
"TV Playback",
"TOGGLEASPECT", QT_TRANSLATE_NOOP(
"MythControls",
659 "Toggle the video aspect ratio"),
"Ctrl+W");
660 REG_KEY(
"TV Playback",
"TOGGLEFILL", QT_TRANSLATE_NOOP(
"MythControls",
661 "Next Preconfigured Zoom mode"),
"W");
663 "Toggle any captions"),
"T");
665 "Enable any captions"),
"");
667 "Disable any captions"),
"");
668 REG_KEY(
"TV Playback",
"TOGGLETTC", QT_TRANSLATE_NOOP(
"MythControls",
669 "Toggle Teletext Captions"),
"");
670 REG_KEY(
"TV Playback",
"TOGGLESUBTITLE", QT_TRANSLATE_NOOP(
"MythControls",
671 "Toggle Subtitles"),
"");
672 REG_KEY(
"TV Playback",
"TOGGLECC608", QT_TRANSLATE_NOOP(
"MythControls",
673 "Toggle VBI CC"),
"");
674 REG_KEY(
"TV Playback",
"TOGGLECC708", QT_TRANSLATE_NOOP(
"MythControls",
675 "Toggle ATSC CC"),
"");
676 REG_KEY(
"TV Playback",
"TOGGLETTM", QT_TRANSLATE_NOOP(
"MythControls",
677 "Toggle Teletext Menu"),
"");
679 "Toggle External Subtitles"),
"");
681 "Enable External Subtitles"),
"");
683 "Disable External Subtitles"),
"");
684 REG_KEY(
"TV Playback",
"TOGGLERAWTEXT", QT_TRANSLATE_NOOP(
"MythControls",
685 "Toggle Text Subtitles"),
"");
687 REG_KEY(
"TV Playback",
"SELECTAUDIO_0", QT_TRANSLATE_NOOP(
"MythControls",
688 "Play audio track 1"),
"");
689 REG_KEY(
"TV Playback",
"SELECTAUDIO_1", QT_TRANSLATE_NOOP(
"MythControls",
690 "Play audio track 2"),
"");
691 REG_KEY(
"TV Playback",
"SELECTSUBTITLE_0",QT_TRANSLATE_NOOP(
"MythControls",
692 "Display subtitle 1"),
"");
693 REG_KEY(
"TV Playback",
"SELECTSUBTITLE_1",QT_TRANSLATE_NOOP(
"MythControls",
694 "Display subtitle 2"),
"");
695 REG_KEY(
"TV Playback",
"SELECTRAWTEXT_0",QT_TRANSLATE_NOOP(
"MythControls",
696 "Display Text Subtitle 1"),
"");
697 REG_KEY(
"TV Playback",
"SELECTCC608_0", QT_TRANSLATE_NOOP(
"MythControls",
698 "Display VBI CC1"),
"");
699 REG_KEY(
"TV Playback",
"SELECTCC608_1", QT_TRANSLATE_NOOP(
"MythControls",
700 "Display VBI CC2"),
"");
701 REG_KEY(
"TV Playback",
"SELECTCC608_2", QT_TRANSLATE_NOOP(
"MythControls",
702 "Display VBI CC3"),
"");
703 REG_KEY(
"TV Playback",
"SELECTCC608_3", QT_TRANSLATE_NOOP(
"MythControls",
704 "Display VBI CC4"),
"");
705 REG_KEY(
"TV Playback",
"SELECTCC708_0", QT_TRANSLATE_NOOP(
"MythControls",
706 "Display ATSC CC1"),
"");
707 REG_KEY(
"TV Playback",
"SELECTCC708_1", QT_TRANSLATE_NOOP(
"MythControls",
708 "Display ATSC CC2"),
"");
709 REG_KEY(
"TV Playback",
"SELECTCC708_2", QT_TRANSLATE_NOOP(
"MythControls",
710 "Display ATSC CC3"),
"");
711 REG_KEY(
"TV Playback",
"SELECTCC708_3", QT_TRANSLATE_NOOP(
"MythControls",
712 "Display ATSC CC4"),
"");
714 "Enable Forced Subtitles"),
"");
716 "Disable Forced Subtitles"),
"");
718 REG_KEY(
"TV Playback",
"NEXTAUDIO", QT_TRANSLATE_NOOP(
"MythControls",
719 "Next audio track"),
"+");
720 REG_KEY(
"TV Playback",
"PREVAUDIO", QT_TRANSLATE_NOOP(
"MythControls",
721 "Previous audio track"),
"-");
722 REG_KEY(
"TV Playback",
"NEXTSUBTITLE", QT_TRANSLATE_NOOP(
"MythControls",
723 "Next subtitle track"),
"");
724 REG_KEY(
"TV Playback",
"PREVSUBTITLE", QT_TRANSLATE_NOOP(
"MythControls",
725 "Previous subtitle track"),
"");
726 REG_KEY(
"TV Playback",
"NEXTRAWTEXT", QT_TRANSLATE_NOOP(
"MythControls",
727 "Next Text track"),
"");
728 REG_KEY(
"TV Playback",
"PREVRAWTEXT", QT_TRANSLATE_NOOP(
"MythControls",
729 "Previous Text track"),
"");
730 REG_KEY(
"TV Playback",
"NEXTCC608", QT_TRANSLATE_NOOP(
"MythControls",
731 "Next VBI CC track"),
"");
732 REG_KEY(
"TV Playback",
"PREVCC608", QT_TRANSLATE_NOOP(
"MythControls",
733 "Previous VBI CC track"),
"");
734 REG_KEY(
"TV Playback",
"NEXTCC708", QT_TRANSLATE_NOOP(
"MythControls",
735 "Next ATSC CC track"),
"");
736 REG_KEY(
"TV Playback",
"PREVCC708", QT_TRANSLATE_NOOP(
"MythControls",
737 "Previous ATSC CC track"),
"");
738 REG_KEY(
"TV Playback",
"NEXTCC", QT_TRANSLATE_NOOP(
"MythControls",
739 "Next of any captions"),
"");
741 REG_KEY(
"TV Playback",
"NEXTSCAN", QT_TRANSLATE_NOOP(
"MythControls",
742 "Next video scan overidemode"),
"");
743 REG_KEY(
"TV Playback",
"QUEUETRANSCODE", QT_TRANSLATE_NOOP(
"MythControls",
744 "Queue the current recording for transcoding"),
"X");
745 REG_KEY(
"TV Playback",
"SPEEDINC", QT_TRANSLATE_NOOP(
"MythControls",
746 "Increase the playback speed"),
"U");
747 REG_KEY(
"TV Playback",
"SPEEDDEC", QT_TRANSLATE_NOOP(
"MythControls",
748 "Decrease the playback speed"),
"J");
749 REG_KEY(
"TV Playback",
"ADJUSTSTRETCH", QT_TRANSLATE_NOOP(
"MythControls",
750 "Turn on time stretch control"),
"A");
751 REG_KEY(
"TV Playback",
"STRETCHINC", QT_TRANSLATE_NOOP(
"MythControls",
752 "Increase time stretch speed"),
"");
753 REG_KEY(
"TV Playback",
"STRETCHDEC", QT_TRANSLATE_NOOP(
"MythControls",
754 "Decrease time stretch speed"),
"");
755 REG_KEY(
"TV Playback",
"TOGGLESTRETCH", QT_TRANSLATE_NOOP(
"MythControls",
756 "Toggle time stretch speed"),
"");
758 QT_TRANSLATE_NOOP(
"MythControls",
759 "Turn on audio sync adjustment controls"),
"");
761 QT_TRANSLATE_NOOP(
"MythControls",
762 "Set the audio sync adjustment"),
"");
763 REG_KEY(
"TV Playback",
"TOGGLEPICCONTROLS",
764 QT_TRANSLATE_NOOP(
"MythControls",
"Playback picture adjustments"),
767 QT_TRANSLATE_NOOP(
"MythControls",
"Set the picture brightness"),
"");
769 QT_TRANSLATE_NOOP(
"MythControls",
"Set the picture contrast"),
"");
771 QT_TRANSLATE_NOOP(
"MythControls",
"Set the picture color"),
"");
773 QT_TRANSLATE_NOOP(
"MythControls",
"Set the picture hue"),
"");
775 QT_TRANSLATE_NOOP(
"MythControls",
"Recording picture adjustments "
776 "for this channel"),
"Ctrl+G");
778 QT_TRANSLATE_NOOP(
"MythControls",
"Recording picture adjustments "
779 "for this recorder"),
"G");
780 REG_KEY(
"TV Playback",
"CYCLECOMMSKIPMODE",
781 QT_TRANSLATE_NOOP(
"MythControls",
"Cycle Commercial Skip mode"),
784 "Show the Program Guide"),
"S");
786 "Show the Program Finder"),
"#");
788 "Toggle the Sleep Timer"),
"F8");
792 "Jump to previously played recording"),
"");
794 "Display menu of recorded programs to jump to"),
"");
796 "Display scheduled recording list"),
"");
798 "Display previously recorded episodes"),
"");
800 "Monitor Signal Quality"),
"Alt+F7");
802 QT_TRANSLATE_NOOP(
"MythControls",
"Jump to the DVD Root Menu"),
"");
804 QT_TRANSLATE_NOOP(
"MythControls",
"Jump to the Popup Menu"),
"");
806 QT_TRANSLATE_NOOP(
"MythControls",
"Jump to the DVD Chapter Menu"),
"");
808 QT_TRANSLATE_NOOP(
"MythControls",
"Jump to the DVD Title Menu"),
"");
810 QT_TRANSLATE_NOOP(
"MythControls",
"Exit Show without any prompts"),
813 "Jump to a chapter"),
"");
815 "Switch title"),
"");
817 "Switch angle"),
"");
819 "OSD Navigation"),
"");
821 "Zoom mode - shift up"),
"");
823 "Zoom mode - shift down"),
"");
825 "Zoom mode - shift left"),
"");
827 "Zoom mode - shift right"),
"");
829 QT_TRANSLATE_NOOP(
"MythControls",
830 "Zoom mode - increase aspect ratio"),
"3");
832 QT_TRANSLATE_NOOP(
"MythControls",
833 "Zoom mode - decrease aspect ratio"),
"7");
835 "Zoom mode - zoom in"),
"9");
837 "Zoom mode - zoom out"),
"1");
839 QT_TRANSLATE_NOOP(
"MythControls",
840 "Zoom mode - vertical zoom in"),
"8");
842 QT_TRANSLATE_NOOP(
"MythControls",
843 "Zoom mode - vertical zoom out"),
"2");
845 QT_TRANSLATE_NOOP(
"MythControls",
846 "Zoom mode - horizontal zoom in"),
"6");
848 QT_TRANSLATE_NOOP(
"MythControls",
849 "Zoom mode - horizontal zoom out"),
"4");
851 "Zoom mode - quit and abandon changes"),
"");
853 "Zoom mode - commit changes"),
"");
856 "Display list of cast members"),
"");
862 "Menu Green"),
"F3");
864 "Menu Yellow"),
"F4");
876 "Clear editing cut points"),
"C,Q,Home");
878 "Invert Begin/End cut points"),
"I,Home Page");
882 "Load cuts from detected commercials"),
"Z,End");
884 "Jump to the next cut point"),
"PgDown,Media Next");
886 "Jump to the previous cut point"),
"PgUp,Media Previous");
888 "Jump back 10x the normal amount"),
",,<,Ctrl+B,Media Rewind");
890 "Jump forward 10x the normal amount"),
">,.,Ctrl+F,Media Fast Forward");
892 "Cut point editor compact menu"),
"Alt+M");
896 "Next Page"),
"Down");
898 "Previous Page"),
"Up");
900 "Next Subpage"),
"Right");
902 "Previous Subpage"),
"Left");
904 "Toggle Teletext"),
"T");
908 "Menu Green"),
"F3");
910 "Menu Yellow"),
"F4");
914 "Menu White"),
"F6");
916 QT_TRANSLATE_NOOP(
"MythControls",
"Toggle Background"),
"F7");
918 "Reveal hidden Text"),
"F8");
922 QT_TRANSLATE_NOOP(
"MythControls",
"Toggle audio visualisation"),
"");
926 QT_TRANSLATE_NOOP(
"MythControls",
"Toggle OSD playback information"),
"");
930 QT_TRANSLATE_NOOP(
"MythControls",
"Auto 3D"),
"");
932 QT_TRANSLATE_NOOP(
"MythControls",
"Ignore 3D"),
"");
934 QT_TRANSLATE_NOOP(
"MythControls",
"Discard 3D Side by Side"),
"");
936 QT_TRANSLATE_NOOP(
"MythControls",
"Discard 3D Top and Bottom"),
"");
990 { tr(
"Off",
"Sleep timer"), 0min },
991 { tr(
"30m",
"Sleep timer"), 30min },
992 { tr(
"1h",
"Sleep timer"), 60min },
993 { tr(
"1h30m",
"Sleep timer"), 90min },
994 { tr(
"2h",
"Sleep timer"), 120min }
1011 m_mainWindow(MainWindow)
1014 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Creating TV object");
1016 QObject::setObjectName(
"TV");
1033 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Finished creating TV object");
1038 QMap<QString,QString> kv;
1039 kv[
"LiveTVIdleTimeout"] =
"0";
1040 kv[
"BrowseMaxForward"] =
"240";
1041 kv[
"PlaybackExitPrompt"] =
"0";
1042 kv[
"AutomaticSetWatched"] =
"0";
1043 kv[
"EndOfRecordingExitPrompt"] =
"0";
1044 kv[
"JumpToProgramOSD"] =
"1";
1045 kv[
"GuiSizeForTV"] =
"0";
1046 kv[
"UseVideoModes"] =
"0";
1047 kv[
"JobsRunOnRecordHost"] =
"0";
1048 kv[
"ContinueEmbeddedTVPlay"] =
"0";
1049 kv[
"UseFixedWindowSize"] =
"1";
1050 kv[
"RunFrontendInWindow"] =
"0";
1051 kv[
"PersistentBrowseMode"] =
"0";
1052 kv[
"BrowseAllTuners"] =
"0";
1053 kv[
"ChannelOrdering"] =
"channum";
1055 kv[
"CustomFilters"] =
"";
1056 kv[
"ChannelFormat"] =
"<num> <sign>";
1058 kv[
"TryUnflaggedSkip"] =
"0";
1060 kv[
"ChannelGroupDefault"] =
"-1";
1061 kv[
"BrowseChannelGroup"] =
"0";
1062 kv[
"SmartForward"] =
"0";
1063 kv[
"FFRewReposTime"] =
"100";
1064 kv[
"FFRewReverse"] =
"1";
1066 kv[
"BrowseChannelGroup"] =
"0";
1067 kv[
"ChannelGroupDefault"] =
"-1";
1068 kv[
"ChannelGroupRememberLast"] =
"0";
1070 kv[
"VbiFormat"] =
"";
1071 kv[
"DecodeVBIFormat"] =
"";
1074 kv[
"PlaybackScreenPressKeyMap"] =
"P,Up,Z,],Left,Return,Return,Right,A,Down,Q,[";
1075 kv[
"LiveTVScreenPressKeyMap"] =
"P,Up,Z,S,Left,Return,Return,Right,A,Down,Q,F";
1077 constexpr std::array<const int,8> ff_rew_def { 3, 5, 10, 20, 30, 60, 120, 180 };
1078 for (
size_t i = 0; i < ff_rew_def.size(); i++)
1079 kv[QString(
"FFRewSpeed%1").arg(i)] = QString::number(ff_rew_def[i]);
1086 QString db_channel_ordering;
1088 m_dbIdleTimeout = std::chrono::minutes(kv[
"LiveTVIdleTimeout"].toUInt());
1089 auto db_browse_max_forward = std::chrono::minutes(kv[
"BrowseMaxForward"].toUInt());
1100 db_channel_ordering = kv[
"ChannelOrdering"];
1110 QString beVBI = kv[
"VbiFormat"];
1111 QString feVBI = kv[
"DecodeVBIFormat"];
1128 for (
size_t i = 0; i <
sizeof(ff_rew_def)/
sizeof(ff_rew_def[0]); i++)
1129 m_ffRewSpeeds.push_back(kv[QString(
"FFRewSpeed%1").arg(i)].toInt());
1146 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"-- begin");
1150 LOG(VB_GENERAL, LOG_ERR,
LOC +
"No MythMainWindow");
1171 fullscreen |= (0 == gui_width && 0 == gui_height);
1186 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Created TvPlayWindow.");
1197 QCoreApplication::processEvents();
1222 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"-- end");
1228 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"-- begin");
1249 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"-- lock");
1282 lcd->setFunctionLEDs(
FUNC_TV,
false);
1284 lcd->switchToTime();
1292 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"-- end");
1302 QCoreApplication::processEvents();
1378 .toUTC().toString(
"yyyy-MM-ddThh:mm:ssZ"));
1389 if (!
info.text[
"totalchapters"].isEmpty())
1391 QList<std::chrono::seconds> chapters;
1394 for (std::chrono::seconds chapter : std::as_const(chapters))
1395 var << QVariant((
long long)chapter.count());
1396 status.insert(
"chaptertimes", var);
1403 int currenttrack = -1;
1406 for (
int i = 0; i < list.size(); i++)
1408 if (i == currenttrack)
1409 status.insert(
"currentsubtitletrack", list[i]);
1410 tracks.insert(
"SELECTSUBTITLE_" + QString::number(i), list[i]);
1417 for (
int i = 0; i < list.size(); i++)
1419 if (i == currenttrack)
1420 status.insert(
"currentsubtitletrack", list[i]);
1421 tracks.insert(
"SELECTTTC_" + QString::number(i), list[i]);
1428 for (
int i = 0; i < list.size(); i++)
1430 if (i == currenttrack)
1431 status.insert(
"currentsubtitletrack", list[i]);
1432 tracks.insert(
"SELECTCC708_" + QString::number(i), list[i]);
1439 for (
int i = 0; i < list.size(); i++)
1441 if (i == currenttrack)
1442 status.insert(
"currentsubtitletrack", list[i]);
1443 tracks.insert(
"SELECTCC608_" + QString::number(i), list[i]);
1450 for (
int i = 0; i < list.size(); i++)
1452 if (i == currenttrack)
1453 status.insert(
"currentsubtitletrack", list[i]);
1454 tracks.insert(
"SELECTRAWTEXT_" + QString::number(i), list[i]);
1460 status.insert(
"currentsubtitletrack", tr(
"External Subtitles"));
1464 status.insert(
"totalsubtitletracks", tracks.size());
1465 if (!tracks.isEmpty())
1466 status.insert(
"subtitletracks", tracks);
1471 for (
int i = 0; i < list.size(); i++)
1473 if (i == currenttrack)
1474 status.insert(
"currentaudiotrack", list[i]);
1475 tracks.insert(
"SELECTAUDIO_" + QString::number(i), list[i]);
1478 status.insert(
"totalaudiotracks", tracks.size());
1479 if (!tracks.isEmpty())
1480 status.insert(
"audiotracks", tracks);
1504 for (
auto tit =
info.text.cbegin(); tit !=
info.text.cend(); ++tit)
1505 status.insert(tit.key(), tit.value());
1507 QHashIterator<QString,int> vit(
info.values);
1508 while (vit.hasNext())
1511 status.insert(vit.key(), vit.value());
1539 LOG(VB_GENERAL, LOG_INFO, QString(
"Using Idle Timer. %1 minutes")
1561 else if (!Selection.empty())
1563 for (
const auto & ci : Selection)
1565 uint chanid = ci.m_chanId;
1566 QString channum = ci.m_chanNum;
1567 if (!chanid || channum.isEmpty())
1571 if (chanid && !channum.isEmpty() && !cards.isEmpty())
1609 if (!
info->GetChanID())
1616 QString key =
info->MakeUniqueKey();
1621 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
"AskAllowRecording -- " +
1622 QString(
"adding '%1'").arg(
info->m_title));
1630 LOG(VB_GENERAL, LOG_INFO,
LOC +
"-- " +
1631 QString(
"removing '%1'").arg(
info->GetTitle()));
1635 delete (*it).m_info;
1652 QString single_rec = tr(
"MythTV wants to record \"%1\" on %2 in %d seconds. Do you want to:");
1654 QString record_watch = tr(
"Record and watch while it records");
1655 QString let_record1 = tr(
"Let it record and go back to the Main Menu");
1656 QString let_recordm = tr(
"Let them record and go back to the Main Menu");
1657 QString record_later1 = tr(
"Record it later, I want to watch TV");
1658 QString record_laterm = tr(
"Record them later, I want to watch TV");
1659 QString do_not_record1= tr(
"Don't let it record, I want to watch TV");
1660 QString do_not_recordm= tr(
"Don't let them record, I want to watch TV");
1667 if ((*it).m_expiry <= timeNow)
1670 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
"-- " +
1671 QString(
"removing '%1'").arg((*it).m_info->m_title));
1673 delete (*it).m_info;
1681 std::chrono::milliseconds timeuntil = 0ms;
1688 (*it).m_isInSameInputGroup = (*it).m_isConflicting =
true;
1693 bool busy_input_grps_loaded =
false;
1694 std::vector<uint> busy_input_grps;
1701 (*it).m_isInSameInputGroup =
1702 (cardid == (*it).m_info->GetInputID());
1704 if ((*it).m_isInSameInputGroup)
1708 if (!busy_input_grps_loaded)
1711 busy_input_grps_loaded =
true;
1714 std::vector<uint> input_grps =
1717 for (
uint grp : input_grps)
1719 if (
find(busy_input_grps.begin(), busy_input_grps.end(),
1720 grp) != busy_input_grps.end())
1722 (*it).m_isInSameInputGroup =
true;
1732 if (!(*it).m_isInSameInputGroup)
1733 (*it).m_isConflicting =
false;
1734 else if (cardid == (*it).m_info->GetInputID())
1735 (*it).m_isConflicting =
true;
1737 (*it).m_isConflicting =
true;
1739 (busy_input.
m_mplexId == (*it).m_info->QueryMplexID())) ||
1741 (busy_input.
m_chanId == (*it).m_info->GetChanID())))
1742 (*it).m_isConflicting =
false;
1744 (*it).m_isConflicting =
true;
1746 conflict_count += (*it).m_isConflicting ? 1 : 0;
1753 if (conflict_count == 0)
1755 LOG(VB_GENERAL, LOG_INFO,
LOC +
"The scheduler wants to make "
1756 "a non-conflicting recording.");
1760 else if (conflict_count == 1 && ((*it).m_info->GetInputID() == cardid))
1763 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
"UpdateOSDAskAllowDialog -- " +
1771 .replace(
"<num>", (*it).m_info->GetChanNum())
1772 .replace(
"<sign>", (*it).m_info->GetChannelSchedulingID())
1773 .replace(
"<name>", (*it).m_info->GetChannelName());
1775 message = single_rec.arg((*it).m_info->GetTitle(), channel);
1780 dialog.m_buttons.push_back({ record_watch,
"DIALOG_ASKALLOW_WATCH_0",
false, !((*it).m_hasRec)} );
1781 dialog.m_buttons.push_back({ let_record1,
"DIALOG_ASKALLOW_EXIT_0" });
1782 dialog.m_buttons.push_back({ ((*it).m_hasLater) ? record_later1 : do_not_record1,
1783 "DIALOG_ASKALLOW_CANCELRECORDING_0",
false, ((*it).m_hasRec) });
1788 if (conflict_count > 1)
1791 "MythTV wants to record these programs in %d seconds:");
1795 bool has_rec =
false;
1798 if (!(*it).m_isConflicting)
1801 QString title = (*it).m_info->GetTitle();
1802 if ((title.length() < 10) && !(*it).m_info->GetSubtitle().isEmpty())
1803 title +=
": " + (*it).m_info->GetSubtitle();
1804 if (title.length() > 20)
1805 title = title.left(17) +
"...";
1809 .replace(
"<num>", (*it).m_info->GetChanNum())
1810 .replace(
"<sign>", (*it).m_info->GetChannelSchedulingID())
1811 .replace(
"<name>", (*it).m_info->GetChannelName());
1813 if (conflict_count > 1)
1815 message += tr(
"\"%1\" on %2").arg(title, channel);
1820 message = single_rec.arg((*it).m_info->GetTitle(), channel);
1821 has_rec = (*it).m_hasRec;
1825 if (conflict_count > 1)
1828 message += tr(
"Do you want to:");
1831 bool all_have_later =
true;
1832 timeuntil = 9999999ms;
1835 if ((*it).m_isConflicting)
1837 all_have_later &= (*it).m_hasLater;
1842 timeuntil = (9999999ms == timeuntil) ? 0ms : timeuntil;
1844 if (conflict_count > 1)
1848 { let_recordm,
"DIALOG_ASKALLOW_EXIT_0",
false,
true },
1849 { all_have_later ? record_laterm : do_not_recordm,
"DIALOG_ASKALLOW_CANCELCONFLICTING_0" }
1856 { let_record1,
"DIALOG_ASKALLOW_EXIT_0",
false, !has_rec},
1857 { all_have_later ? record_later1 : do_not_record1,
"DIALOG_ASKALLOW_CANCELRECORDING_0",
false, has_rec}
1870 LOG(VB_GENERAL, LOG_ERR,
"allowrecordingbox : askAllowLock is locked");
1874 if (
Action ==
"CANCELRECORDING")
1879 else if (
Action ==
"CANCELCONFLICTING")
1883 if (pgm.m_isConflicting)
1887 else if (
Action ==
"WATCH")
1953 #define TRANSITION(ASTATE,BSTATE) ((ctxState == (ASTATE)) && (desiredNextState == (BSTATE)))
1955 #define SET_NEXT() do { nextState = desiredNextState; changed = true; } while(false)
1956 #define SET_LAST() do { nextState = ctxState; changed = true; } while(false)
1961 QByteArray msg_arr = msg.toLatin1();
1962 QString msg_i18n = TV::tr(msg_arr.constData());
1963 QByteArray msg_i18n_arr = msg_i18n.toLatin1();
1964 return (msg_arr == msg_i18n_arr) ? msg_i18n : msg;
1979 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Called after fatal error detected.");
1983 bool changed =
false;
1989 LOG(VB_GENERAL, LOG_WARNING,
LOC +
"Warning, called with no state to change to.");
1997 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Attempting to change from %1 to %2")
2002 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Attempting to set to an error state!");
2027 QString channum =
"";
2031 QStringList reclist;
2034 query.
prepare(
"SELECT channum FROM channel "
2035 "WHERE chanid = :CHANID");
2038 channum = query.
value(0).toString();
2040 channum = QString::number(chanid);
2043 QString::number(chanid));
2048 if (!reclist.empty())
2067 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
"Spawning LiveTV Recorder -- begin");
2069 if (chanid && !channum.isEmpty())
2074 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
"Spawning LiveTV Recorder -- end");
2078 LOG(VB_GENERAL, LOG_ERR,
LOC +
"LiveTV not successfully started");
2092 LOG(VB_GENERAL, LOG_INFO,
LOC +
2093 QString(
"playbackURL(%1) inputtype(%2)")
2098 playbackURL,
false,
true,
2112 LOG(VB_GENERAL, LOG_ERR,
LOC +
"LiveTV not successfully started");
2167 LOG(VB_GENERAL, LOG_ERR,
LOC +
2168 "Couldn't find recorder for in-progress recording");
2187 QString message =
"COMMFLAG_REQUEST ";
2202 TV::tr(
"TV Player" ),
2229 LOG(VB_GENERAL, LOG_ERR,
LOC + QString(
"Unknown state transition: %1 to %2")
2234 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Changing from %1 to %2")
2245 LOG(VB_GENERAL, LOG_INFO,
LOC +
"State is LiveTV");
2247 LOG(VB_GENERAL, LOG_INFO,
LOC +
"UpdateOSDInput done");
2249 LOG(VB_GENERAL, LOG_INFO,
LOC +
"UpdateLCD done");
2251 LOG(VB_GENERAL, LOG_INFO,
LOC +
"ITVRestart done");
2257 QString msg = tr(
"%1 Settings")
2310 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Main UI disabled.");
2313 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
" -- end");
2328 MaxWait = (MaxWait <= 0ms) ? 40s : MaxWait;
2331 bool recording =
false;
2335 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Invalid Remote Encoder");
2343 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Lost contact with backend");
2347 std::this_thread::sleep_for(5us);
2353 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Timed out waiting for recorder to start");
2357 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"Took %1 ms to start recorder.")
2358 .arg(
t.elapsed().count()));
2377 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"-- begin");
2391 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Stopping ring buffer");
2402 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"stopping recorder");
2407 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"-- end");
2412 const int timer_id =
Event->timerId();
2420 bool handled =
true;
2481 if (!netCmd.isEmpty())
2507 LOG(VB_PLAYBACK, LOG_ERR,
LOC +
"Last Program File does not exist");
2626 LOG(VB_GENERAL, LOG_WARNING,
LOC + QString(
"Unknown timer: %1").arg(timer_id));
2636 QString lcd_time_string;
2637 bool showProgress =
true;
2654 lcd_time_string =
info.text[
"playedtime"] +
" / " +
info.text[
"totaltime"];
2656 if (lcd_time_string.length() > lcd->
getLCDWidth())
2657 lcd_time_string.remove(
' ');
2687 int timer = startTimer(Interval);
2689 LOG(VB_GENERAL, LOG_ERR,
LOC + QString(
"Failed to start timer on line %1 of %2").arg(Line).arg(__FILE__));
2706 auto StateChange = [&]()
2724 QTimer::singleShot(0,
this, StateChange);
2729 auto InputChange = [&]()
2741 QTimer::singleShot(0,
this, InputChange);
2753 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Switching to program: %1")
2823 bool is_playing =
false;
2908 bool restartTimer =
false;
2914 restartTimer =
true;
2918 LOG(VB_CHANNEL, LOG_INFO,
"REC_PROGRAM -- channel change");
2984 if ((
Event->type() == QEvent::Resize))
2990 if ( (QEvent::KeyPress ==
Event->type() || QEvent::KeyRelease ==
Event->type())
2992 return TVPlaybackState::eventFilter(Object,
Event);
2994 QScopedPointer<QEvent> sNewEvent(
nullptr);
2998 if (QEvent::KeyPress ==
Event->type())
3013 switch (
Event->type())
3016 case QEvent::UpdateRequest:
3020 return TVPlaybackState::eventFilter(Object,
Event);
3023 return TVPlaybackState::eventFilter(Object,
Event);
3030 if (
Event ==
nullptr)
3031 return TVPlaybackState::event(
Event);
3033 if (QEvent::Resize ==
Event->type())
3038 const auto *qre =
dynamic_cast<const QResizeEvent*
>(
Event);
3041 return TVPlaybackState::event(
Event);
3050 if (QEvent::KeyPress ==
Event->type())
3052 const auto * ke =
dynamic_cast<QKeyEvent*
>(
Event);
3055 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"keypress: %1 '%2'")
3056 .arg(ke->key()).arg(ke->text()));
3064 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"mythgesture: g:%1 pos:%2,%3 b:%4")
3065 .arg(ge->GetGesture()).arg(ge->GetPosition().x())
3066 .arg(ge->GetPosition().y()).arg(ge->GetButton()));
3070 bool handled =
false;
3079 switch (
Event->type())
3082 case QEvent::UpdateRequest:
3092 return QObject::event(
Event);
3097 bool handled =
true;
3152 else if (
Action.startsWith(
"TOGGLE"))
3162 else if (
Action.startsWith(
"SELECT"))
3171 else if (
Action.startsWith(
"NEXT") ||
Action.startsWith(
"PREV"))
3173 int dir = (
Action.startsWith(
"NEXT")) ? +1 : -1;
3177 else if (
Action.endsWith(
"CC"))
3202 QStringList::const_iterator it;
3203 for (it = actions.begin(); it != actions.end(); ++it)
3205 if ((*it).startsWith(
"SYSEVENT") ||
3218 QList<QKeyEvent*> keyPressList;
3220 QStringList stringKeyList = KeyList.split(
',');
3221 for (
const auto & str : std::as_const(stringKeyList))
3223 QKeySequence keySequence(str);
3224 for (i = 0; i < keySequence.count(); i++)
3226 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
3227 int keynum = keySequence[i];
3228 int keyCode = keynum & ~Qt::KeyboardModifierMask;
3229 auto modifiers =
static_cast<Qt::KeyboardModifiers
>(keynum & Qt::KeyboardModifierMask);
3231 int keyCode = keySequence[i].key();
3232 Qt::KeyboardModifiers modifiers = keySequence[i].keyboardModifiers();
3234 auto * keyEvent =
new QKeyEvent(QEvent::None, keyCode, modifiers);
3235 keyPressList.append(keyEvent);
3243 auto * keyEvent =
new QKeyEvent(QEvent::None, Qt::Key_Escape, Qt::NoModifier);
3244 keyPressList.append(keyEvent);
3247 return keyPressList;
3251 QStringList &Actions,
bool IsLiveTV)
3253 if (
Event && Context ==
"TV Playback")
3260 (
Event->GetButton() == Qt::LeftButton))
3264 QPoint pos =
Event->GetPosition();
3266 const int widthDivider = 4;
3267 int w4 = size.width() / widthDivider;
3268 region = pos.x() / w4;
3269 int h3 = size.height() / 3;
3270 region += (pos.y() / h3) * widthDivider;
3282 QStringList &Actions,
bool IsLiveTV,
bool AllowJumps)
3286 if (QEvent::KeyPress ==
Event->type())
3296 if (
Event ==
nullptr)
3302 LOG(VB_GENERAL, LOG_DEBUG,
LOC + QString(
"ignoreKeys: %1").arg(ignoreKeys));
3313 auto* eKeyEvent =
dynamic_cast<QKeyEvent*
>(
Event);
3315 if (eKeyEvent->key() <= 0)
3318 switch(eKeyEvent->nativeScanCode())
3321 keycode = Qt::Key_MediaPause;
3329 auto *key =
new QKeyEvent(QEvent::KeyPress, keycode, eKeyEvent->modifiers());
3330 QCoreApplication::postEvent(
this, key);
3336 QStringList actions;
3337 bool handled =
false;
3338 bool alreadyTranslatedPlayback =
false;
3346 alreadyTranslatedPlayback =
true;
3348 if (handled || actions.isEmpty())
3351 bool esc =
IsActionable({
"ESCAPE",
"BACK" }, actions);
3362 if (QEvent::KeyPress ==
Event->type())
3364 auto *qke =
dynamic_cast<QKeyEvent*
>(
Event);
3422 if (QEvent::KeyPress ==
Event->type())
3424 auto *qke =
dynamic_cast<QKeyEvent*
>(
Event);
3427 const QString txt = qke->text();
3431 (void)txt.toInt(&ok, 16);
3432 if (ok || txt==
"_" || txt==
"-" || txt==
"#" || txt==
".")
3443 QStringList tt_actions;
3446 if (!handled && !tt_actions.isEmpty())
3448 for (
const QString&
action : std::as_const(tt_actions))
3460 if (!alreadyTranslatedPlayback)
3463 alreadyTranslatedPlayback =
true;
3466 if (!handled && !actions.isEmpty())
3468 for (
const QString&
action : std::as_const(actions))
3477 if (!alreadyTranslatedPlayback)
3480 if (handled || actions.isEmpty())
3488 if (QEvent::KeyPress ==
Event->type())
3504 for (
int i = 0; i < actions.size(); ++i)
3505 LOG(VB_GENERAL, LOG_DEBUG,
LOC + QString(
"handled(%1) actions[%2](%3)")
3506 .arg(handled).arg(i).arg(actions[i]));
3507 #endif // DEBUG_ACTIONS
3514 for (
int i = 0; i < actions.size() && !handled; i++)
3516 const QString&
action = actions[i];
3518 int val =
action.toInt(&ok);
3536 bool handled =
true;
3557 for (
const auto&
action : std::as_const(Actions))
3568 static const QStringList passthrough =
3571 ACTION_MUTEAUDIO,
"CYCLEAUDIOCHAN",
"BOTTOMLINEMOVE",
"BOTTOMLINESAVE",
"TOGGLEASPECT"
3581 bool endmanualzoom =
false;
3582 bool handled =
true;
3583 bool updateOSD =
true;
3612 endmanualzoom =
true;
3616 endmanualzoom =
true;
3623 static const QStringList passthrough =
3631 QString msg = tr(
"Zoom Committed");
3635 msg = endmanualzoom ? tr(
"Zoom Ignored") :
3640 else if (endmanualzoom)
3687 bool handled =
true;
3712 bool handled =
true;
3735 bool handled =
true;
3758 bool handled =
true;
3793 bool IsDVD,
bool IsDVDStillFrame)
3795 bool handled =
true;
3799 else if (
IsActionable(
"SKIPCOMMBACK", Actions) && !IsDVD)
3801 else if (
IsActionable(
"QUEUETRANSCODE", Actions) && !IsDVD)
3803 else if (
IsActionable(
"QUEUETRANSCODE_AUTO", Actions) && !IsDVD)
3805 else if (
IsActionable(
"QUEUETRANSCODE_HIGH", Actions) && !IsDVD)
3807 else if (
IsActionable(
"QUEUETRANSCODE_MEDIUM", Actions) && !IsDVD)
3809 else if (
IsActionable(
"QUEUETRANSCODE_LOW", Actions) && !IsDVD)
3815 else if (
IsActionable(
"SPEEDINC", Actions) && !IsDVDStillFrame)
3817 else if (
IsActionable(
"SPEEDDEC", Actions) && !IsDVDStillFrame)
3821 else if (
IsActionable(
"CYCLECOMMSKIPMODE",Actions) && !IsDVD)
3881 DoSeek(0, tr(
"Jump to Beginning"),
false,
true);
3907 std::chrono::milliseconds rate =
m_sigMonMode ? 0ms : 100ms;
3942 bool visible =
false;
4032 else if (
IsActionable({
"INFO",
"INFOWITHCUTLIST" }, Actions))
4053 for (
auto it = Actions.cbegin(); it != Actions.cend() && !handled; ++it)
4062 bool handled =
false;
4066 for (
int i = 0; i < Actions.size() && !handled; i++)
4068 const QString&
action = Actions[i];
4070 int val =
action.toInt(&ok);
4099 bool handled =
true;
4178 info.text[
"title"] = tr(
"Position");
4186 bool handled =
true;
4208 else if (
IsActionable(
"NEXTSOURCE", Actions) && islivetv)
4212 else if (
IsActionable(
"PREVSOURCE", Actions) && islivetv)
4216 else if (
IsActionable(
"NEXTINPUT", Actions) && islivetv)
4224 else if (
IsActionable(
"PREVCHAN", Actions) && islivetv)
4296 #ifdef DEBUG_ACTIONS
4297 LOG(VB_GENERAL, LOG_DEBUG,
LOC + QString(
"(%1) ignoreKeys: %2").arg(
Command).arg(ignoreKeys));
4302 LOG(VB_GENERAL, LOG_WARNING,
LOC +
"Ignoring network control command because ignoreKeys is set");
4306 QStringList tokens =
Command.split(
" ", Qt::SkipEmptyParts);
4307 if (tokens.size() < 2)
4309 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Not enough tokens in network control command " + QString(
"'%1'").arg(
Command));
4321 LOG(VB_GENERAL, LOG_WARNING,
LOC +
4322 "Ignoring network control command\n\t\t\t" +
4323 QString(
"because dialog is waiting for a response"));
4327 if (tokens[1] !=
"QUERY")
4330 if (tokens.size() == 3 && tokens[1] ==
"CHANID")
4336 else if (tokens.size() == 3 && tokens[1] ==
"CHANNEL")
4340 static const QRegularExpression kChannelNumRE { R
"(^[-\.\d_#]+$)" };
4341 if (tokens[2] ==
"UP")
4343 else if (tokens[2] ==
"DOWN")
4345 else if (tokens[2].contains(kChannelNumRE))
4349 else if (tokens.size() == 3 && tokens[1] ==
"SPEED")
4353 if (tokens[2] ==
"0x")
4360 else if (tokens[2] ==
"normal")
4370 static const QRegularExpression kSpeedRE { R
"(^\-*(\d*\.)?\d+x$)" };
4371 float tmpSpeed = 1.0F;
4374 if (tokens[2].contains(kSpeedRE))
4376 QString speed = tokens[2].left(tokens[2].length()-1);
4377 tmpSpeed = speed.toFloat(&ok);
4381 static const QRegularExpression re { R
"(^(\-*\d+)\/(\d+)x$)" };
4382 auto match = re.match(tokens[2]);
4383 if (match.hasMatch())
4385 QStringList matches = match.capturedTexts();
4386 int numerator = matches[1].toInt(&ok);
4387 int denominator = matches[2].toInt(&ok);
4389 if (ok && denominator != 0)
4390 tmpSpeed =
static_cast<float>(numerator) /
static_cast<float>(denominator);
4398 float searchSpeed = fabs(tmpSpeed);
4403 if (tmpSpeed == 0.0F)
4411 else if (tmpSpeed == 1.0F)
4430 else if (tmpSpeed > 1)
4438 else if (0.125F <= tmpSpeed && tmpSpeed <= 2.0F)
4446 LOG(VB_GENERAL, LOG_WARNING, QString(
"Couldn't find %1 speed. Setting Speed to 1x")
4447 .arg(
static_cast<double>(searchSpeed)));
4454 LOG(VB_GENERAL, LOG_ERR, QString(
"Found an unknown speed of %1").arg(tokens[2]));
4458 else if (tokens.size() == 2 && tokens[1] ==
"STOP")
4465 static const QRegularExpression kDigitsRE {
"^\\d+$" };
4469 if (tokens[2] ==
"BEGINNING")
4471 DoSeek(0, tr(
"Jump to Beginning"),
false,
true);
4473 else if (tokens[2] ==
"FORWARD")
4477 else if (tokens[2] ==
"BACKWARD")
4481 else if ((tokens[2] ==
"POSITION" ||
4482 tokens[2] ==
"POSITIONWITHCUTLIST") &&
4483 (tokens.size() == 4) &&
4484 (tokens[3].contains(kDigitsRE)))
4486 DoSeekAbsolute(tokens[3].toInt(), tokens[2] ==
"POSITIONWITHCUTLIST");
4489 else if (tokens.size() >= 3 && tokens[1] ==
"SUBTITLES")
4492 uint track = tokens[2].toUInt(&ok);
4504 uint size =
static_cast<uint>(subs.size());
4507 if (track >=
start && track < finish)
4516 finish =
start + size;
4517 if (track >=
start && track < finish)
4526 finish =
start + size;
4527 if (track >=
start && track < finish)
4536 finish =
start + size;
4537 if (track >=
start && track < finish)
4546 finish =
start + size;
4547 if (track >=
start && track < finish)
4556 finish =
start + size;
4557 if (track >=
start && track < finish)
4565 else if (tokens.size() >= 3 && tokens[1] ==
"VOLUME")
4567 static const QRegularExpression re {
"(\\d+)%?" };
4568 auto match = re.match(tokens[2]);
4569 if (match.hasMatch())
4571 QStringList matches = match.capturedTexts();
4573 LOG(VB_GENERAL, LOG_INFO, QString(
"Set Volume to %1%").arg(matches[1]));
4576 int vol = matches[1].toInt(&ok);
4580 if (0 <= vol && vol <= 100)
4584 else if (tokens.size() >= 3 && tokens[1] ==
"QUERY")
4586 if (tokens[2] ==
"POSITION")
4601 static const QRegularExpression re {
"Play (.*)x" };
4603 if (match.hasMatch())
4605 QStringList matches = match.capturedTexts();
4606 speedStr = QString(
"%1x").arg(matches[1]);
4618 QString infoStr =
"";
4642 infoStr =
"Recorded";
4650 QString bufferFilename =
4652 if ((infoStr ==
"Recorded") || (infoStr ==
"LiveTV"))
4654 infoStr += QString(
" %1 %2 %3 %4 %5 %6 %7")
4655 .arg(
info.text[
"description"],
4660 QString::number(fplay),
4662 QString::number(rate));
4666 QString position =
info.text[
"description"].section(
" ",0,0);
4667 infoStr += QString(
" %1 %2 %3 %4 %5")
4671 QString::number(fplay),
4672 QString::number(rate));
4675 infoStr += QString(
" Subtitles:");
4680 infoStr += QString(
" *0:[None]*");
4682 infoStr += QString(
" 0:[None]");
4687 for (
int i = 0; i < subs.size(); i++)
4690 infoStr += QString(
" *%1:[%2]*").arg(n).arg(subs[i]);
4692 infoStr += QString(
" %1:[%2]").arg(n).arg(subs[i]);
4697 for (
int i = 0; i < subs.size(); i++)
4700 infoStr += QString(
" *%1:[%2]*").arg(n).arg(subs[i]);
4702 infoStr += QString(
" %1:[%2]").arg(n).arg(subs[i]);
4707 for (
int i = 0; i < subs.size(); i++)
4710 infoStr += QString(
" *%1:[%2]*").arg(n).arg(subs[i]);
4712 infoStr += QString(
" %1:[%2]").arg(n).arg(subs[i]);
4717 for (
int i = 0; i < subs.size(); i++)
4720 infoStr += QString(
" *%1:[%2]*").arg(n).arg(subs[i]);
4722 infoStr += QString(
" %1:[%2]").arg(n).arg(subs[i]);
4727 for (
int i = 0; i < subs.size(); i++)
4730 infoStr += QString(
" *%1:[%2]*").arg(n).arg(subs[i]);
4732 infoStr += QString(
" %1:[%2]").arg(n).arg(subs[i]);
4737 for (
int i = 0; i < subs.size(); i++)
4740 infoStr += QString(
" *%1:[%2]*").arg(n).arg(subs[i]);
4742 infoStr += QString(
" %1:[%2]").arg(n).arg(subs[i]);
4748 QString message = QString(
"NETWORK_CONTROL ANSWER %1").arg(infoStr);
4752 else if (tokens[2] ==
"VOLUME")
4755 QString message = QString(
"NETWORK_CONTROL ANSWER %1").arg(infoStr);
4764 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC + QString(
"(%1) -- begin").arg(
StateToString(desiredState)));
4771 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Created player."));
4776 LOG(VB_GENERAL, LOG_CRIT,
LOC + QString(
"Failed to create player."));
4779 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC + QString(
"(%1) -- end %2")
4885 bool paused =
false;
4907 bool ignore =
false;
4908 bool paused =
false;
4933 if (Time > -0.001F && Time < +0.001F)
4936 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"%1 seconds").arg(
static_cast<double>(Time)));
4957 else if (Time < 0.0F)
4969 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"%1").arg(FrameNum));
4995 const int kRewind = 4;
4996 const int kForward = 8;
4997 const int kSticky = 16;
4998 const int kSlippery = 32;
4999 const int kRelative = 64;
5000 const int kAbsolute = 128;
5001 const int kIgnoreCutlist = 256;
5002 const int kWhenceMask = 3;
5007 flags =
ARBSEEK_END | kForward | kSticky | kAbsolute;
5013 flags =
ARBSEEK_SET | kRewind | kSticky | kAbsolute;
5019 int direction = (flags & kRewind) ? -1 : 1;
5028 QString message = (flags & kRewind) ? tr(
"Rewind") :
5030 if (flags & kAbsolute)
5032 float time = direction;
5033 DoSeek(time, message,
true, (flags & kIgnoreCutlist) == 0);
5040 uint64_t targetRel = frameRel +
static_cast<uint64_t
>(direction);
5041 if (frameRel == 0 && direction < 0)
5045 targetRel = std::min(targetRel, maxRel);
5053 else if (flags & kSticky)
5057 else if (flags & kRewind)
5077 void TV::DoSeek(
float Time,
const QString &Msg,
bool TimeIsOffset,
bool HonorCutlist)
5082 bool limitkeys =
false;
5124 DoSeek(Seconds, tr(
"Jump To"),
false, HonorCutlist);
5136 int64_t time = ((seek / 100) * 3600) + ((seek % 100) * 60);
5140 DoSeek(time, tr(
"Jump Ahead"),
true, HonorCutlist);
5144 DoSeek(-time, tr(
"Jump Back"),
true, HonorCutlist);
5157 DoSeek(std::max(0.0F, dur -
static_cast<float>(time)), tr(
"Jump To"),
false, HonorCutlist);
5291 auto index =
static_cast<size_t>(Index);
5360 QString jobHost =
"";
5365 QString msg = tr(
"Try Again");
5372 msg = tr(
"Transcoding");
5382 int num_chapters = 0;
5387 return num_chapters;
5435 int currentTitle = 0;
5440 return currentTitle;
5455 int currentAngle = 0;
5460 return currentAngle;
5475 std::chrono::seconds seconds = 0s;
5538 info.text[
"title"] = tr(
"Skip");
5539 info.text[
"description"] = tr(
"Searching");
5551 QMap<uint,InputInfo> sources;
5556 uint sourceid =
info[
"sourceid"].toUInt();
5559 for (
auto & input : inputs)
5562 if ((sources.find(input.m_sourceId) == sources.end()) ||
5563 ((cardid == input.m_inputId) && (cardid != sources[input.m_sourceId].m_inputId)))
5565 sources[input.m_sourceId] = input;
5570 QMap<uint,InputInfo>::const_iterator beg = sources.constFind(sourceid);
5571 QMap<uint,InputInfo>::const_iterator sit = beg;
5573 if (sit == sources.constEnd())
5579 if (sit == sources.constEnd())
5580 sit = sources.constBegin();
5585 if (sit != sources.constBegin())
5589 QMap<uint,InputInfo>::const_iterator
tmp = sources.constBegin();
5590 while (
tmp != sources.constEnd())
5617 QCoreApplication::processEvents();
5619 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"(%1,'%2',%3)").arg(ChanID).arg(ChanNum).arg(InputID));
5626 QStringList reclist;
5629 reclist.push_back(QString::number(InputID));
5631 else if (ChanID || !ChanNum.isEmpty())
5638 if (!reclist.empty())
5646 if (ChanID && ChanNum.isEmpty())
5649 if (!ChanNum.isEmpty())
5692 if (ChanNum.isEmpty() && ChanID)
5694 if (ChanNum.isEmpty() && InputID)
5700 LOG(VB_GENERAL, LOG_ERR,
LOC +
"LiveTV not successfully restarted");
5713 playbackURL,
false,
true,
5740 LOG(VB_GENERAL, LOG_ERR,
LOC +
"LiveTV not successfully started");
5754 LOG(VB_GENERAL, LOG_ERR,
LOC +
"No recorder to switch to...");
5768 LOG(VB_GENERAL, LOG_ERR,
"TV::ToggleChannelFavorite() -- currently disabled");
5836 bool commitSmart =
false;
5848 inputStr = inputStr.isEmpty() ?
"?" : inputStr;
5852 inputStr = entryStr +
" " + inputStr;
5856 inputStr = tr(
"Seek:",
"seek to location") +
" " + inputStr;
5866 static QString
add_spacer(
const QString &chan,
const QString &spacer)
5868 if ((chan.length() >= 2) && !spacer.isEmpty())
5869 return chan.left(chan.length()-1) + spacer + chan.right(1);
5881 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
5882 int size = chan.size();
5884 qsizetype size = chan.size();
5886 if ((size > 2) && (chan.at(size - 1) == chan.at(size - 2)))
5889 chan.right(1).toUInt(&ok);
5892 chan = chan.left(chan.length()-1);
5900 QString needed_spacer;
5901 uint pref_cardid = 0;
5902 bool is_not_complete =
true;
5904 bool valid_prefix =
false;
5908 chan, pref_cardid, is_not_complete, needed_spacer);
5911 #if DEBUG_CHANNEL_PREFIX
5912 LOG(VB_GENERAL, LOG_DEBUG, QString(
"valid_pref(%1) cardid(%2) chan(%3) "
5913 "pref_cardid(%4) complete(%5) sp(%6)")
5914 .arg(valid_prefix).arg(0).arg(chan)
5915 .arg(pref_cardid).arg(is_not_complete).arg(needed_spacer));
5923 else if (!needed_spacer.isEmpty())
5929 #if DEBUG_CHANNEL_PREFIX
5930 LOG(VB_GENERAL, LOG_DEBUG, QString(
" ValidPref(%1) CardId(%2) Chan(%3) "
5931 " PrefCardId(%4) Complete(%5) Sp(%6)")
5933 .arg(pref_cardid).arg(is_not_complete).arg(needed_spacer));
5940 return !is_not_complete;
5945 bool commited =
false;
5947 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
5948 QString(
"livetv(%1) qchannum(%2) qchanid(%3)")
5978 if (channum.isEmpty())
6001 uint old_chanid = 0;
6007 LOG(VB_GENERAL, LOG_ERR,
LOC +
6008 "no active ctx playingInfo.");
6070 uint cardid,
const QString &channum)
6073 uint cur_sourceid = 0;
6086 if (cur_sourceid != sourceid && sourceid)
6093 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"(%1, '%2')").arg(Chanid).arg(
Channum));
6099 QStringList reclist;
6100 QVector<uint> tunable_on;
6104 if (channum.isEmpty() && Chanid)
6125 QString needed_spacer;
6126 uint pref_cardid = 0;
6131 dummy, needed_spacer);
6133 LOG(VB_CHANNEL, LOG_INFO,
LOC +
6134 QString(
"CheckChannelPrefix(%1, pref_cardid %2, %3, '%4') "
6136 .arg(
Channum).arg(pref_cardid).arg(dummy).arg(needed_spacer)
6140 if (pref_cardid != cardid)
6149 getit = !tunable_on.contains(cardid);
6157 if (tunable_on.empty())
6163 for (
const auto& rec : std::as_const(
tmp))
6165 if ((Chanid == 0U) || tunable_on.contains(rec.toUInt()))
6166 reclist.push_back(rec);
6171 if (!reclist.empty())
6235 for (
const auto & option : Options)
6237 uint chanid = option.m_chanId;
6238 QString channum = option.m_chanNum;
6257 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"Previous channel number '%1'").arg(channum));
6258 if (channum.isEmpty())
6268 if (!ImmediateChange)
6274 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"'%1'->'%2'")
6275 .arg(cur_channum, prev_channum));
6278 if (cur_channum != prev_channum && !prev_channum.isEmpty())
6287 if (ImmediateChange)
6301 emit
HideAll(
true,
nullptr,
true);
6319 bool hideAll =
false;
6335 else if (is_prog_info_disp && !paused)
6339 else if (IncludeStatusOSD)
6357 info.text[
"title"] = (paused ? tr(
"Paused") : tr(
"Position"));
6403 const QString& Value,
int Type,
const QString& Units,
6407 info.values.insert(
"position", Position);
6408 info.values.insert(
"relposition", Position);
6409 info.text.insert(
"title", Title);
6410 info.text.insert(
"description", Desc);
6411 info.text.insert(
"value", Value);
6412 info.text.insert(
"units", Units);
6418 LOG(VB_PLAYBACK, LOG_INFO, QString(
"UpdateOSDSeekMessage(%1, %2)").arg(Msg).arg(Timeout));
6424 info.text[
"title"] = Msg;
6459 infoMap[
"callsign"].isEmpty())
6471 SignalMonitorList::const_iterator it;
6472 for (it = slist.begin(); it != slist.end(); ++it)
6473 if (
"error" == it->GetShortName())
6474 infoMap[QString(
"error%1").arg(i++)] = it->GetName();
6476 for (it = slist.begin(); it != slist.end(); ++it)
6477 if (
"message" == it->GetShortName())
6478 infoMap[QString(
"message%1").arg(i++)] = it->GetName();
6482 uint ber = 0xffffffff;
6494 for (it = slist.begin(); it != slist.end(); ++it)
6496 if (
"error" == it->GetShortName())
6498 err = it->GetName();
6502 if (
"message" == it->GetShortName())
6504 msg = it->GetName();
6505 LOG(VB_GENERAL, LOG_INFO,
"msg: " + msg);
6509 infoMap[it->GetShortName()] = QString::number(it->GetValue());
6510 if (
"signal" == it->GetShortName())
6511 sig = it->GetNormalizedValue(0, 100);
6512 else if (
"snr" == it->GetShortName())
6513 snr = it->GetValue();
6514 else if (
"ber" == it->GetShortName())
6515 ber =
static_cast<uint>(it->GetValue());
6516 else if (
"pos" == it->GetShortName())
6517 pos = it->GetValue();
6518 else if (
"script" == it->GetShortName())
6519 tuned = it->GetValue();
6520 else if (
"seen_pat" == it->GetShortName())
6521 pat = it->IsGood() ?
"a" :
"_";
6522 else if (
"matching_pat" == it->GetShortName())
6523 pat = it->IsGood() ?
"A" : pat;
6524 else if (
"seen_pmt" == it->GetShortName())
6525 pmt = it->IsGood() ?
"m" :
"_";
6526 else if (
"matching_pmt" == it->GetShortName())
6527 pmt = it->IsGood() ?
"M" : pmt;
6528 else if (
"seen_mgt" == it->GetShortName())
6529 mgt = it->IsGood() ?
"g" :
"_";
6530 else if (
"matching_mgt" == it->GetShortName())
6531 mgt = it->IsGood() ?
"G" : mgt;
6532 else if (
"seen_vct" == it->GetShortName())
6533 vct = it->IsGood() ?
"v" :
"_";
6534 else if (
"matching_vct" == it->GetShortName())
6535 vct = it->IsGood() ?
"V" : vct;
6536 else if (
"seen_nit" == it->GetShortName())
6537 nit = it->IsGood() ?
"n" :
"_";
6538 else if (
"matching_nit" == it->GetShortName())
6539 nit = it->IsGood() ?
"N" : nit;
6540 else if (
"seen_sdt" == it->GetShortName())
6541 sdt = it->IsGood() ?
"s" :
"_";
6542 else if (
"matching_sdt" == it->GetShortName())
6543 sdt = it->IsGood() ?
"S" : sdt;
6544 else if (
"seen_crypt" == it->GetShortName())
6545 crypt = it->IsGood() ?
"c" :
"_";
6546 else if (
"matching_crypt" == it->GetShortName())
6547 crypt = it->IsGood() ?
"C" : crypt;
6550 infoMap[
"signal"] = QString::number(sig);
6554 QString slock = (
"1" == infoMap[
"slock"]) ?
"L" :
"l";
6555 QString lockMsg = (slock==
"L") ? tr(
"Partial Lock") : tr(
"No Lock");
6556 QString sigMsg = allGood ? tr(
"Lock") : lockMsg;
6558 QString sigDesc = tr(
"Signal %1%").arg(sig,2);
6560 sigDesc +=
" | " + tr(
"S/N %1dB").arg(log10(snr), 3,
'f', 1);
6561 if (ber != 0xffffffff)
6562 sigDesc +=
" | " + tr(
"BE %1",
"Bit Errors").arg(ber, 2);
6563 if ((pos >= 0) && (pos < 100))
6564 sigDesc +=
" | " + tr(
"Rotor %1%").arg(pos,2);
6568 else if (tuned == 2)
6570 else if (tuned == 3)
6575 sigDesc = sigDesc + QString(
" | (%1%2%3%4%5%6%7%8%9) %10")
6576 .arg(tuneCode, slock, pat, pmt, mgt, vct,
6582 else if (!msg.isEmpty())
6585 infoMap[
"description"] = sigDesc;
6592 if (allGood || (pmt ==
"M"))
6601 bool timed_out =
false;
6616 LOG(VB_GENERAL, LOG_ERR,
LOC +
6617 "You have no OSD, but tuning has already taken too long.");
6643 static QString s_nextSrc =
GET_KEY(
"TV Playback",
"NEXTSOURCE");
6644 static QString s_togCards =
GET_KEY(
"TV Playback",
"NEXTINPUT");
6646 QString message = tr(
6647 "You should have received a channel lock by now. "
6648 "You can continue to wait for a signal, or you "
6649 "can change the channel with %1 or %2, change "
6650 "video source (%3), inputs (%4), etc.")
6651 .arg(s_chanUp, s_chanDown, s_nextSrc, s_togCards);
6654 { {tr(
"OK"),
"DIALOG_INFO_CHANNELLOCK_0" } },
6655 {
"",
"DIALOG_INFO_CHANNELLOCK_0",
true } });
6660 bool result =
false;
6726 dvdName = tr(
"DVD");
6730 mainStatus = tr(
"Menu");
6734 mainStatus = tr(
"Still Frame");
6738 int playingTitle = 0;
6739 int playingPart = 0;
6744 mainStatus = tr(
"Title: %1 (%2)").arg(playingTitle)
6746 subStatus = tr(
"Chapter: %1/%2").arg(playingPart).arg(totalParts);
6781 for (
uint i : std::as_const(list))
6782 ret += QString(
"%1,").arg(i);
6785 return ret.left(ret.length()-1);
6792 QVector<uint> tunable_cards;
6796 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"ChanId (%1) - no").arg(ChanId));
6797 return tunable_cards;
6801 mplexid = (32767 == mplexid) ? 0 : mplexid;
6803 uint excluded_input = 0;
6811 for (
auto & input : inputs)
6813 if (input.m_sourceId != sourceid)
6816 if (input.m_mplexId &&
6817 input.m_mplexId != mplexid)
6820 if (!input.m_mplexId && input.m_chanId &&
6821 input.m_chanId != ChanId)
6824 tunable_cards.push_back(input.m_inputId);
6827 if (tunable_cards.empty())
6828 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"ChanId (%1) - no").arg(ChanId));
6830 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"ChanId (%1) yes { %2 }").arg(ChanId).arg(
toCommaList(tunable_cards)));
6831 return tunable_cards;
6834 void TV::Embed(
bool Embed, QRect Rect,
const QStringList& Data)
6859 if (!Data.isEmpty())
6871 if (Pause ^ waspaused)
6873 if (Pause ^ waspaused)
6898 LOG(VB_GENERAL, LOG_ERR,
LOC +
"no active ctx playingInfo.");
6925 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC + QString(
"Pausing player: %1").arg(pause));
7008 QString message = QString(
"START_EPG %1 %2").arg(EditType).arg(arg);
7010 QCoreApplication::postEvent(
this, me);
7027 QString appName = tr(
"Video");
7033 appName = tr(
"DVD");
7035 lcd->switchToVolume(appName);
7061 const float kTimeStretchMin = 0.125;
7062 const float kTimeStretchMax = 2.0;
7063 const float kTimeStretchStep = 0.05F;
7067 if (new_ts_normal > kTimeStretchMax &&
7070 new_ts_normal = kTimeStretchMax;
7072 else if (new_ts_normal < kTimeStretchMin &&
7075 new_ts_normal = kTimeStretchMin;
7078 if (new_ts_normal > kTimeStretchMax ||
7079 new_ts_normal < kTimeStretchMin)
7142 QString message = tr(
"MythTV was set to sleep after %1 minutes and will exit in %d seconds.\n"
7143 "Do you wish to continue watching?")
7147 { { tr(
"Yes"),
"DIALOG_SLEEP_YES_0" },
7148 { tr(
"No"),
"DIALOG_SLEEP_NO_0" } }});
7169 LOG(VB_GENERAL, LOG_INFO,
LOC +
"No longer watching TV, exiting");
7179 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Sleep timeout reached, exiting player.");
7197 QString message = tr(
"MythTV has been idle for %1 minutes and "
7198 "will exit in %d seconds. Are you still watching?")
7202 { { tr(
"Yes"),
"DIALOG_IDLE_YES_0" },
7203 { tr(
"No"),
"DIALOG_IDLE_NO_0" }}});
7226 LOG(VB_GENERAL, LOG_INFO,
LOC +
"No longer watching LiveTV, exiting");
7239 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Idle timeout reached, leaving LiveTV");
7279 QString message = me->
Message();
7281 if (message.isEmpty())
7284 std::chrono::milliseconds
timeout = 0ms;
7285 if (me->ExtraDataCount() == 1)
7287 auto t = std::chrono::seconds(me->ExtraData(0).toInt());
7288 if (
t > 0s &&
t < 1000s)
7309 if (dce->GetData().userType() == qMetaTypeId<MythTVMenuNodeTuple>())
7313 QDomNode Node = Menu.GetNodeFromPath(data.m_path);
7314 if (dce->GetResult() == -1)
7321 OSDDialogEvent(dce->GetResult(), dce->GetResultText(), dce->GetData().toString());
7346 LOG(VB_GENERAL, LOG_NOTICE,
"DVD has been ejected, exiting playback");
7361 QString message = me->
Message();
7364 QStringList tokens = message.split(
" ", Qt::SkipEmptyParts);
7366 if (me->ExtraDataCount() == 1)
7369 int value = me->ExtraData(0).toInt();
7399 if (me->ExtraDataCount() >= 2)
7401 width = me->ExtraData(0).toInt();
7402 height = me->ExtraData(1).toInt();
7404 if (me->ExtraDataCount() == 3)
7413 else if (message.startsWith(
"DONE_RECORDING"))
7415 std::chrono::seconds seconds = 0s;
7418 if (tokens.size() == NUMTOKENS)
7420 cardnum = tokens[1].toUInt();
7421 seconds = std::chrono::seconds(tokens[2].toInt());
7426 LOG(VB_GENERAL, LOG_ERR, QString(
"DONE_RECORDING event received "
7427 "with invalid number of arguments, "
7428 "%1 expected, %2 actual")
7430 .arg(tokens.size()-1));
7470 if (message.startsWith(
"ASK_RECORDING "))
7473 bool hasrec =
false;
7474 bool haslater =
false;
7475 if (tokens.size() >= 5)
7477 cardnum = tokens[1].toUInt();
7478 timeuntil = tokens[2].toInt();
7479 hasrec = (tokens[3].toInt() != 0);
7480 haslater = (tokens[4].toInt() != 0);
7482 LOG(VB_GENERAL, LOG_DEBUG,
7483 LOC + message + QString(
" hasrec: %1 haslater: %2")
7484 .arg(hasrec).arg(haslater));
7493 if (message.startsWith(
"QUIT_LIVETV"))
7495 cardnum = (tokens.size() >= 2) ? tokens[1].toUInt() : 0;
7508 if (message.startsWith(
"LIVETV_WATCH"))
7511 if (tokens.size() >= 3)
7513 cardnum = tokens[1].toUInt();
7514 watch = tokens[2].toInt();
7538 if (message.startsWith(
"LIVETV_CHAIN"))
7541 if ((tokens.size() >= 2) && tokens[1] ==
"UPDATE")
7550 if (message.startsWith(
"EXIT_TO_MENU"))
7559 if (message.startsWith(
"SIGNAL"))
7561 cardnum = (tokens.size() >= 2) ? tokens[1].toUInt() : 0;
7562 const QStringList& signalList = me->ExtraDataList();
7578 if (message.startsWith(
"NETWORK_CONTROL"))
7580 if ((tokens.size() >= 2) &&
7581 (tokens[1] !=
"ANSWER") && (tokens[1] !=
"RESPONSE"))
7583 QStringList tokens2 = message.split(
" ", Qt::SkipEmptyParts);
7584 if ((tokens2.size() >= 2) &&
7585 (tokens2[1] !=
"ANSWER") && (tokens2[1] !=
"RESPONSE"))
7594 if (message.startsWith(
"START_EPG"))
7596 int editType = tokens[1].toInt();
7597 QString arg = message.section(
" ", 2, -1);
7601 if (message.startsWith(
"COMMFLAG_START") && (tokens.size() >= 2))
7604 QDateTime evrecstartts;
7616 QString msg =
"COMMFLAG_REQUEST ";
7623 if (message.startsWith(
"COMMFLAG_UPDATE") && (tokens.size() >= 3))
7626 QDateTime evrecstartts;
7640 QStringList marks = tokens[2].split(
",", Qt::SkipEmptyParts);
7641 for (
int j = 0; j < marks.size(); j++)
7643 mark = marks[j].split(
":", Qt::SkipEmptyParts);
7644 if (marks.size() >= 2)
7645 newMap[mark[0].toULongLong()] =
static_cast<MarkTypes>(mark[1].toInt());
7655 if (message ==
"NOTIFICATION")
7676 recinfo.
ToMap(infoMap);
7693 map.insert(
"message_text", tr(
"Record"));
7701 LOG(VB_GENERAL, LOG_CRIT,
LOC +
"Unknown recording during live tv.");
7714 cmdmsg = tr(
"Record");
7717 LOG(VB_RECORD, LOG_INFO,
LOC +
"Toggling Record on");
7726 cmdmsg = tr(
"Cancel Record");
7729 LOG(VB_RECORD, LOG_INFO,
LOC +
"Toggling Record off");
7811 title = tr(
"Adjust Volume");
7828 if (Type ==
"EDIT_CUT_POINTS")
7834 "menu_cutlist.xml", tr(
"Edit Cut Points"),
7835 metaObject()->className(),
"TV Editing");
7841 else if (Type ==
"EDIT_CUT_POINTS_COMPACT")
7847 "menu_cutlist_compact.xml", tr(
"Edit Cut Points"),
7848 metaObject()->className(),
"TV Editing");
7854 else if (Type ==
"EXIT_EDIT_MODE")
7857 dialog.m_buttons.push_back( { tr(
"Save Cuts and Exit"),
"DIALOG_CUTPOINT_SAVEEXIT_0" } );
7858 dialog.m_buttons.push_back( { tr(
"Exit Without Saving"),
"DIALOG_CUTPOINT_REVERTEXIT_0" } );
7859 dialog.m_buttons.push_back( { tr(
"Save Cuts"),
"DIALOG_CUTPOINT_SAVEMAP_0" } );
7860 dialog.m_buttons.push_back( { tr(
"Undo Changes"),
"DIALOG_CUTPOINT_REVERT_0" } );
7861 dialog.m_back = {
"",
"DIALOG_CUTPOINT_DONOTHING_0",
true };
7865 map.insert(
"title", tr(
"Edit"));
7877 if (
Action ==
"DONOTHING" && osd)
7882 QStringList actions(
Action);
7884 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Unrecognised cutpoint action");
7914 QString message = tr(
"This program is currently being edited");
7915 QString def = QString(
"DIALOG_EDITING_CONTINUE_%1").arg(
static_cast<int>(paused));
7917 { { tr(
"Continue Editing"), def,
false,
true },
7918 { tr(
"Do not edit"), QString(
"DIALOG_EDITING_STOP_%1").arg(
static_cast<int>(paused)) }},
7919 {
"", def,
true} });
7935 if (!WasPaused && paused)
7952 for (
auto it = newMap.cbegin(); it != newMap.cend(); ++it)
7953 infoMap.insert(it.key(), *it);
8012 if (osd &&
Action ==
"PROBE")
8020 else if (osd &&
Action ==
"OK")
8028 else if (osd &&
Action ==
"QUIT")
8042 const QString keys[4] = {
"XMLTV",
"callsign",
"channame",
"channum", };
8051 QMap<QString,bool> modifiable;
8052 modifiable[
"callsign"] = Info[
"callsign"].isEmpty();
8053 if (!modifiable[
"callsign"])
8055 QString unsetsign = tr(
"UNKNOWN%1",
"Synthesized callsign");
8056 int unsetcmpl = unsetsign.length() - 2;
8057 unsetsign = unsetsign.left(unsetcmpl);
8058 if (Info[
"callsign"].left(unsetcmpl) == unsetsign)
8059 modifiable[
"callsign"] =
true;
8061 modifiable[
"channame"] = Info[
"channame"].isEmpty();
8063 const std::array<const QString,2> xds_keys {
"callsign",
"channame", };
8064 for (
const auto & key : xds_keys)
8066 if (!modifiable[key])
8076 if ((key ==
"callsign") &&
8077 ((
tmp.length() > 5) || (
tmp.indexOf(
" ") >= 0)))
8089 LOG(VB_GENERAL, LOG_DEBUG,
LOC + QString(
"result %1 text %2 action %3")
8090 .arg(QString::number(Result), Text,
Action));
8096 bool handled =
true;
8097 if (
Action.startsWith(
"DIALOG_"))
8099 Action.remove(
"DIALOG_");
8100 QStringList desc =
Action.split(
"_");
8101 bool valid = desc.size() == 3;
8107 else if (valid && desc[0] ==
"VIDEOEXIT")
8111 else if (valid && desc[0] ==
"SLEEP")
8115 else if (valid && desc[0] ==
"IDLE")
8119 else if (valid && desc[0] ==
"INFO")
8123 else if (valid && desc[0] ==
"EDITING")
8127 else if (valid && desc[0] ==
"ASKALLOW")
8131 else if (valid && desc[0] ==
"EDITOR")
8135 else if (valid && desc[0] ==
"CUTPOINT")
8139 else if ((valid && desc[0] ==
"DELETE") ||
8140 (valid && desc[0] ==
"CONFIRM"))
8149 LOG(VB_GENERAL, LOG_ERR,
"Unrecognised dialog event.");
8152 else if (Result < 0)
8169 else if (
Action ==
"CANCELPLAYLIST")
8195 else if (
Action ==
"TOGGLEMANUALZOOM")
8207 else if (
Action ==
"TOGGLESTRETCH")
8219 else if (
Action.startsWith(
"ADJUSTSTRETCH"))
8221 bool floatRead =
false;
8222 float stretch =
Action.right(
Action.length() - 13).toFloat(&floatRead);
8237 else if (
Action.startsWith(
"SELECTSCAN_"))
8269 else if (
Action.startsWith(
"TOGGLEPICCONTROLS"))
8274 else if (
Action ==
"TOGGLEASPECT")
8278 else if (
Action.startsWith(
"TOGGLEASPECT"))
8282 else if (
Action ==
"TOGGLEFILL")
8286 else if (
Action.startsWith(
"TOGGLEFILL"))
8290 else if (
Action ==
"MENU")
8294 else if (
Action ==
"AUTODETECT_FILL")
8304 if (
Action ==
"CHANGROUP_ALL_CHANNELS")
8310 Action.remove(
"CHANGROUP_");
8316 QString cur_channum;
8317 QString new_channum;
8323 new_channum = cur_channum;
8325 auto it = list.cbegin();
8326 for (; it != list.cend(); ++it)
8328 if ((*it).m_chanNum == cur_channum)
8334 if (it == list.end())
8339 if (it != list.end())
8340 new_channum = (*it).m_chanNum;
8343 LOG(VB_CHANNEL, LOG_INFO,
LOC +
8344 QString(
"Channel Group: '%1'->'%2'")
8345 .arg(cur_channum, new_channum));
8351 if (cur_channum != new_channum && !new_channum.isEmpty())
8370 else if (
Action ==
"SCHEDULE")
8383 else if (
Action.startsWith(
"JUMPCAST|"))
8385 QStringList tokens =
Action.split(
"|");
8386 if (tokens.size() == 3)
8388 else if (tokens.size() == 4)
8393 else if (
Action.startsWith(
"VISUALISER"))
8397 else if (
Action.startsWith(
"3D"))
8406 if (
Action ==
"TOGGLEBROWSE")
8408 else if (
Action ==
"PREVCHAN")
8410 else if (
Action.startsWith(
"SWITCHTOINPUT_"))
8415 else if (
Action ==
"EDIT")
8446 int chapter =
Action.right(3).toInt();
8451 int title =
Action.right(3).toInt();
8456 int angle =
Action.right(3).toInt();
8459 else if (
Action ==
"EDIT")
8464 else if (
Action ==
"TOGGLEAUTOEXPIRE")
8468 else if (
Action.startsWith(
"TOGGLECOMMSKIP"))
8472 else if (
Action ==
"QUEUETRANSCODE")
8476 else if (
Action ==
"QUEUETRANSCODE_AUTO")
8480 else if (
Action ==
"QUEUETRANSCODE_HIGH")
8484 else if (
Action ==
"QUEUETRANSCODE_MEDIUM")
8488 else if (
Action ==
"QUEUETRANSCODE_LOW")
8510 LOG(VB_GENERAL, LOG_ERR,
LOC +
8511 "Unknown menu action selected: " +
Action);
8522 bool visible =
false;
8535 if (
Action ==
"CHANNELLOCK")
8540 #define BUTTON(action, text) \
8541 result = Context.AddButton(Menu, active, (action), (text), "", false, "")
8542 #define BUTTON2(action, textActive, textInactive) \
8543 result = Context.AddButton(Menu, active, (action), (textActive), (textInactive), false, "")
8544 #define BUTTON3(action, textActive, textInactive, isMenu) \
8545 result = Context.AddButton(Menu, active, (action), (textActive), (textInactive), (isMenu), "")
8560 const QString &actionName = Context.
m_action;
8562 bool result =
false;
8565 result = Context.
m_menu.
Show(Context.
m_node, QDomNode(), *
this, Menu,
false);
8582 if (actionName ==
"DIALOG_CUTPOINT_MOVEPREV_0")
8590 BUTTON2(actionName, tr(
"Move Previous Cut End Here"), tr(
"Move Start of Cut Here"));
8593 else if (actionName ==
"DIALOG_CUTPOINT_MOVENEXT_0")
8601 BUTTON2(actionName, tr(
"Move Next Cut Start Here"), tr(
"Move End of Cut Here"));
8604 else if (actionName ==
"DIALOG_CUTPOINT_CUTTOBEGINNING_0")
8607 BUTTON(actionName, tr(
"Cut to Beginning"));
8609 else if (actionName ==
"DIALOG_CUTPOINT_CUTTOEND_0")
8614 BUTTON(actionName, tr(
"Cut to End"));
8617 else if (actionName ==
"DIALOG_CUTPOINT_DELETE_0")
8620 BUTTON2(actionName, tr(
"Delete This Cut"), tr(
"Join Surrounding Cuts"));
8622 else if (actionName ==
"DIALOG_CUTPOINT_NEWCUT_0")
8625 BUTTON(actionName, tr(
"Add New Cut"));
8627 else if (actionName ==
"DIALOG_CUTPOINT_UNDO_0")
8631 QString text = tr(
"Undo - %1");
8632 result = Context.
AddButton(Menu, active, actionName, text,
"",
false,
8635 else if (actionName ==
"DIALOG_CUTPOINT_REDO_0")
8639 QString text = tr(
"Redo - %1");
8640 result = Context.
AddButton(Menu, active, actionName, text,
"",
false,
8643 else if (actionName ==
"DIALOG_CUTPOINT_CLEARMAP_0")
8645 BUTTON(actionName, tr(
"Clear Cuts"));
8647 else if (actionName ==
"DIALOG_CUTPOINT_INVERTMAP_0")
8649 BUTTON(actionName, tr(
"Reverse Cuts"));
8651 else if (actionName ==
"DIALOG_CUTPOINT_LOADCOMMSKIP_0")
8653 BUTTON(actionName, tr(
"Load Detected Commercials"));
8655 else if (actionName ==
"DIALOG_CUTPOINT_REVERT_0")
8657 BUTTON(actionName, tr(
"Undo Changes"));
8659 else if (actionName ==
"DIALOG_CUTPOINT_REVERTEXIT_0")
8661 BUTTON(actionName, tr(
"Exit Without Saving"));
8663 else if (actionName ==
"DIALOG_CUTPOINT_SAVEMAP_0")
8665 BUTTON(actionName, tr(
"Save Cuts"));
8667 else if (actionName ==
"DIALOG_CUTPOINT_SAVEEXIT_0")
8669 BUTTON(actionName, tr(
"Save Cuts and Exit"));
8683 if (!text.isEmpty())
8684 BUTTON(actionName, text);
8696 const QString &actionName = Context.
m_action;
8698 bool result =
false;
8703 result = Context.
m_menu.
Show(Context.
m_node, QDomNode(), *
this, Menu,
false);
8793 if (
prefix ==
"SELECTSUBTITLE_")
8795 else if (
prefix ==
"SELECTRAWTEXT_")
8797 else if (
prefix ==
"SELECTCC708_")
8799 else if (
prefix ==
"SELECTCC608_")
8801 else if (
prefix ==
"SELECTTTC_")
8803 else if (
prefix ==
"SELECTAUDIO_")
8826 static const std::array<const speed,9> s_speeds {{
8827 { 0,
"", tr(
"Adjust")},
8828 { 50,
"0.5", tr(
"0.5x")},
8829 { 90,
"0.9", tr(
"0.9x")},
8830 {100,
"1.0", tr(
"1.0x")},
8831 {110,
"1.1", tr(
"1.1x")},
8832 {120,
"1.2", tr(
"1.2x")},
8833 {130,
"1.3", tr(
"1.3x")},
8834 {140,
"1.4", tr(
"1.4x")},
8835 {150,
"1.5", tr(
"1.5x")},
8838 for (
const auto & speed : s_speeds)
8860 BUTTON(
"CHANGROUP_ALL_CHANNELS", tr(
"All Channels"));
8861 ChannelGroupList::const_iterator it;
8865 QString
action =
prefix + QString::number(it->m_grpId);
8875 static constexpr std::array<const uint,3> kCasOrd { 0, 2, 1 };
8876 for (
uint csm : kCasOrd)
8893 QString chapter1 = QString(
"%1").arg(i+1, size, 10, QChar(48));
8894 QString chapter2 = QString(
"%1").arg(i+1, 3 , 10, QChar(48));
8896 QString desc = chapter1 + QString(
" (%1)").arg(timestr);
8909 QString angleIdx = QString(
"%1").arg(i, 3, 10, QChar(48));
8924 QString titleIdx = QString(
"%1").arg(i, 3, 10, QChar(48));
8937 QVector <QString> addednames;
8939 for (
auto & input : inputs)
8941 if (input.m_inputId == inputid ||
8942 addednames.contains(input.m_displayName))
8945 addednames += input.m_displayName;
8946 QString
action = QString(
"SWITCHTOINPUT_") +
8947 QString::number(input.m_inputId);
8959 uint sourceid =
info[
"sourceid"].toUInt();
8960 QMap<uint, bool> sourceids;
8962 for (
auto & input : inputs)
8964 if (input.m_sourceId == sourceid ||
8965 sourceids[input.m_sourceId])
8968 sourceids[input.m_sourceId] =
true;
8969 QString
action = QString(
"SWITCHTOINPUT_") +
8970 QString::number(input.m_inputId);
8977 if (actionName ==
"TOGGLEAUDIOSYNC")
8979 BUTTON(actionName, tr(
"Adjust Audio Sync"));
8983 BUTTON(actionName, tr(
"None"));
8985 else if (actionName ==
"DISABLEUPMIX")
8990 BUTTON(actionName, tr(
"Disable Audio Upmixer"));
8993 else if (actionName ==
"ENABLEUPMIX")
8998 BUTTON(actionName, tr(
"Auto Detect"));
9001 else if (actionName ==
"AUTODETECT_FILL")
9008 BUTTON(actionName, tr(
"Auto Detect"));
9011 else if (actionName ==
"TOGGLEMANUALZOOM")
9013 BUTTON(actionName, tr(
"Manual Zoom Mode"));
9015 else if (actionName ==
"DISABLESUBS")
9019 BUTTON(actionName, tr(
"Disable Subtitles"));
9021 else if (actionName ==
"ENABLESUBS")
9025 BUTTON(actionName, tr(
"Enable Subtitles"));
9027 else if (actionName ==
"DISABLEFORCEDSUBS")
9033 BUTTON(actionName, tr(
"Disable Forced Subtitles"));
9036 else if (actionName ==
"ENABLEFORCEDSUBS")
9042 BUTTON(actionName, tr(
"Enable Forced Subtitles"));
9045 else if (actionName ==
"DISABLEEXTTEXT")
9049 BUTTON(actionName, tr(
"Disable External Subtitles"));
9051 else if (actionName ==
"ENABLEEXTTEXT")
9055 BUTTON(actionName, tr(
"Enable External Subtitles"));
9057 else if (actionName ==
"TOGGLETTM")
9060 BUTTON(actionName, tr(
"Toggle Teletext Menu"));
9062 else if (actionName ==
"TOGGLESUBZOOM")
9065 BUTTON(actionName, tr(
"Adjust Subtitle Zoom"));
9067 else if (actionName ==
"TOGGLESUBDELAY")
9073 BUTTON(actionName, tr(
"Adjust Subtitle Delay"));
9076 else if (actionName ==
"PAUSE")
9079 BUTTON2(actionName, tr(
"Play"), tr(
"Pause"));
9081 else if (actionName ==
"TOGGLESTRETCH")
9083 BUTTON(actionName, tr(
"Toggle"));
9085 else if (actionName ==
"TOGGLEBROWSE")
9088 BUTTON(actionName, tr(
"Toggle Browse Mode"));
9090 else if (actionName ==
"CANCELPLAYLIST")
9093 BUTTON(actionName, tr(
"Cancel Playlist"));
9095 else if (actionName ==
"DEBUGOSD")
9097 BUTTON(actionName, tr(
"Playback Data"));
9099 else if (actionName ==
"JUMPFFWD")
9102 BUTTON(actionName, tr(
"Jump Ahead"));
9104 else if (actionName ==
"JUMPRWND")
9107 BUTTON(actionName, tr(
"Jump Back"));
9109 else if (actionName ==
"JUMPTODVDROOTMENU")
9114 BUTTON2(actionName, tr(
"DVD Root Menu"), tr(
"Top menu"));
9117 else if (actionName ==
"JUMPTOPOPUPMENU")
9120 BUTTON(actionName, tr(
"Popup menu"));
9122 else if (actionName ==
"JUMPTODVDTITLEMENU")
9125 BUTTON(actionName, tr(
"DVD Title Menu"));
9127 else if (actionName ==
"JUMPTODVDCHAPTERMENU")
9130 BUTTON(actionName, tr(
"DVD Chapter Menu"));
9132 else if (actionName ==
"PREVCHAN")
9135 BUTTON(actionName, tr(
"Previous Channel"));
9137 else if (actionName ==
"GUIDE")
9139 BUTTON(actionName, tr(
"Program Guide"));
9141 else if (actionName ==
"FINDER")
9143 BUTTON(actionName, tr(
"Program Finder"));
9145 else if (actionName ==
"VIEWSCHEDULED")
9147 BUTTON(actionName, tr(
"Upcoming Recordings"));
9149 else if (actionName ==
"SCHEDULE")
9151 BUTTON(actionName, tr(
"Edit Recording Schedule"));
9153 else if (actionName ==
"DIALOG_JUMPREC_X_0")
9155 BUTTON3(actionName, tr(
"Recorded Program"),
"",
true);
9161 else if (actionName ==
"JUMPPREV")
9176 else if (actionName ==
"EDIT")
9182 BUTTON2(actionName, tr(
"Edit Channel"), tr(
"Edit Recording"));
9185 else if (actionName ==
"TOGGLEAUTOEXPIRE")
9191 tr(
"Turn Auto-Expire OFF"), tr(
"Turn Auto-Expire ON"));
9194 else if (actionName ==
"QUEUETRANSCODE")
9199 BUTTON2(actionName, tr(
"Stop Transcoding"), tr(
"Default"));
9202 else if (actionName ==
"QUEUETRANSCODE_AUTO")
9207 BUTTON(actionName, tr(
"Autodetect"));
9210 else if (actionName ==
"QUEUETRANSCODE_HIGH")
9215 BUTTON(actionName, tr(
"High Quality"));
9218 else if (actionName ==
"QUEUETRANSCODE_MEDIUM")
9223 BUTTON(actionName, tr(
"Medium Quality"));
9226 else if (actionName ==
"QUEUETRANSCODE_LOW")
9231 BUTTON(actionName, tr(
"Low Quality"));
9238 BUTTON(actionName, tr(
"Cast"));
9249 if (!text.isEmpty())
9250 BUTTON(actionName, text);
9310 QString cur_channum = QString();
9313 if (!prev_channum.isEmpty() && prev_channum != cur_channum)
9365 QString text = Menu.
Translate(Node.toElement().attribute(
"text", Menu.
GetName()));
9366 const char* windowtitle {
"???" };
9372 Menu.
Show(Node, Selected, *
this, &
menu);
9373 QDomNode parent = Node.parentNode();
9374 if (!parent.parentNode().isNull())
9378 menu.m_back = {
"", v };
9387 map.insert(
"title", tr(
"Edit"));
9396 (void)tr(
"Playback Menu");
9397 (void)tr(
"Playback Compact Menu");
9399 (void)tr(
"Select Audio Track");
9400 (void)tr(
"Visualisation");
9402 (void)tr(
"Change Aspect Ratio");
9403 (void)tr(
"Adjust Fill");
9404 (void)tr(
"Adjust Picture");
9406 (void)tr(
"Advanced");
9407 (void)tr(
"Video Scan");
9408 (void)tr(
"Deinterlacer");
9409 (void)tr(
"Subtitles");
9410 (void)tr(
"Select Subtitle");
9411 (void)tr(
"Text Subtitles");
9412 (void)tr(
"Select ATSC CC");
9413 (void)tr(
"Select VBI CC");
9414 (void)tr(
"Select Teletext CC");
9415 (void)tr(
"Playback");
9416 (void)tr(
"Adjust Time Stretch");
9417 (void)tr(
"Picture-in-Picture");
9419 (void)tr(
"Channel Groups");
9420 (void)tr(
"Navigate");
9421 (void)tr(
"Commercial Auto-Skip");
9422 (void)tr(
"Chapter");
9425 (void)tr(
"Schedule");
9427 (void)tr(
"Jump to Program");
9428 (void)tr(
"Switch Input");
9429 (void)tr(
"Switch Source");
9431 (void)tr(
"Begin Transcoding");
9433 (void)tr(
"Recorded");
9434 (void)tr(
"Upcoming");
9437 (void)tr(
"Edit Cut Points");
9438 (void)tr(
"Edit Cut Points (Compact)");
9439 (void)tr(
"Cut List Options");
9447 "menu_playback.xml", tr(
"Playback Menu"),
9448 metaObject()->className(),
"TV Playback");
9450 "menu_playback_compact.xml", tr(
"Playback Compact Menu"),
9451 metaObject()->className(),
"TV Playback");
9463 if (Level < 0 || Level > 1)
9477 QList<QString> titles_seen;
9483 for (
auto *pi : *infoList)
9485 if (pi->GetRecordingGroup() !=
"LiveTV" || LiveTVInAllPrograms ||
9486 pi->GetRecordingGroup() == currecgroup)
9494 QMap<QString,ProgramList>::const_iterator Iprog;
9498 auto progIndex =
static_cast<uint>(plist.
size());
9499 const QString& group = Iprog.key();
9504 if (progIndex == 1 && Level == 0)
9506 dialog.m_buttons.push_back( {Iprog.key(), QString(
"JUMPPROG %1 0").arg(group) });
9508 else if (progIndex > 1 && Level == 0)
9510 QString act = QString(
"DIALOG_%1_%2_1")
9512 dialog.m_buttons.push_back( {group, act,
true, Selected == group });
9514 else if (Level == 1 && Iprog.key() == Category)
9516 for (
auto pit = plist.
begin(); pit != plist.
end(); ++pit)
9520 if (titles_seen.contains(
p->GetTitle()))
9523 titles_seen.push_back(
p->GetTitle());
9526 for (
auto *q : plist)
9530 if (q->GetTitle() !=
p->GetTitle())
9533 dialog.m_buttons.push_back( { q->GetSubtitle().isEmpty() ?
9534 q->GetTitle() : q->GetSubtitle(),
9535 QString(
"JUMPPROG %1 %2").arg(Iprog.key()).arg(j) });
9543 while (!infoList->empty())
9545 delete infoList->back();
9546 infoList->pop_back();
9551 if (!Category.isEmpty())
9554 dialog.m_back = { Category,
"DIALOG_" +
ACTION_JUMPREC +
"_X_0" };
9555 else if (Level == 0)
9569 bool recorded = (
ProgInfo.GetFilesize() > 0);
9570 QString table = recorded ?
"recordedcredits" :
"credits";
9577 query.
prepare(QString(
"SELECT role, people.name,"
9578 " roles.name, people.person FROM %1"
9580 " LEFT JOIN people ON"
9581 " credits.person = people.person"
9582 " LEFT JOIN roles ON"
9583 " credits.roleid = roles.roleid"
9584 " WHERE credits.chanid = :CHANID"
9585 " AND credits.starttime = :STARTTIME"
9586 " AND role IN ('guest','actor','guest_star')"
9587 " ORDER BY role, priority;").arg(table));
9592 if (query.
exec() && query.
size() > 0)
9601 role = query.
value(0).toString();
9617 int pid = query.
value(3).toInt();
9618 pname = QString::fromUtf8(query.
value(1)
9619 .toByteArray().constData()) +
9620 "|" + QString::number(pid);
9621 character = QString::fromUtf8(query.
value(2)
9622 .toByteArray().constData());
9624 if (role ==
"actor")
9625 m_actors.append(qMakePair(pname, character));
9626 else if (role ==
"guest_star")
9628 else if (role ==
"guest")
9629 m_guests.append(qMakePair(pname, character));
9636 const QVector<string_pair> & people)
9638 for (
const auto & [actor, role] : std::as_const(people))
9642 dialog.
m_buttons.push_back( {actor.split(
'|')[0],
9643 QString(
"JUMPCAST|%1").arg(actor),
true} );
9647 dialog.
m_buttons.push_back( {QString(
"%1 as %2")
9648 .arg(actor.split(
'|')[0], role),
9649 QString(
"JUMPCAST|%1").arg(actor),
true} );
9667 const QString & category)
9671 if (category.isEmpty())
9673 dialog.
m_buttons.push_back( {
"Recorded",
9674 QString(
"JUMPCAST|%1|%2|Recorded").arg(actor).arg(person_id) } );
9675 dialog.m_buttons.push_back( {
"Upcoming",
9676 QString(
"JUMPCAST|%1|%2|Upcoming").arg(actor).arg(person_id) } );
9681 if (category ==
"Upcoming")
9693 QString table =
"recordedcredits";
9695 query.
prepare(QString(
"SELECT chanid, starttime from %1"
9696 " where person = :PERSON"
9697 " ORDER BY starttime;").arg(table));
9700 QDateTime starttime;
9701 if (query.
exec() && query.
size() > 0)
9705 int chanid = query.
value(0).toInt();
9707 auto *pi =
new ProgramInfo(chanid, starttime.toUTC());
9708 if (!pi->GetTitle().isEmpty() &&
9709 pi->GetRecordingGroup() !=
"LiveTV" &&
9710 pi->GetRecordingGroup() !=
"Deleted")
9723 show = pi->GetTitle();
9726 if (!pi->GetSubtitle().isEmpty())
9728 show += QString(
" %1x%2 %3").arg(pi->GetSeason())
9729 .arg(pi->GetEpisode())
9730 .arg(pi->GetSubtitle());
9733 dialog.m_buttons.push_back( {
show,
9734 QString(
"JUMPPROG %1 %2").arg(actor).arg(++idx) });
9751 if (!message.isEmpty())
9764 desc = tr(
"Auto-Expire OFF");
9769 desc = tr(
"Auto-Expire ON");
9774 if (!desc.isEmpty())
9790 if (!desc.isEmpty())
9799 if (!Desc.isEmpty())
9815 for (
const auto&
action : std::as_const(Actions))
9817 if (!
action.startsWith(
"JUMPPROG"))
9821 QString key =
action.section(
" ",1,-2);
9822 uint index =
action.section(
" ",-1,-1).toUInt(&ok);
9839 LOG(VB_GENERAL, LOG_ERR,
LOC + QString(
"Failed to locate jump to program '%1' @ %2")
9840 .arg(key,
action.section(
" ",-1,-1)));
9862 QTimer::singleShot(0,
this, Jump);
9870 LOG(VB_GENERAL, LOG_ERR,
"Failed to open jump to program GUI");
9878 std::chrono::minutes mins { 0min };
9901 if (Time.length() > 11)
9903 bool intRead =
false;
9904 mins = std::chrono::minutes(Time.right(Time.length() - 11).toUInt(&intRead));
9917 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Invalid time " + Time);
9922 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Invalid time string " + Time);
9934 out = tr(
"Sleep") +
" " + QString::number(mins.count());
9947 errorText = tr(
"MythTV is already using all available "
9948 "inputs for the channel you selected. "
9949 "If you want to watch an in-progress recording, "
9950 "select one from the playback menu. If you "
9951 "want to watch Live TV, cancel one of the "
9952 "in-progress recordings from the delete "
9956 errorText = tr(
"Error: MythTV is using all inputs, "
9957 "but there are no active recordings?");
9960 errorText = tr(
"MythTV has no capture cards defined. "
9961 "Please run the mythtv-setup program.");
10098 else if (!dvd->StartOfTitle())
10104 std::chrono::seconds titleLength = dvd->GetTotalTimeOfTitle();
10105 std::chrono::seconds
chapterLength = dvd->GetChapterLength();
10128 bool in_menu = dvd->IsInMenu();
10129 if (in_still && !dvd->NumMenuButtons())
10131 dvd->SkipStillFrame();
10134 else if (!dvd->EndOfTitle() && !in_still && !in_menu)
10138 else if (!in_still && !in_menu)
10140 std::chrono::seconds titleLength = dvd->GetTotalTimeOfTitle();
10141 std::chrono::seconds
chapterLength = dvd->GetChapterLength();
10142 std::chrono::seconds currentTime = dvd->GetCurrentTime();
10187 bool allowed =
false;
10210 videotype = tr(
"Live TV");
10212 videotype = tr(
"this DVD");
10216 videotype = tr(
"this Video");
10219 if (videotype.isEmpty())
10220 videotype = tr(
"this recording");
10224 dialog.m_buttons.push_back({tr(
"Exit %1").arg(videotype),
ACTION_STOP});
10226 dialog.m_buttons.push_back({tr(
"Exit Without Saving"),
"DIALOG_VIDEOEXIT_CLEARLASTPLAYEDPOSITION_0"});
10229 dialog.m_buttons.push_back({tr(
"Delete this recording"),
"DIALOG_VIDEOEXIT_CONFIRMDELETE_0"});
10231 dialog.m_buttons.push_back({tr(
"Keep watching"),
"DIALOG_VIDEOEXIT_KEEPWATCHING_0"});
10232 dialog.m_back = {
"",
"DIALOG_VIDEOEXIT_KEEPWATCHING_0",
true };
10233 emit ChangeOSDDialog(dialog);
10235 if (m_videoExitDialogTimerId)
10236 KillTimer(m_videoExitDialogTimerId);
10237 m_videoExitDialogTimerId = StartTimer(kVideoExitDialogTimeout, __LINE__);
10247 LOG(VB_GENERAL, LOG_ERR,
"It is unsafe to delete at the moment");
10255 LOG(VB_GENERAL, LOG_ERR,
"This program cannot be deleted at this time.");
10262 QString message = tr(
"Cannot delete program ") + QString(
"%1 ").arg(pginfo.
GetTitle());
10265 message += QString(
"\"%1\" ").arg(pginfo.
GetSubtitle());
10269 message += tr(
"because it is not a recording.");
10273 message += tr(
"because it is in use by");
10276 for (
int i = 0; (i + 2) < byWho.size(); i += 3)
10282 message +=
" " + byWho[i+2];
10286 {{ tr(
"OK"),
"DIALOG_DELETE_OK_0" }},
10287 {
"",
"DIALOG_DELETE_OK_0",
true }});
10310 QString message = QString(
"%1\n%2\n%3")
10311 .arg(Title, infoMap[
"title"], infoMap[
"timedate"]);
10317 if (Title ==
"End Of Recording")
10319 dialog.m_buttons.push_back({tr(
"Delete it, but allow it to re-record"),
"DIALOG_VIDEOEXIT_DELETEANDRERECORD_0"});
10320 dialog.m_buttons.push_back({tr(
"Delete it"),
"DIALOG_VIDEOEXIT_JUSTDELETE_0"});
10321 dialog.m_buttons.push_back({tr(
"Save it so I can watch it again"),
ACTION_STOP,
false,
true});
10325 dialog.m_buttons.push_back({tr(
"Yes, and allow re-record"),
"DIALOG_VIDEOEXIT_DELETEANDRERECORD_0"});
10326 dialog.m_buttons.push_back({tr(
"Yes, delete it"),
"DIALOG_VIDEOEXIT_JUSTDELETE_0"});
10327 dialog.m_buttons.push_back({tr(
"No, keep it"),
ACTION_STOP,
false,
true});
10329 dialog.m_back = {
"",
"DIALOG_PLAY_0_0",
true };
10353 if (
Action ==
"DELETEANDRERECORD" && delete_ok)
10360 else if (
Action ==
"JUSTDELETE" && delete_ok)
10366 else if (
Action ==
"CONFIRMDELETE")
10371 else if (
Action ==
"KEEPWATCHING" && !near_end)
10375 else if (
Action ==
"CLEARLASTPLAYEDPOSITION")
10453 bool paused =
false;
10505 case Qt::ApplicationState::ApplicationSuspended:
10507 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)
QString GetSortTitle(void) const
static constexpr const char * OSD_DLG_MENU
void SetLength(std::chrono::seconds len)
bool isActive(void) const
@ kState_WatchingBD
Watching BD is the state when we are watching a BD.
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...
QVector< string_pair > m_actors
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
RemoteEncoder * RemoteGetExistingRecorder(const ProgramInfo *pginfo)
void switchToChannel(const QString &channum="", const QString &title="", const QString &subtitle="")
@ kState_None
None State, this is the initial state in both TV and TVRec, it indicates that we are ready to change ...
uint64_t TranslatePositionAbsToRel(uint64_t position) const
static QString GetDisplayName(uint inputid)
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.
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)
QString GetHostname(void) const
void ShowOSDMenu(bool isCompact=false)
void SetExitPlayer(bool SetIt, bool WantsTo)
MythOverlayState m_overlayState
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.
@ kPictureAttribute_Colour
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.
ChannelChangeDirection
ChannelChangeDirection is an enumeration of possible channel changing directions.
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
@ kPictureAttributeSupported_Volume
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 RetrieveCast(const ProgramInfo &ProgInfo)
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)
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
@ BROWSE_UP
Fetch information on previous channel.
QString GetAngleName(int Angle)
void ChangeChannel(const ChannelInfoList &Options)
#define ACTION_TOGGLEPGORDER
#define ACTION_PREVRECORDED
@ CHANNEL_DIRECTION_FAVORITE
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_)
@ kPictureAttributeSupported_Range
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.
static void show(uint8_t *buf, int length)
bool PictureAttributeHandleAction(const QStringList &Actions)
@ kOSDFunctionalType_PictureAdjust
@ kAdjustFill_AutoDetect_DefaultHalf
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_Colour
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
@ kPictureAttributeSupported_Brightness
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={})
QDateTime GetRecordingStartTime(void) const
Approximate time the recording started.
QString GetPathname(void) const
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
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)
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
float GetPlaySpeed(void) const
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)
static std::vector< uint > GetInputGroups(uint inputid)
static constexpr const char * OSD_WIN_STATUS
bool IsVideoBD(void) const
@ kPictureAttributeSupported_Contrast
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()
@ BROWSE_RIGHT
Fetch information on current channel in the future.
#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
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)
PictureAttributeSupported
MythTVMenu m_cutlistCompactMenu
static const std::chrono::milliseconds kInputModeTimeout
void ChangeSpeed(int Direction)
bool AudioSyncHandleAction(const QStringList &Actions)
static int GetCount(void)
void DoEditSchedule(int EditType=kScheduleProgramGuide, const QString &EditArg="")
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)
void FillOSDMenuActorShows(const QString &actor, int person_id, const QString &category="")
InfoMap m_chanEditMap
Channel Editing initial map.
static const uint kPreviousSource
#define ACTION_3DTOPANDBOTTOMDISCARD
static QStringList lastProgramStringList
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)
@ kPictureAttribute_Volume
#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)
static int comp_originalAirDate_rev(const ProgramInfo *a, const ProgramInfo *b)
QRecursiveMutex m_chanEditMapLock
Lock for chanEditMap and ddMap.
void HandleEndOfRecordingExitPromptTimerEvent()
void SendSystemEvent(const QString &msg)
QHash< QString, int > values
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)
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
@ kDisplayRawTextSubtitle
std::chrono::seconds GetTitleDuration(int Title)
@ kAdjustingPicture_Channel
MythMediaBuffer * m_buffer
static EMBEDRETURNVOID RunPlaybackBoxPtr
void ChangeChannel(int channeldirection)
void(*)(TV *, int, const QString &) EMBEDRETURNVOIDPROGLIST
void SetTeletextPage(uint Page)
MBASE_PUBLIC int naturalCompare(const QString &_a, const QString &_b, Qt::CaseSensitivity caseSensitivity=Qt::CaseSensitive)
This method chops the input a and b into pieces of digits and non-digits (a1.05 becomes a | 1 | .
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
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
@ kOSDFunctionalType_SubtitleZoomAdjust
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...
#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
@ kStartTVIgnoreProgStart
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)
@ kDisplayNUVTeletextCaptions
std::deque< QString > StringDeque
static bool IsTunable(uint ChanId)
void RegisterForPlayback(QObject *sender, PlaybackStartCb method)
static const uint kInputKeysMax
void SetLastProgram(const ProgramInfo *ProgInfo)
QVector< string_pair > m_guest_stars
@ kOSDFunctionalType_TimeStretchAdjust
#define ACTION_ZOOMVERTICALOUT
void SetFunctionalWindow(const QString &Window, enum OSDFunctionalType Type)
static uint get_chanid(const PlayerContext *ctx, uint cardid, const QString &channum)
@ kState_Error
Error State, if we ever try to enter this state errored is set.
AdjustFillMode m_adjustFillMode
std::chrono::seconds m_playingLen
Initial CalculateLength()
bool m_asInputMode
Are we in Arbitrary seek input mode?
#define ACTION_ENABLEEXTTEXT
@ kState_WatchingLiveTV
Watching LiveTV is the state for when we are watching a recording and the user has control over the c...
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
QString toTypeString(PictureAdjustType type)
@ kStartTVByNetworkCommand
#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)
void PlaybackMenuInit(const MythTVMenu &Menu)
bool IsSameProgram(const ProgramInfo &p) const
void ShowOSDStopWatchingRecording()
@ kState_ChangingState
This is a placeholder state which we never actually enter, but is returned by GetState() when we are ...
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
static eu8 clamp(eu8 value, eu8 low, eu8 high)
void ChangeAudioOffset(std::chrono::milliseconds Delta, std::chrono::milliseconds Value=-9999ms)
void InitialisePlayerState()
PictureAttributeSupported m_supportedAttributes
@ kOSDFunctionalType_SubtitleDelayAdjust
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.
void ShowLCDChannelInfo()
@ kAdjustingPicture_Recording
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
static MythDB * getMythDB()
QDate GetOriginalAirDate(void) const
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
@ kState_WatchingRecording
Watching Recording is the state for when we are watching an in progress recording,...
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.
void HandleOSDInfo(const QString &Action)
@ kStartTVIgnoreLastPlayPos
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
@ kState_WatchingPreRecorded
Watching Pre-recorded is a TV only state for when we are watching a pre-existing recording.
QString GetError(void) const
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.
QString GetInputType(int pos=-1) const
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)
uint GetEpisode(void) const
void ReturnPlayerLock() const
@ kPictureAttributeSupported_None
AutoExpireType QueryAutoExpire(void) const
Returns "autoexpire" field from "recorded" table.
static bool comp_title(const ProgramInfo *a, const ProgramInfo *b)
void ShowOSDPromptDeleteRecording(const QString &Title, bool Force=false)
static const uint kNextSource
int GetValue(PictureAttribute Attribute)
void SetWatchingRecording(bool mode)
static QString GetIcon(uint chanid)
@ kOSDFunctionalType_SmartForward
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={})
#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
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)
uint GetSeason(void) const
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.
@ kState_WatchingVideo
Watching Video is the state when we are watching a video and is not a dvd or BD.
const QString kPlayerInUseID
bool SwitchToGUI(bool Wait=false)
Switches to the GUI resolution.
void ChangeOSDPositionUpdates(bool Enable)
MythTimer m_lastSignalMsgTime
@ kPictureAttribute_Range
volatile int m_channelGroupId
void SetIgnoreBookmark(bool ignore)
If "ignore" is true GetBookmark() will return 0, otherwise GetBookmark() will return the bookmark pos...
void EditSchedule(int EditType=kScheduleProgramGuide, const QString &arg="")
void SwitchSource(uint Direction)
bool IsFileReadable(void)
Attempts to ascertain if the main file for this ProgramInfo is readable.
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)
@ kOSDFunctionalType_AudioSyncAdjust
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].
volatile int m_speedChangeTimerId
void EmbedPlayback(bool Embed, const QRect &Rect={})
static void FillOSDMenuCastButton(MythOSDDialogData &dialog, const QVector< string_pair > &people)
float DoTogglePauseStart()
static EMBEDRETURNVOID RunViewScheduledPtr
@ kTrackTypeTeletextCaptions
bool event(QEvent *Event) override
This handles all standard events.
MythNotificationCenter * GetNotificationCenter(void)
TVState
TVState is an enumeration of the states used by TV and TVRec.
TVState DequeueNextState(void)
bool IsVideoDVD(void) const
#define ACTION_TOGGLERECCONTROLS
int m_sleepDialogTimerId
Timer for sleep dialog.
bool InStateChange(void) const
@ kPictureAttributeSupported_Hue
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
#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.
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)
QVector< string_pair > m_guests
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)
@ kState_RecordingOnly
Recording Only is a TVRec only state for when we are recording a program, but there is no one current...
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)
@ kPictureAttribute_Contrast
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
@ kStereoscopicModeTopAndBottomDiscard
#define ACTION_BIGJUMPFWD
void WantingPlayback(QObject *sender)
All the objects that have registered using MythCoreContext::RegisterForPlayback but sender will be ca...
void DoQueueTranscode(const QString &Profile)
bool DoPlayerSeekToFrame(uint64_t FrameNum)
@ kAdjustFill_AutoDetect_DefaultOff
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
@ BROWSE_DOWN
Fetch information on next channel.
static const std::chrono::milliseconds kLCDTimeout
@ kStereoscopicModeSideBySideDiscard
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()
@ BROWSE_FAVORITE
Fetch information on the next favorite channel.
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)
void FillOSDMenuCast(void)
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)
static QString GetChanNum(int chan_id)
Returns the channel-number string of the given channel.
void ChangeStereoOverride(StereoscopicMode Mode)
void UnlockState(void) const
static constexpr const char * OSD_DLG_EDITING
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
#define ACTION_NEXTSUBPAGE
#define ACTION_EXITSHOWNOPROMPTS
bool IsRecording(void) const
static EMBEDRETURNVOIDPROGLIST RunProgramListPtr
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)
@ kDisplayTeletextCaptions
bool DoSetPauseState(bool Pause)
void PauseAudioUntilReady()
bool DoPlayerSeek(float Time)
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
#define ACTION_JUMPCHAPTER
@ kState_WatchingDVD
Watching DVD is the state when we are watching a DVD.
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.
@ kStereoscopicModeIgnore3D
static int comp_season_rev(const ProgramInfo *a, const ProgramInfo *b)
static const std::chrono::milliseconds kVideoExitDialogTimeout
@ kPictureAttribute_Brightness
bool m_audiosyncAdjustment
True if audiosync is turned on.
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)
@ kOSDFunctionalType_Default
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)
@ BROWSE_LEFT
Fetch information on current channel in the past.
void enqueue(const T &d)
Adds item to the back of the list. O(1).
void ChangeTrack(uint Type, int Direction)
@ kAdjustingPicture_Playback
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
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
@ kNoTuners
No capture cards configured.
QString m_dbChannelFormat