Go to the documentation of this file.
11 #include <QApplication>
12 #include <QDomDocument>
13 #include <QDomElement>
18 #include <QRegularExpression>
20 #include <QTimerEvent>
23 #include "libmythbase/mythconfig.h"
77 #define DEBUG_CHANNEL_PREFIX 0
78 #define DEBUG_ACTIONS 0
80 #define LOC QString("TV::%1(): ").arg(__func__)
90 query.
prepare(
"SELECT COUNT(cardid) FROM capturecard;");
92 count = query.
value(0).toInt();
94 LOG(VB_RECORD, LOG_INFO,
95 "ConfiguredTunerCards() = " + QString::number(count));
109 static QMutex s_lock;
110 static TV* s_tv =
nullptr;
111 QMutexLocker locker(&s_lock);
123 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Ref count error");
169 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Already have a player");
175 auto flags =
static_cast<PlayerFlags>(playerflags);
208 LOG(VB_GENERAL, LOG_ERR,
LOC +
"StartPlaying() Failed to start player");
213 MaxWait = (MaxWait <= 0ms) ? 20s : MaxWait;
214 #ifdef USING_VALGRIND
215 MaxWait = std::chrono::milliseconds::max();
216 #endif // USING_VALGRIND
225 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
226 QString(
"StartPlaying(): took %1 ms to start player.")
227 .arg(
t.elapsed().count()));
230 LOG(VB_GENERAL, LOG_ERR,
LOC +
"StartPlaying() Failed to start player");
262 LOG(VB_GENERAL, LOG_WARNING,
LOC +
"Already have a TV object.");
267 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"-- begin");
270 bool quitAll =
false;
271 bool showDialogs =
true;
272 bool playCompleted =
false;
274 bool startSysEventSent =
false;
275 bool startLivetvEventSent =
false;
288 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Failed initializing TV");
310 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"tv->Playback() -- begin");
315 else if (!startSysEventSent)
317 startSysEventSent =
true;
321 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"tv->Playback() -- end");
325 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"tv->LiveTV() -- begin");
326 if (!tv->
LiveTV(showDialogs, Selection))
331 else if (!startSysEventSent)
333 startSysEventSent =
true;
334 startLivetvEventSent =
true;
338 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"tv->LiveTV() -- end");
343 LOG(VB_GENERAL, LOG_ERR,
LOC +
"No tuners configured");
345 LOG(VB_GENERAL, LOG_ERR,
LOC +
"No tuners free for live tv");
356 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Entering main playback loop.");
358 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Exiting main playback loop.");
366 curProgram = nextProgram;
380 quitAll |= !playerError.isEmpty();
383 QCoreApplication::processEvents();
387 playCompleted =
true;
397 if (startSysEventSent)
405 list.push_back(allowrerecord ?
"1" :
"0");
406 MythEvent me(
"LOCAL_PBB_DELETE_RECORDINGS", list);
417 else if (startSysEventSent)
422 if (!playerError.isEmpty())
432 if (startLivetvEventSent)
435 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"-- end");
437 return playCompleted;
447 if (name ==
"playbackbox")
449 else if (name ==
"viewscheduled")
451 else if (name ==
"programguide")
453 else if (name ==
"programfinder")
455 else if (name ==
"scheduleeditor")
462 "Play Program"),
"P,Media Play");
464 "Stop Program"),
"");
466 "Toggle recording status of current program"),
"R");
468 "Page the program guide back one day"),
"Home,Media Previous");
470 "Page the program guide forward one day"),
"End,Media Next");
472 "Page the program guide left"),
",,<,Ctrl+B,Media Rewind");
474 "Page the program guide right"),
">,.,Ctrl+F,Media Fast Forward");
476 "Toggle the current channel as a favorite"),
"?");
478 "Reverse the channel order in the program guide"),
"");
480 "Show the Program Guide"),
"S");
482 "Show the Program Finder"),
"#");
484 "Show the Channel Search"),
"");
485 REG_KEY(
"TV Frontend",
"NEXTFAV", QT_TRANSLATE_NOOP(
"MythControls",
486 "Cycle through channel groups and all channels in the "
487 "program guide."),
"/");
488 REG_KEY(
"TV Frontend",
"CHANUPDATE", QT_TRANSLATE_NOOP(
"MythControls",
489 "Switch channels without exiting guide in Live TV mode."),
"X");
491 "Volume down"),
"[,{,F10,Volume Down");
493 "Volume up"),
"],},F11,Volume Up");
495 "Mute"),
"|,\\,F9,Volume Mute");
496 REG_KEY(
"TV Frontend",
"CYCLEAUDIOCHAN", QT_TRANSLATE_NOOP(
"MythControls",
497 "Cycle audio channels"),
"");
498 REG_KEY(
"TV Frontend",
"RANKINC", QT_TRANSLATE_NOOP(
"MythControls",
499 "Increase program or channel rank"),
"Right");
500 REG_KEY(
"TV Frontend",
"RANKDEC", QT_TRANSLATE_NOOP(
"MythControls",
501 "Decrease program or channel rank"),
"Left");
502 REG_KEY(
"TV Frontend",
"UPCOMING", QT_TRANSLATE_NOOP(
"MythControls",
503 "List upcoming episodes"),
"O");
505 "List scheduled upcoming episodes"),
"");
507 "List previously recorded episodes"),
"");
508 REG_KEY(
"TV Frontend",
"DETAILS", QT_TRANSLATE_NOOP(
"MythControls",
509 "Show details"),
"U");
510 REG_KEY(
"TV Frontend",
"VIEWINPUT", QT_TRANSLATE_NOOP(
"MythControls",
511 "Switch Recording Input view"),
"C");
512 REG_KEY(
"TV Frontend",
"CUSTOMEDIT", QT_TRANSLATE_NOOP(
"MythControls",
513 "Edit Custom Record Rule"),
"");
514 REG_KEY(
"TV Frontend",
"CHANGERECGROUP", QT_TRANSLATE_NOOP(
"MythControls",
515 "Change Recording Group"),
"");
516 REG_KEY(
"TV Frontend",
"CHANGEGROUPVIEW", QT_TRANSLATE_NOOP(
"MythControls",
517 "Change Group View"),
"");
519 "List recorded episodes"),
"");
539 if (selectKeys !=
"?")
542 togBkmKeys = selectKeys;
544 bkmKeys = selectKeys;
548 "Add Bookmark"), bkmKeys);
550 "Toggle Bookmark"), togBkmKeys);
551 REG_KEY(
"TV Playback",
"BACK", QT_TRANSLATE_NOOP(
"MythControls",
552 "Exit or return to DVD menu"),
"Esc,Back");
554 "Playback Compact Menu"),
"Alt+M");
556 "Clear OSD"),
"Backspace");
558 "Pause"),
"P,Space,Media Play");
560 "Fast Forward"),
"Right");
564 "Arbitrary Seek"),
"*");
566 "Seek to a position in seconds"),
"");
568 "Channel up"),
"Up");
570 "Channel down"),
"Down");
571 REG_KEY(
"TV Playback",
"NEXTFAV", QT_TRANSLATE_NOOP(
"MythControls",
572 "Switch to the next favorite channel"),
"/");
573 REG_KEY(
"TV Playback",
"PREVCHAN", QT_TRANSLATE_NOOP(
"MythControls",
574 "Switch to the previous channel"),
"H");
576 "Jump ahead"),
"PgDown");
578 "Jump back"),
"PgUp");
579 REG_KEY(
"TV Playback",
"INFOWITHCUTLIST", QT_TRANSLATE_NOOP(
"MythControls",
580 "Info utilizing cutlist"),
"");
582 "Jump to bookmark"),
"K");
583 REG_KEY(
"TV Playback",
"FFWDSTICKY", QT_TRANSLATE_NOOP(
"MythControls",
584 "Fast Forward (Sticky) or Forward one second while paused"),
">,.,Ctrl+F,Media Fast Forward");
585 REG_KEY(
"TV Playback",
"RWNDSTICKY", QT_TRANSLATE_NOOP(
"MythControls",
586 "Rewind (Sticky) or Rewind one second while paused"),
",,<,Ctrl+B,Media Rewind");
587 REG_KEY(
"TV Playback",
"NEXTSOURCE", QT_TRANSLATE_NOOP(
"MythControls",
588 "Next Video Source"),
"Y");
589 REG_KEY(
"TV Playback",
"PREVSOURCE", QT_TRANSLATE_NOOP(
"MythControls",
590 "Previous Video Source"),
"");
591 REG_KEY(
"TV Playback",
"NEXTINPUT", QT_TRANSLATE_NOOP(
"MythControls",
593 REG_KEY(
"TV Playback",
"NEXTCARD", QT_TRANSLATE_NOOP(
"MythControls",
595 REG_KEY(
"TV Playback",
"SKIPCOMMERCIAL", QT_TRANSLATE_NOOP(
"MythControls",
596 "Skip Commercial"),
"Z,End,Media Next");
597 REG_KEY(
"TV Playback",
"SKIPCOMMBACK", QT_TRANSLATE_NOOP(
"MythControls",
598 "Skip Commercial (Reverse)"),
"Q,Home,Media Previous");
600 "Jump to the start of the recording."),
"Ctrl+A");
601 REG_KEY(
"TV Playback",
"TOGGLEBROWSE", QT_TRANSLATE_NOOP(
"MythControls",
602 "Toggle channel browse mode"),
"O");
604 "Toggle recording status of current program"),
"R");
606 "Toggle the current channel as a favorite"),
"?");
608 "Volume down"),
"[,{,F10,Volume Down");
610 "Volume up"),
"],},F11,Volume Up");
612 "Mute"),
"|,\\,F9,Volume Mute");
614 "Set the volume"),
"");
615 REG_KEY(
"TV Playback",
"CYCLEAUDIOCHAN", QT_TRANSLATE_NOOP(
"MythControls",
616 "Cycle audio channels"),
"");
618 "Toggle audio upmixer"),
"Ctrl+U");
620 QT_TRANSLATE_NOOP(
"MythControls",
"Move BottomLine off screen"),
"L");
622 QT_TRANSLATE_NOOP(
"MythControls",
"Save manual zoom for BottomLine"),
"");
623 REG_KEY(
"TV Playback",
"TOGGLEASPECT", QT_TRANSLATE_NOOP(
"MythControls",
624 "Toggle the video aspect ratio"),
"Ctrl+W");
625 REG_KEY(
"TV Playback",
"TOGGLEFILL", QT_TRANSLATE_NOOP(
"MythControls",
626 "Next Preconfigured Zoom mode"),
"W");
628 "Toggle any captions"),
"T");
630 "Enable any captions"),
"");
632 "Disable any captions"),
"");
633 REG_KEY(
"TV Playback",
"TOGGLETTC", QT_TRANSLATE_NOOP(
"MythControls",
634 "Toggle Teletext Captions"),
"");
635 REG_KEY(
"TV Playback",
"TOGGLESUBTITLE", QT_TRANSLATE_NOOP(
"MythControls",
636 "Toggle Subtitles"),
"");
637 REG_KEY(
"TV Playback",
"TOGGLECC608", QT_TRANSLATE_NOOP(
"MythControls",
638 "Toggle VBI CC"),
"");
639 REG_KEY(
"TV Playback",
"TOGGLECC708", QT_TRANSLATE_NOOP(
"MythControls",
640 "Toggle ATSC CC"),
"");
641 REG_KEY(
"TV Playback",
"TOGGLETTM", QT_TRANSLATE_NOOP(
"MythControls",
642 "Toggle Teletext Menu"),
"");
644 "Toggle External Subtitles"),
"");
646 "Enable External Subtitles"),
"");
648 "Disable External Subtitles"),
"");
649 REG_KEY(
"TV Playback",
"TOGGLERAWTEXT", QT_TRANSLATE_NOOP(
"MythControls",
650 "Toggle Text Subtitles"),
"");
652 REG_KEY(
"TV Playback",
"SELECTAUDIO_0", QT_TRANSLATE_NOOP(
"MythControls",
653 "Play audio track 1"),
"");
654 REG_KEY(
"TV Playback",
"SELECTAUDIO_1", QT_TRANSLATE_NOOP(
"MythControls",
655 "Play audio track 2"),
"");
656 REG_KEY(
"TV Playback",
"SELECTSUBTITLE_0",QT_TRANSLATE_NOOP(
"MythControls",
657 "Display subtitle 1"),
"");
658 REG_KEY(
"TV Playback",
"SELECTSUBTITLE_1",QT_TRANSLATE_NOOP(
"MythControls",
659 "Display subtitle 2"),
"");
660 REG_KEY(
"TV Playback",
"SELECTRAWTEXT_0",QT_TRANSLATE_NOOP(
"MythControls",
661 "Display Text Subtitle 1"),
"");
662 REG_KEY(
"TV Playback",
"SELECTCC608_0", QT_TRANSLATE_NOOP(
"MythControls",
663 "Display VBI CC1"),
"");
664 REG_KEY(
"TV Playback",
"SELECTCC608_1", QT_TRANSLATE_NOOP(
"MythControls",
665 "Display VBI CC2"),
"");
666 REG_KEY(
"TV Playback",
"SELECTCC608_2", QT_TRANSLATE_NOOP(
"MythControls",
667 "Display VBI CC3"),
"");
668 REG_KEY(
"TV Playback",
"SELECTCC608_3", QT_TRANSLATE_NOOP(
"MythControls",
669 "Display VBI CC4"),
"");
670 REG_KEY(
"TV Playback",
"SELECTCC708_0", QT_TRANSLATE_NOOP(
"MythControls",
671 "Display ATSC CC1"),
"");
672 REG_KEY(
"TV Playback",
"SELECTCC708_1", QT_TRANSLATE_NOOP(
"MythControls",
673 "Display ATSC CC2"),
"");
674 REG_KEY(
"TV Playback",
"SELECTCC708_2", QT_TRANSLATE_NOOP(
"MythControls",
675 "Display ATSC CC3"),
"");
676 REG_KEY(
"TV Playback",
"SELECTCC708_3", QT_TRANSLATE_NOOP(
"MythControls",
677 "Display ATSC CC4"),
"");
679 "Enable Forced Subtitles"),
"");
681 "Disable Forced Subtitles"),
"");
683 REG_KEY(
"TV Playback",
"NEXTAUDIO", QT_TRANSLATE_NOOP(
"MythControls",
684 "Next audio track"),
"+");
685 REG_KEY(
"TV Playback",
"PREVAUDIO", QT_TRANSLATE_NOOP(
"MythControls",
686 "Previous audio track"),
"-");
687 REG_KEY(
"TV Playback",
"NEXTSUBTITLE", QT_TRANSLATE_NOOP(
"MythControls",
688 "Next subtitle track"),
"");
689 REG_KEY(
"TV Playback",
"PREVSUBTITLE", QT_TRANSLATE_NOOP(
"MythControls",
690 "Previous subtitle track"),
"");
691 REG_KEY(
"TV Playback",
"NEXTRAWTEXT", QT_TRANSLATE_NOOP(
"MythControls",
692 "Next Text track"),
"");
693 REG_KEY(
"TV Playback",
"PREVRAWTEXT", QT_TRANSLATE_NOOP(
"MythControls",
694 "Previous Text track"),
"");
695 REG_KEY(
"TV Playback",
"NEXTCC608", QT_TRANSLATE_NOOP(
"MythControls",
696 "Next VBI CC track"),
"");
697 REG_KEY(
"TV Playback",
"PREVCC608", QT_TRANSLATE_NOOP(
"MythControls",
698 "Previous VBI CC track"),
"");
699 REG_KEY(
"TV Playback",
"NEXTCC708", QT_TRANSLATE_NOOP(
"MythControls",
700 "Next ATSC CC track"),
"");
701 REG_KEY(
"TV Playback",
"PREVCC708", QT_TRANSLATE_NOOP(
"MythControls",
702 "Previous ATSC CC track"),
"");
703 REG_KEY(
"TV Playback",
"NEXTCC", QT_TRANSLATE_NOOP(
"MythControls",
704 "Next of any captions"),
"");
706 REG_KEY(
"TV Playback",
"NEXTSCAN", QT_TRANSLATE_NOOP(
"MythControls",
707 "Next video scan overidemode"),
"");
708 REG_KEY(
"TV Playback",
"QUEUETRANSCODE", QT_TRANSLATE_NOOP(
"MythControls",
709 "Queue the current recording for transcoding"),
"X");
710 REG_KEY(
"TV Playback",
"SPEEDINC", QT_TRANSLATE_NOOP(
"MythControls",
711 "Increase the playback speed"),
"U");
712 REG_KEY(
"TV Playback",
"SPEEDDEC", QT_TRANSLATE_NOOP(
"MythControls",
713 "Decrease the playback speed"),
"J");
714 REG_KEY(
"TV Playback",
"ADJUSTSTRETCH", QT_TRANSLATE_NOOP(
"MythControls",
715 "Turn on time stretch control"),
"A");
716 REG_KEY(
"TV Playback",
"STRETCHINC", QT_TRANSLATE_NOOP(
"MythControls",
717 "Increase time stretch speed"),
"");
718 REG_KEY(
"TV Playback",
"STRETCHDEC", QT_TRANSLATE_NOOP(
"MythControls",
719 "Decrease time stretch speed"),
"");
720 REG_KEY(
"TV Playback",
"TOGGLESTRETCH", QT_TRANSLATE_NOOP(
"MythControls",
721 "Toggle time stretch speed"),
"");
723 QT_TRANSLATE_NOOP(
"MythControls",
724 "Turn on audio sync adjustment controls"),
"");
726 QT_TRANSLATE_NOOP(
"MythControls",
727 "Set the audio sync adjustment"),
"");
728 REG_KEY(
"TV Playback",
"TOGGLEPICCONTROLS",
729 QT_TRANSLATE_NOOP(
"MythControls",
"Playback picture adjustments"),
732 QT_TRANSLATE_NOOP(
"MythControls",
"Set the picture brightness"),
"");
734 QT_TRANSLATE_NOOP(
"MythControls",
"Set the picture contrast"),
"");
736 QT_TRANSLATE_NOOP(
"MythControls",
"Set the picture color"),
"");
738 QT_TRANSLATE_NOOP(
"MythControls",
"Set the picture hue"),
"");
740 QT_TRANSLATE_NOOP(
"MythControls",
"Recording picture adjustments "
741 "for this channel"),
"Ctrl+G");
743 QT_TRANSLATE_NOOP(
"MythControls",
"Recording picture adjustments "
744 "for this recorder"),
"G");
745 REG_KEY(
"TV Playback",
"CYCLECOMMSKIPMODE",
746 QT_TRANSLATE_NOOP(
"MythControls",
"Cycle Commercial Skip mode"),
749 "Show the Program Guide"),
"S");
751 "Show the Program Finder"),
"#");
753 "Toggle the Sleep Timer"),
"F8");
757 "Jump to previously played recording"),
"");
759 "Display menu of recorded programs to jump to"),
"");
761 "Display scheduled recording list"),
"");
763 "Display previously recorded episodes"),
"");
765 "Monitor Signal Quality"),
"Alt+F7");
767 QT_TRANSLATE_NOOP(
"MythControls",
"Jump to the DVD Root Menu"),
"");
769 QT_TRANSLATE_NOOP(
"MythControls",
"Jump to the Popup Menu"),
"");
771 QT_TRANSLATE_NOOP(
"MythControls",
"Jump to the DVD Chapter Menu"),
"");
773 QT_TRANSLATE_NOOP(
"MythControls",
"Jump to the DVD Title Menu"),
"");
775 QT_TRANSLATE_NOOP(
"MythControls",
"Exit Show without any prompts"),
778 "Jump to a chapter"),
"");
780 "Switch title"),
"");
782 "Switch angle"),
"");
784 "OSD Navigation"),
"");
786 "Zoom mode - shift up"),
"");
788 "Zoom mode - shift down"),
"");
790 "Zoom mode - shift left"),
"");
792 "Zoom mode - shift right"),
"");
794 QT_TRANSLATE_NOOP(
"MythControls",
795 "Zoom mode - increase aspect ratio"),
"3");
797 QT_TRANSLATE_NOOP(
"MythControls",
798 "Zoom mode - decrease aspect ratio"),
"7");
800 "Zoom mode - zoom in"),
"9");
802 "Zoom mode - zoom out"),
"1");
804 QT_TRANSLATE_NOOP(
"MythControls",
805 "Zoom mode - vertical zoom in"),
"8");
807 QT_TRANSLATE_NOOP(
"MythControls",
808 "Zoom mode - vertical zoom out"),
"2");
810 QT_TRANSLATE_NOOP(
"MythControls",
811 "Zoom mode - horizontal zoom in"),
"6");
813 QT_TRANSLATE_NOOP(
"MythControls",
814 "Zoom mode - horizontal zoom out"),
"4");
816 "Zoom mode - quit and abandon changes"),
"");
818 "Zoom mode - commit changes"),
"");
824 "Menu Green"),
"F3");
826 "Menu Yellow"),
"F4");
838 "Clear editing cut points"),
"C,Q,Home");
840 "Invert Begin/End cut points"),
"I,Home Page");
844 "Load cuts from detected commercials"),
"Z,End");
846 "Jump to the next cut point"),
"PgDown,Media Next");
848 "Jump to the previous cut point"),
"PgUp,Media Previous");
850 "Jump back 10x the normal amount"),
",,<,Ctrl+B,Media Rewind");
852 "Jump forward 10x the normal amount"),
">,.,Ctrl+F,Media Fast Forward");
854 "Cut point editor compact menu"),
"Alt+M");
858 "Next Page"),
"Down");
860 "Previous Page"),
"Up");
862 "Next Subpage"),
"Right");
864 "Previous Subpage"),
"Left");
866 "Toggle Teletext"),
"T");
870 "Menu Green"),
"F3");
872 "Menu Yellow"),
"F4");
876 "Menu White"),
"F6");
878 QT_TRANSLATE_NOOP(
"MythControls",
"Toggle Background"),
"F7");
880 "Reveal hidden Text"),
"F8");
884 QT_TRANSLATE_NOOP(
"MythControls",
"Toggle audio visualisation"),
"");
888 QT_TRANSLATE_NOOP(
"MythControls",
"Toggle OSD playback information"),
"");
892 QT_TRANSLATE_NOOP(
"MythControls",
"Auto 3D"),
"");
894 QT_TRANSLATE_NOOP(
"MythControls",
"Ignore 3D"),
"");
896 QT_TRANSLATE_NOOP(
"MythControls",
"Discard 3D Side by Side"),
"");
898 QT_TRANSLATE_NOOP(
"MythControls",
"Discard 3D Top and Bottom"),
"");
952 { tr(
"Off",
"Sleep timer"), 0min },
953 { tr(
"30m",
"Sleep timer"), 30min },
954 { tr(
"1h",
"Sleep timer"), 60min },
955 { tr(
"1h30m",
"Sleep timer"), 90min },
956 { tr(
"2h",
"Sleep timer"), 120min }
973 m_mainWindow(MainWindow)
976 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Creating TV object");
978 QObject::setObjectName(
"TV");
995 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Finished creating TV object");
1000 QMap<QString,QString> kv;
1001 kv[
"LiveTVIdleTimeout"] =
"0";
1002 kv[
"BrowseMaxForward"] =
"240";
1003 kv[
"PlaybackExitPrompt"] =
"0";
1004 kv[
"AutomaticSetWatched"] =
"0";
1005 kv[
"EndOfRecordingExitPrompt"] =
"0";
1006 kv[
"JumpToProgramOSD"] =
"1";
1007 kv[
"GuiSizeForTV"] =
"0";
1008 kv[
"UseVideoModes"] =
"0";
1009 kv[
"JobsRunOnRecordHost"] =
"0";
1010 kv[
"ContinueEmbeddedTVPlay"] =
"0";
1011 kv[
"UseFixedWindowSize"] =
"1";
1012 kv[
"RunFrontendInWindow"] =
"0";
1013 kv[
"PersistentBrowseMode"] =
"0";
1014 kv[
"BrowseAllTuners"] =
"0";
1015 kv[
"ChannelOrdering"] =
"channum";
1017 kv[
"CustomFilters"] =
"";
1018 kv[
"ChannelFormat"] =
"<num> <sign>";
1020 kv[
"TryUnflaggedSkip"] =
"0";
1022 kv[
"ChannelGroupDefault"] =
"-1";
1023 kv[
"BrowseChannelGroup"] =
"0";
1024 kv[
"SmartForward"] =
"0";
1025 kv[
"FFRewReposTime"] =
"100";
1026 kv[
"FFRewReverse"] =
"1";
1028 kv[
"BrowseChannelGroup"] =
"0";
1029 kv[
"ChannelGroupDefault"] =
"-1";
1030 kv[
"ChannelGroupRememberLast"] =
"0";
1032 kv[
"VbiFormat"] =
"";
1033 kv[
"DecodeVBIFormat"] =
"";
1036 kv[
"PlaybackScreenPressKeyMap"] =
"P,Up,Z,],Left,Return,Return,Right,A,Down,Q,[";
1037 kv[
"LiveTVScreenPressKeyMap"] =
"P,Up,Z,S,Left,Return,Return,Right,A,Down,Q,F";
1039 constexpr std::array<const int,8> ff_rew_def { 3, 5, 10, 20, 30, 60, 120, 180 };
1040 for (
size_t i = 0; i < ff_rew_def.size(); i++)
1041 kv[QString(
"FFRewSpeed%1").arg(i)] = QString::number(ff_rew_def[i]);
1048 QString db_channel_ordering;
1050 m_dbIdleTimeout = std::chrono::minutes(kv[
"LiveTVIdleTimeout"].toUInt());
1051 auto db_browse_max_forward = std::chrono::minutes(kv[
"BrowseMaxForward"].toUInt());
1062 db_channel_ordering = kv[
"ChannelOrdering"];
1072 QString beVBI = kv[
"VbiFormat"];
1073 QString feVBI = kv[
"DecodeVBIFormat"];
1090 for (
size_t i = 0; i <
sizeof(ff_rew_def)/
sizeof(ff_rew_def[0]); i++)
1091 m_ffRewSpeeds.push_back(kv[QString(
"FFRewSpeed%1").arg(i)].toInt());
1108 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"-- begin");
1112 LOG(VB_GENERAL, LOG_ERR,
LOC +
"No MythMainWindow");
1133 fullscreen |= (0 == gui_width && 0 == gui_height);
1148 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Created TvPlayWindow.");
1159 QCoreApplication::processEvents();
1184 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"-- end");
1190 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"-- begin");
1211 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"-- lock");
1244 lcd->setFunctionLEDs(
FUNC_TV,
false);
1246 lcd->switchToTime();
1254 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"-- end");
1264 QCoreApplication::processEvents();
1340 .toUTC().toString(
"yyyy-MM-ddThh:mm:ssZ"));
1351 if (!
info.text[
"totalchapters"].isEmpty())
1353 QList<std::chrono::seconds> chapters;
1356 for (std::chrono::seconds chapter : std::as_const(chapters))
1357 var << QVariant((
long long)chapter.count());
1358 status.insert(
"chaptertimes", var);
1365 int currenttrack = -1;
1368 for (
int i = 0; i < list.size(); i++)
1370 if (i == currenttrack)
1371 status.insert(
"currentsubtitletrack", list[i]);
1372 tracks.insert(
"SELECTSUBTITLE_" + QString::number(i), list[i]);
1379 for (
int i = 0; i < list.size(); i++)
1381 if (i == currenttrack)
1382 status.insert(
"currentsubtitletrack", list[i]);
1383 tracks.insert(
"SELECTTTC_" + QString::number(i), list[i]);
1390 for (
int i = 0; i < list.size(); i++)
1392 if (i == currenttrack)
1393 status.insert(
"currentsubtitletrack", list[i]);
1394 tracks.insert(
"SELECTCC708_" + QString::number(i), list[i]);
1401 for (
int i = 0; i < list.size(); i++)
1403 if (i == currenttrack)
1404 status.insert(
"currentsubtitletrack", list[i]);
1405 tracks.insert(
"SELECTCC608_" + QString::number(i), list[i]);
1412 for (
int i = 0; i < list.size(); i++)
1414 if (i == currenttrack)
1415 status.insert(
"currentsubtitletrack", list[i]);
1416 tracks.insert(
"SELECTRAWTEXT_" + QString::number(i), list[i]);
1422 status.insert(
"currentsubtitletrack", tr(
"External Subtitles"));
1426 status.insert(
"totalsubtitletracks", tracks.size());
1427 if (!tracks.isEmpty())
1428 status.insert(
"subtitletracks", tracks);
1433 for (
int i = 0; i < list.size(); i++)
1435 if (i == currenttrack)
1436 status.insert(
"currentaudiotrack", list[i]);
1437 tracks.insert(
"SELECTAUDIO_" + QString::number(i), list[i]);
1440 status.insert(
"totalaudiotracks", tracks.size());
1441 if (!tracks.isEmpty())
1442 status.insert(
"audiotracks", tracks);
1466 for (
auto tit =
info.text.cbegin(); tit !=
info.text.cend(); ++tit)
1467 status.insert(tit.key(), tit.value());
1469 QHashIterator<QString,int> vit(
info.values);
1470 while (vit.hasNext())
1473 status.insert(vit.key(), vit.value());
1501 LOG(VB_GENERAL, LOG_INFO, QString(
"Using Idle Timer. %1 minutes")
1523 else if (!Selection.empty())
1525 for (
const auto & ci : Selection)
1527 uint chanid = ci.m_chanId;
1528 QString channum = ci.m_chanNum;
1529 if (!chanid || channum.isEmpty())
1533 if (chanid && !channum.isEmpty() && !cards.isEmpty())
1571 if (!
info->GetChanID())
1578 QString key =
info->MakeUniqueKey();
1583 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
"AskAllowRecording -- " +
1584 QString(
"adding '%1'").arg(
info->m_title));
1592 LOG(VB_GENERAL, LOG_INFO,
LOC +
"-- " +
1593 QString(
"removing '%1'").arg(
info->GetTitle()));
1597 delete (*it).m_info;
1614 QString single_rec = tr(
"MythTV wants to record \"%1\" on %2 in %d seconds. Do you want to:");
1616 QString record_watch = tr(
"Record and watch while it records");
1617 QString let_record1 = tr(
"Let it record and go back to the Main Menu");
1618 QString let_recordm = tr(
"Let them record and go back to the Main Menu");
1619 QString record_later1 = tr(
"Record it later, I want to watch TV");
1620 QString record_laterm = tr(
"Record them later, I want to watch TV");
1621 QString do_not_record1= tr(
"Don't let it record, I want to watch TV");
1622 QString do_not_recordm= tr(
"Don't let them record, I want to watch TV");
1629 if ((*it).m_expiry <= timeNow)
1632 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
"-- " +
1633 QString(
"removing '%1'").arg((*it).m_info->m_title));
1635 delete (*it).m_info;
1643 std::chrono::milliseconds timeuntil = 0ms;
1650 (*it).m_isInSameInputGroup = (*it).m_isConflicting =
true;
1655 bool busy_input_grps_loaded =
false;
1656 std::vector<uint> busy_input_grps;
1663 (*it).m_isInSameInputGroup =
1664 (cardid == (*it).m_info->GetInputID());
1666 if ((*it).m_isInSameInputGroup)
1670 if (!busy_input_grps_loaded)
1673 busy_input_grps_loaded =
true;
1676 std::vector<uint> input_grps =
1679 for (
uint grp : input_grps)
1681 if (
find(busy_input_grps.begin(), busy_input_grps.end(),
1682 grp) != busy_input_grps.end())
1684 (*it).m_isInSameInputGroup =
true;
1694 if (!(*it).m_isInSameInputGroup)
1695 (*it).m_isConflicting =
false;
1696 else if (cardid == (*it).m_info->GetInputID())
1697 (*it).m_isConflicting =
true;
1699 (*it).m_isConflicting =
true;
1701 (busy_input.
m_mplexId == (*it).m_info->QueryMplexID())) ||
1703 (busy_input.
m_chanId == (*it).m_info->GetChanID())))
1704 (*it).m_isConflicting =
false;
1706 (*it).m_isConflicting =
true;
1708 conflict_count += (*it).m_isConflicting ? 1 : 0;
1715 if (conflict_count == 0)
1717 LOG(VB_GENERAL, LOG_INFO,
LOC +
"The scheduler wants to make "
1718 "a non-conflicting recording.");
1722 else if (conflict_count == 1 && ((*it).m_info->GetInputID() == cardid))
1725 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
"UpdateOSDAskAllowDialog -- " +
1733 .replace(
"<num>", (*it).m_info->GetChanNum())
1734 .replace(
"<sign>", (*it).m_info->GetChannelSchedulingID())
1735 .replace(
"<name>", (*it).m_info->GetChannelName());
1737 message = single_rec.arg((*it).m_info->GetTitle(), channel);
1742 dialog.m_buttons.push_back({ record_watch,
"DIALOG_ASKALLOW_WATCH_0",
false, !((*it).m_hasRec)} );
1743 dialog.m_buttons.push_back({ let_record1,
"DIALOG_ASKALLOW_EXIT_0" });
1744 dialog.m_buttons.push_back({ ((*it).m_hasLater) ? record_later1 : do_not_record1,
1745 "DIALOG_ASKALLOW_CANCELRECORDING_0",
false, ((*it).m_hasRec) });
1750 if (conflict_count > 1)
1753 "MythTV wants to record these programs in %d seconds:");
1757 bool has_rec =
false;
1760 if (!(*it).m_isConflicting)
1763 QString title = (*it).m_info->GetTitle();
1764 if ((title.length() < 10) && !(*it).m_info->GetSubtitle().isEmpty())
1765 title +=
": " + (*it).m_info->GetSubtitle();
1766 if (title.length() > 20)
1767 title = title.left(17) +
"...";
1771 .replace(
"<num>", (*it).m_info->GetChanNum())
1772 .replace(
"<sign>", (*it).m_info->GetChannelSchedulingID())
1773 .replace(
"<name>", (*it).m_info->GetChannelName());
1775 if (conflict_count > 1)
1777 message += tr(
"\"%1\" on %2").arg(title, channel);
1782 message = single_rec.arg((*it).m_info->GetTitle(), channel);
1783 has_rec = (*it).m_hasRec;
1787 if (conflict_count > 1)
1790 message += tr(
"Do you want to:");
1793 bool all_have_later =
true;
1794 timeuntil = 9999999ms;
1797 if ((*it).m_isConflicting)
1799 all_have_later &= (*it).m_hasLater;
1804 timeuntil = (9999999ms == timeuntil) ? 0ms : timeuntil;
1806 if (conflict_count > 1)
1810 { let_recordm,
"DIALOG_ASKALLOW_EXIT_0",
false,
true },
1811 { all_have_later ? record_laterm : do_not_recordm,
"DIALOG_ASKALLOW_CANCELCONFLICTING_0" }
1818 { let_record1,
"DIALOG_ASKALLOW_EXIT_0",
false, !has_rec},
1819 { all_have_later ? record_later1 : do_not_record1,
"DIALOG_ASKALLOW_CANCELRECORDING_0",
false, has_rec}
1832 LOG(VB_GENERAL, LOG_ERR,
"allowrecordingbox : askAllowLock is locked");
1836 if (
Action ==
"CANCELRECORDING")
1841 else if (
Action ==
"CANCELCONFLICTING")
1845 if (pgm.m_isConflicting)
1849 else if (
Action ==
"WATCH")
1913 #define TRANSITION(ASTATE,BSTATE) ((ctxState == (ASTATE)) && (desiredNextState == (BSTATE)))
1915 #define SET_NEXT() do { nextState = desiredNextState; changed = true; } while(false)
1916 #define SET_LAST() do { nextState = ctxState; changed = true; } while(false)
1921 QByteArray msg_arr = msg.toLatin1();
1922 QString msg_i18n = TV::tr(msg_arr.constData());
1923 QByteArray msg_i18n_arr = msg_i18n.toLatin1();
1924 return (msg_arr == msg_i18n_arr) ? msg_i18n : msg;
1939 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Called after fatal error detected.");
1943 bool changed =
false;
1949 LOG(VB_GENERAL, LOG_WARNING,
LOC +
"Warning, called with no state to change to.");
1957 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Attempting to change from %1 to %2")
1962 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Attempting to set to an error state!");
1987 QString channum =
"";
1991 QStringList reclist;
1994 query.
prepare(
"SELECT channum FROM channel "
1995 "WHERE chanid = :CHANID");
1998 channum = query.
value(0).toString();
2000 channum = QString::number(chanid);
2003 QString::number(chanid));
2008 if (!reclist.empty())
2027 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
"Spawning LiveTV Recorder -- begin");
2029 if (chanid && !channum.isEmpty())
2034 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
"Spawning LiveTV Recorder -- end");
2038 LOG(VB_GENERAL, LOG_ERR,
LOC +
"LiveTV not successfully started");
2052 LOG(VB_GENERAL, LOG_INFO,
LOC +
2053 QString(
"playbackURL(%1) inputtype(%2)")
2058 playbackURL,
false,
true,
2072 LOG(VB_GENERAL, LOG_ERR,
LOC +
"LiveTV not successfully started");
2126 LOG(VB_GENERAL, LOG_ERR,
LOC +
2127 "Couldn't find recorder for in-progress recording");
2146 QString message =
"COMMFLAG_REQUEST ";
2161 TV::tr(
"TV Player" ),
2188 LOG(VB_GENERAL, LOG_ERR,
LOC + QString(
"Unknown state transition: %1 to %2")
2193 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Changing from %1 to %2")
2204 LOG(VB_GENERAL, LOG_INFO,
LOC +
"State is LiveTV");
2206 LOG(VB_GENERAL, LOG_INFO,
LOC +
"UpdateOSDInput done");
2208 LOG(VB_GENERAL, LOG_INFO,
LOC +
"UpdateLCD done");
2210 LOG(VB_GENERAL, LOG_INFO,
LOC +
"ITVRestart done");
2216 QString msg = tr(
"%1 Settings")
2269 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Main UI disabled.");
2272 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
" -- end");
2287 MaxWait = (MaxWait <= 0ms) ? 40s : MaxWait;
2290 bool recording =
false;
2294 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Invalid Remote Encoder");
2302 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Lost contact with backend");
2306 std::this_thread::sleep_for(5us);
2312 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Timed out waiting for recorder to start");
2316 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"Took %1 ms to start recorder.")
2317 .arg(
t.elapsed().count()));
2336 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"-- begin");
2350 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Stopping ring buffer");
2361 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"stopping recorder");
2366 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC +
"-- end");
2371 const int timer_id =
Event->timerId();
2379 bool handled =
true;
2440 if (!netCmd.isEmpty())
2465 LOG(VB_PLAYBACK, LOG_ERR,
LOC +
"Last Program File does not exist");
2584 LOG(VB_GENERAL, LOG_WARNING,
LOC + QString(
"Unknown timer: %1").arg(timer_id));
2594 QString lcd_time_string;
2595 bool showProgress =
true;
2612 lcd_time_string =
info.text[
"playedtime"] +
" / " +
info.text[
"totaltime"];
2614 if (lcd_time_string.length() > lcd->
getLCDWidth())
2615 lcd_time_string.remove(
' ');
2645 int timer = startTimer(Interval);
2647 LOG(VB_GENERAL, LOG_ERR,
LOC + QString(
"Failed to start timer on line %1 of %2").arg(Line).arg(__FILE__));
2664 auto StateChange = [&]()
2682 QTimer::singleShot(0,
this, StateChange);
2687 auto InputChange = [&]()
2699 QTimer::singleShot(0,
this, InputChange);
2711 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Switching to program: %1")
2781 bool is_playing =
false;
2866 bool restartTimer =
false;
2872 restartTimer =
true;
2876 LOG(VB_CHANNEL, LOG_INFO,
"REC_PROGRAM -- channel change");
2942 if ((
Event->type() == QEvent::Resize))
2948 if ( (QEvent::KeyPress ==
Event->type() || QEvent::KeyRelease ==
Event->type())
2950 return TVPlaybackState::eventFilter(Object,
Event);
2952 QScopedPointer<QEvent> sNewEvent(
nullptr);
2956 if (QEvent::KeyPress ==
Event->type())
2971 switch (
Event->type())
2974 case QEvent::UpdateRequest:
2978 return TVPlaybackState::eventFilter(Object,
Event);
2981 return TVPlaybackState::eventFilter(Object,
Event);
2988 if (
Event ==
nullptr)
2989 return TVPlaybackState::event(
Event);
2991 if (QEvent::Resize ==
Event->type())
2996 const auto *qre =
dynamic_cast<const QResizeEvent*
>(
Event);
2999 return TVPlaybackState::event(
Event);
3008 if (QEvent::KeyPress ==
Event->type())
3010 const auto * ke =
dynamic_cast<QKeyEvent*
>(
Event);
3013 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"keypress: %1 '%2'")
3014 .arg(ke->key()).arg(ke->text()));
3022 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"mythgesture: g:%1 pos:%2,%3 b:%4")
3023 .arg(ge->GetGesture()).arg(ge->GetPosition().x())
3024 .arg(ge->GetPosition().y()).arg(ge->GetButton()));
3028 bool handled =
false;
3037 switch (
Event->type())
3040 case QEvent::UpdateRequest:
3050 return QObject::event(
Event);
3055 bool handled =
true;
3110 else if (
Action.startsWith(
"TOGGLE"))
3120 else if (
Action.startsWith(
"SELECT"))
3129 else if (
Action.startsWith(
"NEXT") ||
Action.startsWith(
"PREV"))
3131 int dir = (
Action.startsWith(
"NEXT")) ? +1 : -1;
3135 else if (
Action.endsWith(
"CC"))
3160 QStringList::const_iterator it;
3161 for (it = actions.begin(); it != actions.end(); ++it)
3163 if ((*it).startsWith(
"SYSEVENT") ||
3176 QList<QKeyEvent*> keyPressList;
3178 QStringList stringKeyList = KeyList.split(
',');
3179 for (
const auto & str : std::as_const(stringKeyList))
3181 QKeySequence keySequence(str);
3182 for (i = 0; i < keySequence.count(); i++)
3184 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
3185 int keynum = keySequence[i];
3186 int keyCode = keynum & ~Qt::KeyboardModifierMask;
3187 auto modifiers =
static_cast<Qt::KeyboardModifiers
>(keynum & Qt::KeyboardModifierMask);
3189 int keyCode = keySequence[i].key();
3190 Qt::KeyboardModifiers modifiers = keySequence[i].keyboardModifiers();
3192 auto * keyEvent =
new QKeyEvent(QEvent::None, keyCode, modifiers);
3193 keyPressList.append(keyEvent);
3201 auto * keyEvent =
new QKeyEvent(QEvent::None, Qt::Key_Escape, Qt::NoModifier);
3202 keyPressList.append(keyEvent);
3205 return keyPressList;
3209 QStringList &Actions,
bool IsLiveTV)
3211 if (
Event && Context ==
"TV Playback")
3218 (
Event->GetButton() == Qt::LeftButton))
3222 QPoint pos =
Event->GetPosition();
3224 const int widthDivider = 4;
3225 int w4 = size.width() / widthDivider;
3226 region = pos.x() / w4;
3227 int h3 = size.height() / 3;
3228 region += (pos.y() / h3) * widthDivider;
3240 QStringList &Actions,
bool IsLiveTV,
bool AllowJumps)
3244 if (QEvent::KeyPress ==
Event->type())
3254 if (
Event ==
nullptr)
3260 LOG(VB_GENERAL, LOG_DEBUG,
LOC + QString(
"ignoreKeys: %1").arg(ignoreKeys));
3271 auto* eKeyEvent =
dynamic_cast<QKeyEvent*
>(
Event);
3273 if (eKeyEvent->key() <= 0)
3276 switch(eKeyEvent->nativeScanCode())
3279 keycode = Qt::Key_MediaPause;
3287 auto *key =
new QKeyEvent(QEvent::KeyPress, keycode, eKeyEvent->modifiers());
3288 QCoreApplication::postEvent(
this, key);
3294 QStringList actions;
3295 bool handled =
false;
3296 bool alreadyTranslatedPlayback =
false;
3304 alreadyTranslatedPlayback =
true;
3306 if (handled || actions.isEmpty())
3309 bool esc =
IsActionable({
"ESCAPE",
"BACK" }, actions);
3320 if (QEvent::KeyPress ==
Event->type())
3322 auto *qke =
dynamic_cast<QKeyEvent*
>(
Event);
3380 if (QEvent::KeyPress ==
Event->type())
3382 auto *qke =
dynamic_cast<QKeyEvent*
>(
Event);
3385 const QString txt = qke->text();
3389 (void)txt.toInt(&ok, 16);
3390 if (ok || txt==
"_" || txt==
"-" || txt==
"#" || txt==
".")
3401 QStringList tt_actions;
3404 if (!handled && !tt_actions.isEmpty())
3406 for (
const QString&
action : std::as_const(tt_actions))
3418 if (!alreadyTranslatedPlayback)
3421 alreadyTranslatedPlayback =
true;
3424 if (!handled && !actions.isEmpty())
3426 for (
const QString&
action : std::as_const(actions))
3435 if (!alreadyTranslatedPlayback)
3438 if (handled || actions.isEmpty())
3446 if (QEvent::KeyPress ==
Event->type())
3462 for (
int i = 0; i < actions.size(); ++i)
3463 LOG(VB_GENERAL, LOG_DEBUG,
LOC + QString(
"handled(%1) actions[%2](%3)")
3464 .arg(handled).arg(i).arg(actions[i]));
3465 #endif // DEBUG_ACTIONS
3472 for (
int i = 0; i < actions.size() && !handled; i++)
3474 const QString&
action = actions[i];
3476 int val =
action.toInt(&ok);
3494 bool handled =
true;
3515 for (
const auto&
action : std::as_const(Actions))
3526 static const QStringList passthrough =
3529 ACTION_MUTEAUDIO,
"CYCLEAUDIOCHAN",
"BOTTOMLINEMOVE",
"BOTTOMLINESAVE",
"TOGGLEASPECT"
3539 bool endmanualzoom =
false;
3540 bool handled =
true;
3541 bool updateOSD =
true;
3570 endmanualzoom =
true;
3574 endmanualzoom =
true;
3581 static const QStringList passthrough =
3589 QString msg = tr(
"Zoom Committed");
3593 msg = endmanualzoom ? tr(
"Zoom Ignored") :
3598 else if (endmanualzoom)
3645 bool handled =
true;
3670 bool handled =
true;
3693 bool handled =
true;
3716 bool handled =
true;
3751 bool IsDVD,
bool IsDVDStillFrame)
3753 bool handled =
true;
3757 else if (
IsActionable(
"SKIPCOMMBACK", Actions) && !IsDVD)
3759 else if (
IsActionable(
"QUEUETRANSCODE", Actions) && !IsDVD)
3761 else if (
IsActionable(
"QUEUETRANSCODE_AUTO", Actions) && !IsDVD)
3763 else if (
IsActionable(
"QUEUETRANSCODE_HIGH", Actions) && !IsDVD)
3765 else if (
IsActionable(
"QUEUETRANSCODE_MEDIUM", Actions) && !IsDVD)
3767 else if (
IsActionable(
"QUEUETRANSCODE_LOW", Actions) && !IsDVD)
3773 else if (
IsActionable(
"SPEEDINC", Actions) && !IsDVDStillFrame)
3775 else if (
IsActionable(
"SPEEDDEC", Actions) && !IsDVDStillFrame)
3779 else if (
IsActionable(
"CYCLECOMMSKIPMODE",Actions) && !IsDVD)
3839 DoSeek(0, tr(
"Jump to Beginning"),
false,
true);
3865 std::chrono::milliseconds rate =
m_sigMonMode ? 0ms : 100ms;
3900 bool visible =
false;
3990 else if (
IsActionable({
"INFO",
"INFOWITHCUTLIST" }, Actions))
4011 for (
auto it = Actions.cbegin(); it != Actions.cend() && !handled; ++it)
4020 bool handled =
false;
4024 for (
int i = 0; i < Actions.size() && !handled; i++)
4026 const QString&
action = Actions[i];
4028 int val =
action.toInt(&ok);
4057 bool handled =
true;
4136 info.text[
"title"] = tr(
"Position");
4144 bool handled =
true;
4166 else if (
IsActionable(
"NEXTSOURCE", Actions) && islivetv)
4170 else if (
IsActionable(
"PREVSOURCE", Actions) && islivetv)
4174 else if (
IsActionable(
"NEXTINPUT", Actions) && islivetv)
4182 else if (
IsActionable(
"PREVCHAN", Actions) && islivetv)
4254 #ifdef DEBUG_ACTIONS
4255 LOG(VB_GENERAL, LOG_DEBUG,
LOC + QString(
"(%1) ignoreKeys: %2").arg(
Command).arg(ignoreKeys));
4260 LOG(VB_GENERAL, LOG_WARNING,
LOC +
"Ignoring network control command because ignoreKeys is set");
4264 QStringList tokens =
Command.split(
" ", Qt::SkipEmptyParts);
4265 if (tokens.size() < 2)
4267 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Not enough tokens in network control command " + QString(
"'%1'").arg(
Command));
4279 LOG(VB_GENERAL, LOG_WARNING,
LOC +
4280 "Ignoring network control command\n\t\t\t" +
4281 QString(
"because dialog is waiting for a response"));
4285 if (tokens[1] !=
"QUERY")
4288 if (tokens.size() == 3 && tokens[1] ==
"CHANID")
4294 else if (tokens.size() == 3 && tokens[1] ==
"CHANNEL")
4298 static const QRegularExpression kChannelNumRE { R
"(^[-\.\d_#]+$)" };
4299 if (tokens[2] ==
"UP")
4301 else if (tokens[2] ==
"DOWN")
4303 else if (tokens[2].contains(kChannelNumRE))
4307 else if (tokens.size() == 3 && tokens[1] ==
"SPEED")
4311 if (tokens[2] ==
"0x")
4318 else if (tokens[2] ==
"normal")
4328 static const QRegularExpression kSpeedRE { R
"(^\-*(\d*\.)?\d+x$)" };
4329 float tmpSpeed = 1.0F;
4332 if (tokens[2].contains(kSpeedRE))
4334 QString speed = tokens[2].left(tokens[2].length()-1);
4335 tmpSpeed = speed.toFloat(&ok);
4339 static const QRegularExpression re { R
"(^(\-*\d+)\/(\d+)x$)" };
4340 auto match = re.match(tokens[2]);
4341 if (match.hasMatch())
4343 QStringList matches = match.capturedTexts();
4344 int numerator = matches[1].toInt(&ok);
4345 int denominator = matches[2].toInt(&ok);
4347 if (ok && denominator != 0)
4348 tmpSpeed =
static_cast<float>(numerator) /
static_cast<float>(denominator);
4356 float searchSpeed = fabs(tmpSpeed);
4361 if (tmpSpeed == 0.0F)
4369 else if (tmpSpeed == 1.0F)
4388 else if (tmpSpeed > 1)
4396 else if (0.125F <= tmpSpeed && tmpSpeed <= 2.0F)
4404 LOG(VB_GENERAL, LOG_WARNING, QString(
"Couldn't find %1 speed. Setting Speed to 1x")
4405 .arg(
static_cast<double>(searchSpeed)));
4412 LOG(VB_GENERAL, LOG_ERR, QString(
"Found an unknown speed of %1").arg(tokens[2]));
4416 else if (tokens.size() == 2 && tokens[1] ==
"STOP")
4423 static const QRegularExpression kDigitsRE {
"^\\d+$" };
4427 if (tokens[2] ==
"BEGINNING")
4429 DoSeek(0, tr(
"Jump to Beginning"),
false,
true);
4431 else if (tokens[2] ==
"FORWARD")
4435 else if (tokens[2] ==
"BACKWARD")
4439 else if ((tokens[2] ==
"POSITION" ||
4440 tokens[2] ==
"POSITIONWITHCUTLIST") &&
4441 (tokens.size() == 4) &&
4442 (tokens[3].contains(kDigitsRE)))
4444 DoSeekAbsolute(tokens[3].toInt(), tokens[2] ==
"POSITIONWITHCUTLIST");
4447 else if (tokens.size() >= 3 && tokens[1] ==
"SUBTITLES")
4450 uint track = tokens[2].toUInt(&ok);
4462 uint size =
static_cast<uint>(subs.size());
4465 if (track >=
start && track < finish)
4474 finish =
start + size;
4475 if (track >=
start && track < finish)
4484 finish =
start + size;
4485 if (track >=
start && track < finish)
4494 finish =
start + size;
4495 if (track >=
start && track < finish)
4504 finish =
start + size;
4505 if (track >=
start && track < finish)
4514 finish =
start + size;
4515 if (track >=
start && track < finish)
4523 else if (tokens.size() >= 3 && tokens[1] ==
"VOLUME")
4525 static const QRegularExpression re {
"(\\d+)%?" };
4526 auto match = re.match(tokens[2]);
4527 if (match.hasMatch())
4529 QStringList matches = match.capturedTexts();
4531 LOG(VB_GENERAL, LOG_INFO, QString(
"Set Volume to %1%").arg(matches[1]));
4534 int vol = matches[1].toInt(&ok);
4538 if (0 <= vol && vol <= 100)
4542 else if (tokens.size() >= 3 && tokens[1] ==
"QUERY")
4544 if (tokens[2] ==
"POSITION")
4559 static const QRegularExpression re {
"Play (.*)x" };
4561 if (match.hasMatch())
4563 QStringList matches = match.capturedTexts();
4564 speedStr = QString(
"%1x").arg(matches[1]);
4576 QString infoStr =
"";
4600 infoStr =
"Recorded";
4608 QString bufferFilename =
4610 if ((infoStr ==
"Recorded") || (infoStr ==
"LiveTV"))
4612 infoStr += QString(
" %1 %2 %3 %4 %5 %6 %7")
4613 .arg(
info.text[
"description"],
4618 QString::number(fplay),
4620 QString::number(rate));
4624 QString position =
info.text[
"description"].section(
" ",0,0);
4625 infoStr += QString(
" %1 %2 %3 %4 %5")
4629 QString::number(fplay),
4630 QString::number(rate));
4633 infoStr += QString(
" Subtitles:");
4638 infoStr += QString(
" *0:[None]*");
4640 infoStr += QString(
" 0:[None]");
4645 for (
int i = 0; i < subs.size(); i++)
4648 infoStr += QString(
" *%1:[%2]*").arg(n).arg(subs[i]);
4650 infoStr += QString(
" %1:[%2]").arg(n).arg(subs[i]);
4655 for (
int i = 0; i < subs.size(); i++)
4658 infoStr += QString(
" *%1:[%2]*").arg(n).arg(subs[i]);
4660 infoStr += QString(
" %1:[%2]").arg(n).arg(subs[i]);
4665 for (
int i = 0; i < subs.size(); i++)
4668 infoStr += QString(
" *%1:[%2]*").arg(n).arg(subs[i]);
4670 infoStr += QString(
" %1:[%2]").arg(n).arg(subs[i]);
4675 for (
int i = 0; i < subs.size(); i++)
4678 infoStr += QString(
" *%1:[%2]*").arg(n).arg(subs[i]);
4680 infoStr += QString(
" %1:[%2]").arg(n).arg(subs[i]);
4685 for (
int i = 0; i < subs.size(); i++)
4688 infoStr += QString(
" *%1:[%2]*").arg(n).arg(subs[i]);
4690 infoStr += QString(
" %1:[%2]").arg(n).arg(subs[i]);
4695 for (
int i = 0; i < subs.size(); i++)
4698 infoStr += QString(
" *%1:[%2]*").arg(n).arg(subs[i]);
4700 infoStr += QString(
" %1:[%2]").arg(n).arg(subs[i]);
4706 QString message = QString(
"NETWORK_CONTROL ANSWER %1").arg(infoStr);
4710 else if (tokens[2] ==
"VOLUME")
4713 QString message = QString(
"NETWORK_CONTROL ANSWER %1").arg(infoStr);
4722 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC + QString(
"(%1) -- begin").arg(
StateToString(desiredState)));
4729 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Created player."));
4734 LOG(VB_GENERAL, LOG_CRIT,
LOC + QString(
"Failed to create player."));
4737 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC + QString(
"(%1) -- end %2")
4843 bool paused =
false;
4865 bool ignore =
false;
4866 bool paused =
false;
4891 if (Time > -0.001F && Time < +0.001F)
4894 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"%1 seconds").arg(
static_cast<double>(Time)));
4915 else if (Time < 0.0F)
4927 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"%1").arg(FrameNum));
4953 const int kRewind = 4;
4954 const int kForward = 8;
4955 const int kSticky = 16;
4956 const int kSlippery = 32;
4957 const int kRelative = 64;
4958 const int kAbsolute = 128;
4959 const int kIgnoreCutlist = 256;
4960 const int kWhenceMask = 3;
4965 flags =
ARBSEEK_END | kForward | kSticky | kAbsolute;
4971 flags =
ARBSEEK_SET | kRewind | kSticky | kAbsolute;
4977 int direction = (flags & kRewind) ? -1 : 1;
4986 QString message = (flags & kRewind) ? tr(
"Rewind") :
4988 if (flags & kAbsolute)
4990 float time = direction;
4991 DoSeek(time, message,
true, (flags & kIgnoreCutlist) == 0);
4998 uint64_t targetRel = frameRel +
static_cast<uint64_t
>(direction);
4999 if (frameRel == 0 && direction < 0)
5003 targetRel = std::min(targetRel, maxRel);
5011 else if (flags & kSticky)
5015 else if (flags & kRewind)
5035 void TV::DoSeek(
float Time,
const QString &Msg,
bool TimeIsOffset,
bool HonorCutlist)
5040 bool limitkeys =
false;
5082 DoSeek(Seconds, tr(
"Jump To"),
false, HonorCutlist);
5094 int64_t time = ((seek / 100) * 3600) + ((seek % 100) * 60);
5098 DoSeek(time, tr(
"Jump Ahead"),
true, HonorCutlist);
5102 DoSeek(-time, tr(
"Jump Back"),
true, HonorCutlist);
5115 DoSeek(std::max(0.0F, dur -
static_cast<float>(time)), tr(
"Jump To"),
false, HonorCutlist);
5249 auto index =
static_cast<size_t>(Index);
5318 QString jobHost =
"";
5323 QString msg = tr(
"Try Again");
5330 msg = tr(
"Transcoding");
5340 int num_chapters = 0;
5345 return num_chapters;
5393 int currentTitle = 0;
5398 return currentTitle;
5413 int currentAngle = 0;
5418 return currentAngle;
5433 std::chrono::seconds seconds = 0s;
5496 info.text[
"title"] = tr(
"Skip");
5497 info.text[
"description"] = tr(
"Searching");
5509 QMap<uint,InputInfo> sources;
5514 uint sourceid =
info[
"sourceid"].toUInt();
5517 for (
auto & input : inputs)
5520 if ((sources.find(input.m_sourceId) == sources.end()) ||
5521 ((cardid == input.m_inputId) && (cardid != sources[input.m_sourceId].m_inputId)))
5523 sources[input.m_sourceId] = input;
5528 QMap<uint,InputInfo>::const_iterator beg = sources.constFind(sourceid);
5529 QMap<uint,InputInfo>::const_iterator sit = beg;
5531 if (sit == sources.constEnd())
5537 if (sit == sources.constEnd())
5538 sit = sources.constBegin();
5543 if (sit != sources.constBegin())
5547 QMap<uint,InputInfo>::const_iterator
tmp = sources.constBegin();
5548 while (
tmp != sources.constEnd())
5575 QCoreApplication::processEvents();
5577 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"(%1,'%2',%3)").arg(ChanID).arg(ChanNum).arg(InputID));
5584 QStringList reclist;
5587 reclist.push_back(QString::number(InputID));
5589 else if (ChanID || !ChanNum.isEmpty())
5596 if (!reclist.empty())
5604 if (ChanID && ChanNum.isEmpty())
5607 if (!ChanNum.isEmpty())
5650 if (ChanNum.isEmpty() && ChanID)
5652 if (ChanNum.isEmpty() && InputID)
5658 LOG(VB_GENERAL, LOG_ERR,
LOC +
"LiveTV not successfully restarted");
5671 playbackURL,
false,
true,
5698 LOG(VB_GENERAL, LOG_ERR,
LOC +
"LiveTV not successfully started");
5712 LOG(VB_GENERAL, LOG_ERR,
LOC +
"No recorder to switch to...");
5726 LOG(VB_GENERAL, LOG_ERR,
"TV::ToggleChannelFavorite() -- currently disabled");
5794 bool commitSmart =
false;
5806 inputStr = inputStr.isEmpty() ?
"?" : inputStr;
5810 inputStr = entryStr +
" " + inputStr;
5814 inputStr = tr(
"Seek:",
"seek to location") +
" " + inputStr;
5824 static QString
add_spacer(
const QString &chan,
const QString &spacer)
5826 if ((chan.length() >= 2) && !spacer.isEmpty())
5827 return chan.left(chan.length()-1) + spacer + chan.right(1);
5839 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
5840 int size = chan.size();
5842 qsizetype size = chan.size();
5844 if ((size > 2) && (chan.at(size - 1) == chan.at(size - 2)))
5847 chan.right(1).toUInt(&ok);
5850 chan = chan.left(chan.length()-1);
5858 QString needed_spacer;
5859 uint pref_cardid = 0;
5860 bool is_not_complete =
true;
5862 bool valid_prefix =
false;
5866 chan, pref_cardid, is_not_complete, needed_spacer);
5869 #if DEBUG_CHANNEL_PREFIX
5870 LOG(VB_GENERAL, LOG_DEBUG, QString(
"valid_pref(%1) cardid(%2) chan(%3) "
5871 "pref_cardid(%4) complete(%5) sp(%6)")
5872 .arg(valid_prefix).arg(0).arg(chan)
5873 .arg(pref_cardid).arg(is_not_complete).arg(needed_spacer));
5881 else if (!needed_spacer.isEmpty())
5887 #if DEBUG_CHANNEL_PREFIX
5888 LOG(VB_GENERAL, LOG_DEBUG, QString(
" ValidPref(%1) CardId(%2) Chan(%3) "
5889 " PrefCardId(%4) Complete(%5) Sp(%6)")
5891 .arg(pref_cardid).arg(is_not_complete).arg(needed_spacer));
5898 return !is_not_complete;
5903 bool commited =
false;
5905 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
5906 QString(
"livetv(%1) qchannum(%2) qchanid(%3)")
5936 if (channum.isEmpty())
5959 uint old_chanid = 0;
5965 LOG(VB_GENERAL, LOG_ERR,
LOC +
5966 "no active ctx playingInfo.");
6028 uint cardid,
const QString &channum)
6031 uint cur_sourceid = 0;
6044 if (cur_sourceid != sourceid && sourceid)
6051 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"(%1, '%2')").arg(Chanid).arg(
Channum));
6057 QStringList reclist;
6058 QVector<uint> tunable_on;
6062 if (channum.isEmpty() && Chanid)
6083 QString needed_spacer;
6084 uint pref_cardid = 0;
6089 dummy, needed_spacer);
6091 LOG(VB_CHANNEL, LOG_INFO,
LOC +
6092 QString(
"CheckChannelPrefix(%1, pref_cardid %2, %3, '%4') "
6094 .arg(
Channum).arg(pref_cardid).arg(dummy).arg(needed_spacer)
6098 if (pref_cardid != cardid)
6107 getit = !tunable_on.contains(cardid);
6115 if (tunable_on.empty())
6121 for (
const auto& rec : std::as_const(
tmp))
6123 if ((Chanid == 0U) || tunable_on.contains(rec.toUInt()))
6124 reclist.push_back(rec);
6129 if (!reclist.empty())
6192 for (
const auto & option : Options)
6194 uint chanid = option.m_chanId;
6195 QString channum = option.m_chanNum;
6214 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"Previous channel number '%1'").arg(channum));
6215 if (channum.isEmpty())
6225 if (!ImmediateChange)
6231 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"'%1'->'%2'")
6232 .arg(cur_channum, prev_channum));
6235 if (cur_channum != prev_channum && !prev_channum.isEmpty())
6244 if (ImmediateChange)
6258 emit
HideAll(
true,
nullptr,
true);
6276 bool hideAll =
false;
6292 else if (is_prog_info_disp && !paused)
6296 else if (IncludeStatusOSD)
6314 info.text[
"title"] = (paused ? tr(
"Paused") : tr(
"Position"));
6360 const QString& Value,
int Type,
const QString& Units,
6364 info.values.insert(
"position", Position);
6365 info.values.insert(
"relposition", Position);
6366 info.text.insert(
"title", Title);
6367 info.text.insert(
"description", Desc);
6368 info.text.insert(
"value", Value);
6369 info.text.insert(
"units", Units);
6375 LOG(VB_PLAYBACK, LOG_INFO, QString(
"UpdateOSDSeekMessage(%1, %2)").arg(Msg).arg(Timeout));
6381 info.text[
"title"] = Msg;
6416 infoMap[
"callsign"].isEmpty())
6428 SignalMonitorList::const_iterator it;
6429 for (it = slist.begin(); it != slist.end(); ++it)
6430 if (
"error" == it->GetShortName())
6431 infoMap[QString(
"error%1").arg(i++)] = it->GetName();
6433 for (it = slist.begin(); it != slist.end(); ++it)
6434 if (
"message" == it->GetShortName())
6435 infoMap[QString(
"message%1").arg(i++)] = it->GetName();
6439 uint ber = 0xffffffff;
6451 for (it = slist.begin(); it != slist.end(); ++it)
6453 if (
"error" == it->GetShortName())
6455 err = it->GetName();
6459 if (
"message" == it->GetShortName())
6461 msg = it->GetName();
6462 LOG(VB_GENERAL, LOG_INFO,
"msg: " + msg);
6466 infoMap[it->GetShortName()] = QString::number(it->GetValue());
6467 if (
"signal" == it->GetShortName())
6468 sig = it->GetNormalizedValue(0, 100);
6469 else if (
"snr" == it->GetShortName())
6470 snr = it->GetValue();
6471 else if (
"ber" == it->GetShortName())
6472 ber =
static_cast<uint>(it->GetValue());
6473 else if (
"pos" == it->GetShortName())
6474 pos = it->GetValue();
6475 else if (
"script" == it->GetShortName())
6476 tuned = it->GetValue();
6477 else if (
"seen_pat" == it->GetShortName())
6478 pat = it->IsGood() ?
"a" :
"_";
6479 else if (
"matching_pat" == it->GetShortName())
6480 pat = it->IsGood() ?
"A" : pat;
6481 else if (
"seen_pmt" == it->GetShortName())
6482 pmt = it->IsGood() ?
"m" :
"_";
6483 else if (
"matching_pmt" == it->GetShortName())
6484 pmt = it->IsGood() ?
"M" : pmt;
6485 else if (
"seen_mgt" == it->GetShortName())
6486 mgt = it->IsGood() ?
"g" :
"_";
6487 else if (
"matching_mgt" == it->GetShortName())
6488 mgt = it->IsGood() ?
"G" : mgt;
6489 else if (
"seen_vct" == it->GetShortName())
6490 vct = it->IsGood() ?
"v" :
"_";
6491 else if (
"matching_vct" == it->GetShortName())
6492 vct = it->IsGood() ?
"V" : vct;
6493 else if (
"seen_nit" == it->GetShortName())
6494 nit = it->IsGood() ?
"n" :
"_";
6495 else if (
"matching_nit" == it->GetShortName())
6496 nit = it->IsGood() ?
"N" : nit;
6497 else if (
"seen_sdt" == it->GetShortName())
6498 sdt = it->IsGood() ?
"s" :
"_";
6499 else if (
"matching_sdt" == it->GetShortName())
6500 sdt = it->IsGood() ?
"S" : sdt;
6501 else if (
"seen_crypt" == it->GetShortName())
6502 crypt = it->IsGood() ?
"c" :
"_";
6503 else if (
"matching_crypt" == it->GetShortName())
6504 crypt = it->IsGood() ?
"C" : crypt;
6507 infoMap[
"signal"] = QString::number(sig);
6511 QString slock = (
"1" == infoMap[
"slock"]) ?
"L" :
"l";
6512 QString lockMsg = (slock==
"L") ? tr(
"Partial Lock") : tr(
"No Lock");
6513 QString sigMsg = allGood ? tr(
"Lock") : lockMsg;
6515 QString sigDesc = tr(
"Signal %1%").arg(sig,2);
6517 sigDesc +=
" | " + tr(
"S/N %1dB").arg(log10(snr), 3,
'f', 1);
6518 if (ber != 0xffffffff)
6519 sigDesc +=
" | " + tr(
"BE %1",
"Bit Errors").arg(ber, 2);
6520 if ((pos >= 0) && (pos < 100))
6521 sigDesc +=
" | " + tr(
"Rotor %1%").arg(pos,2);
6525 else if (tuned == 2)
6527 else if (tuned == 3)
6532 sigDesc = sigDesc + QString(
" | (%1%2%3%4%5%6%7%8%9) %10")
6533 .arg(tuneCode, slock, pat, pmt, mgt, vct,
6539 else if (!msg.isEmpty())
6542 infoMap[
"description"] = sigDesc;
6549 if (allGood || (pmt ==
"M"))
6558 bool timed_out =
false;
6573 LOG(VB_GENERAL, LOG_ERR,
LOC +
6574 "You have no OSD, but tuning has already taken too long.");
6600 static QString s_nextSrc =
GET_KEY(
"TV Playback",
"NEXTSOURCE");
6601 static QString s_togCards =
GET_KEY(
"TV Playback",
"NEXTINPUT");
6603 QString message = tr(
6604 "You should have received a channel lock by now. "
6605 "You can continue to wait for a signal, or you "
6606 "can change the channel with %1 or %2, change "
6607 "video source (%3), inputs (%4), etc.")
6608 .arg(s_chanUp, s_chanDown, s_nextSrc, s_togCards);
6611 { {tr(
"OK"),
"DIALOG_INFO_CHANNELLOCK_0" } },
6612 {
"",
"DIALOG_INFO_CHANNELLOCK_0",
true } });
6617 bool result =
false;
6683 dvdName = tr(
"DVD");
6687 mainStatus = tr(
"Menu");
6691 mainStatus = tr(
"Still Frame");
6695 int playingTitle = 0;
6696 int playingPart = 0;
6701 mainStatus = tr(
"Title: %1 (%2)").arg(playingTitle)
6703 subStatus = tr(
"Chapter: %1/%2").arg(playingPart).arg(totalParts);
6738 for (
uint i : std::as_const(list))
6739 ret += QString(
"%1,").arg(i);
6742 return ret.left(ret.length()-1);
6749 QVector<uint> tunable_cards;
6753 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"ChanId (%1) - no").arg(ChanId));
6754 return tunable_cards;
6758 mplexid = (32767 == mplexid) ? 0 : mplexid;
6760 uint excluded_input = 0;
6768 for (
auto & input : inputs)
6770 if (input.m_sourceId != sourceid)
6773 if (input.m_mplexId &&
6774 input.m_mplexId != mplexid)
6777 if (!input.m_mplexId && input.m_chanId &&
6778 input.m_chanId != ChanId)
6781 tunable_cards.push_back(input.m_inputId);
6784 if (tunable_cards.empty())
6785 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"ChanId (%1) - no").arg(ChanId));
6787 LOG(VB_CHANNEL, LOG_INFO,
LOC + QString(
"ChanId (%1) yes { %2 }").arg(ChanId).arg(
toCommaList(tunable_cards)));
6788 return tunable_cards;
6791 void TV::Embed(
bool Embed, QRect Rect,
const QStringList& Data)
6816 if (!Data.isEmpty())
6828 if (Pause ^ waspaused)
6830 if (Pause ^ waspaused)
6855 LOG(VB_GENERAL, LOG_ERR,
LOC +
"no active ctx playingInfo.");
6882 LOG(VB_PLAYBACK, LOG_DEBUG,
LOC + QString(
"Pausing player: %1").arg(pause));
6955 QString message = QString(
"START_EPG %1").arg(EditType);
6957 QCoreApplication::postEvent(
this, me);
6974 QString appName = tr(
"Video");
6980 appName = tr(
"DVD");
6982 lcd->switchToVolume(appName);
7008 const float kTimeStretchMin = 0.125;
7009 const float kTimeStretchMax = 2.0;
7010 const float kTimeStretchStep = 0.05F;
7014 if (new_ts_normal > kTimeStretchMax &&
7017 new_ts_normal = kTimeStretchMax;
7019 else if (new_ts_normal < kTimeStretchMin &&
7022 new_ts_normal = kTimeStretchMin;
7025 if (new_ts_normal > kTimeStretchMax ||
7026 new_ts_normal < kTimeStretchMin)
7089 QString message = tr(
"MythTV was set to sleep after %1 minutes and will exit in %d seconds.\n"
7090 "Do you wish to continue watching?")
7094 { { tr(
"Yes"),
"DIALOG_SLEEP_YES_0" },
7095 { tr(
"No"),
"DIALOG_SLEEP_NO_0" } }});
7116 LOG(VB_GENERAL, LOG_INFO,
LOC +
"No longer watching TV, exiting");
7126 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Sleep timeout reached, exiting player.");
7144 QString message = tr(
"MythTV has been idle for %1 minutes and "
7145 "will exit in %d seconds. Are you still watching?")
7149 { { tr(
"Yes"),
"DIALOG_IDLE_YES_0" },
7150 { tr(
"No"),
"DIALOG_IDLE_NO_0" }}});
7173 LOG(VB_GENERAL, LOG_INFO,
LOC +
"No longer watching LiveTV, exiting");
7186 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Idle timeout reached, leaving LiveTV");
7226 QString message = me->
Message();
7228 if (message.isEmpty())
7231 std::chrono::milliseconds
timeout = 0ms;
7232 if (me->ExtraDataCount() == 1)
7234 auto t = std::chrono::seconds(me->ExtraData(0).toInt());
7235 if (
t > 0s &&
t < 1000s)
7256 if (dce->GetData().userType() == qMetaTypeId<MythTVMenuNodeTuple>())
7260 QDomNode Node = Menu.GetNodeFromPath(data.m_path);
7261 if (dce->GetResult() == -1)
7268 OSDDialogEvent(dce->GetResult(), dce->GetResultText(), dce->GetData().toString());
7293 LOG(VB_GENERAL, LOG_NOTICE,
"DVD has been ejected, exiting playback");
7308 QString message = me->
Message();
7311 QStringList tokens = message.split(
" ", Qt::SkipEmptyParts);
7313 if (me->ExtraDataCount() == 1)
7316 int value = me->ExtraData(0).toInt();
7346 if (me->ExtraDataCount() >= 2)
7348 width = me->ExtraData(0).toInt();
7349 height = me->ExtraData(1).toInt();
7351 if (me->ExtraDataCount() == 3)
7360 else if (message.startsWith(
"DONE_RECORDING"))
7362 std::chrono::seconds seconds = 0s;
7365 if (tokens.size() == NUMTOKENS)
7367 cardnum = tokens[1].toUInt();
7368 seconds = std::chrono::seconds(tokens[2].toInt());
7373 LOG(VB_GENERAL, LOG_ERR, QString(
"DONE_RECORDING event received "
7374 "with invalid number of arguments, "
7375 "%1 expected, %2 actual")
7377 .arg(tokens.size()-1));
7417 if (message.startsWith(
"ASK_RECORDING "))
7420 bool hasrec =
false;
7421 bool haslater =
false;
7422 if (tokens.size() >= 5)
7424 cardnum = tokens[1].toUInt();
7425 timeuntil = tokens[2].toInt();
7426 hasrec = (tokens[3].toInt() != 0);
7427 haslater = (tokens[4].toInt() != 0);
7429 LOG(VB_GENERAL, LOG_DEBUG,
7430 LOC + message + QString(
" hasrec: %1 haslater: %2")
7431 .arg(hasrec).arg(haslater));
7440 if (message.startsWith(
"QUIT_LIVETV"))
7442 cardnum = (tokens.size() >= 2) ? tokens[1].toUInt() : 0;
7455 if (message.startsWith(
"LIVETV_WATCH"))
7458 if (tokens.size() >= 3)
7460 cardnum = tokens[1].toUInt();
7461 watch = tokens[2].toInt();
7485 if (message.startsWith(
"LIVETV_CHAIN"))
7488 if ((tokens.size() >= 2) && tokens[1] ==
"UPDATE")
7497 if (message.startsWith(
"EXIT_TO_MENU"))
7506 if (message.startsWith(
"SIGNAL"))
7508 cardnum = (tokens.size() >= 2) ? tokens[1].toUInt() : 0;
7509 const QStringList& signalList = me->ExtraDataList();
7525 if (message.startsWith(
"NETWORK_CONTROL"))
7527 if ((tokens.size() >= 2) &&
7528 (tokens[1] !=
"ANSWER") && (tokens[1] !=
"RESPONSE"))
7530 QStringList tokens2 = message.split(
" ", Qt::SkipEmptyParts);
7531 if ((tokens2.size() >= 2) &&
7532 (tokens2[1] !=
"ANSWER") && (tokens2[1] !=
"RESPONSE"))
7541 if (message.startsWith(
"START_EPG"))
7543 int editType = tokens[1].toInt();
7547 if (message.startsWith(
"COMMFLAG_START") && (tokens.size() >= 2))
7550 QDateTime evrecstartts;
7562 QString msg =
"COMMFLAG_REQUEST ";
7569 if (message.startsWith(
"COMMFLAG_UPDATE") && (tokens.size() >= 3))
7572 QDateTime evrecstartts;
7586 QStringList
marks = tokens[2].split(
",", Qt::SkipEmptyParts);
7587 for (
int j = 0; j <
marks.size(); j++)
7589 mark =
marks[j].split(
":", Qt::SkipEmptyParts);
7590 if (
marks.size() >= 2)
7601 if (message ==
"NOTIFICATION")
7622 recinfo.
ToMap(infoMap);
7639 map.insert(
"message_text", tr(
"Record"));
7647 LOG(VB_GENERAL, LOG_CRIT,
LOC +
"Unknown recording during live tv.");
7660 cmdmsg = tr(
"Record");
7663 LOG(VB_RECORD, LOG_INFO,
LOC +
"Toggling Record on");
7672 cmdmsg = tr(
"Cancel Record");
7675 LOG(VB_RECORD, LOG_INFO,
LOC +
"Toggling Record off");
7757 title = tr(
"Adjust Volume");
7774 if (Type ==
"EDIT_CUT_POINTS")
7780 "menu_cutlist.xml", tr(
"Edit Cut Points"),
7781 metaObject()->className(),
"TV Editing");
7787 else if (Type ==
"EDIT_CUT_POINTS_COMPACT")
7793 "menu_cutlist_compact.xml", tr(
"Edit Cut Points"),
7794 metaObject()->className(),
"TV Editing");
7800 else if (Type ==
"EXIT_EDIT_MODE")
7803 dialog.m_buttons.push_back( { tr(
"Save Cuts and Exit"),
"DIALOG_CUTPOINT_SAVEEXIT_0" } );
7804 dialog.m_buttons.push_back( { tr(
"Exit Without Saving"),
"DIALOG_CUTPOINT_REVERTEXIT_0" } );
7805 dialog.m_buttons.push_back( { tr(
"Save Cuts"),
"DIALOG_CUTPOINT_SAVEMAP_0" } );
7806 dialog.m_buttons.push_back( { tr(
"Undo Changes"),
"DIALOG_CUTPOINT_REVERT_0" } );
7807 dialog.m_back = {
"",
"DIALOG_CUTPOINT_DONOTHING_0",
true };
7811 map.insert(
"title", tr(
"Edit"));
7823 if (
Action ==
"DONOTHING" && osd)
7828 QStringList actions(
Action);
7830 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Unrecognised cutpoint action");
7860 QString message = tr(
"This program is currently being edited");
7861 QString def = QString(
"DIALOG_EDITING_CONTINUE_%1").arg(
static_cast<int>(paused));
7863 { { tr(
"Continue Editing"), def,
false,
true },
7864 { tr(
"Do not edit"), QString(
"DIALOG_EDITING_STOP_%1").arg(
static_cast<int>(paused)) }},
7865 {
"", def,
true} });
7881 if (!WasPaused && paused)
7898 for (
auto it = newMap.cbegin(); it != newMap.cend(); ++it)
7899 infoMap.insert(it.key(), *it);
7958 if (osd &&
Action ==
"PROBE")
7966 else if (osd &&
Action ==
"OK")
7974 else if (osd &&
Action ==
"QUIT")
7988 const QString keys[4] = {
"XMLTV",
"callsign",
"channame",
"channum", };
7997 QMap<QString,bool> modifiable;
7998 modifiable[
"callsign"] = Info[
"callsign"].isEmpty();
7999 if (!modifiable[
"callsign"])
8001 QString unsetsign = tr(
"UNKNOWN%1",
"Synthesized callsign");
8002 int unsetcmpl = unsetsign.length() - 2;
8003 unsetsign = unsetsign.left(unsetcmpl);
8004 if (Info[
"callsign"].left(unsetcmpl) == unsetsign)
8005 modifiable[
"callsign"] =
true;
8007 modifiable[
"channame"] = Info[
"channame"].isEmpty();
8009 const std::array<const QString,2> xds_keys {
"callsign",
"channame", };
8010 for (
const auto & key : xds_keys)
8012 if (!modifiable[key])
8022 if ((key ==
"callsign") &&
8023 ((
tmp.length() > 5) || (
tmp.indexOf(
" ") >= 0)))
8035 LOG(VB_GENERAL, LOG_DEBUG,
LOC + QString(
"result %1 text %2 action %3")
8036 .arg(QString::number(Result), Text,
Action));
8042 bool handled =
true;
8043 if (
Action.startsWith(
"DIALOG_"))
8045 Action.remove(
"DIALOG_");
8046 QStringList desc =
Action.split(
"_");
8047 bool valid = desc.size() == 3;
8053 else if (valid && desc[0] ==
"VIDEOEXIT")
8057 else if (valid && desc[0] ==
"SLEEP")
8061 else if (valid && desc[0] ==
"IDLE")
8065 else if (valid && desc[0] ==
"INFO")
8069 else if (valid && desc[0] ==
"EDITING")
8073 else if (valid && desc[0] ==
"ASKALLOW")
8077 else if (valid && desc[0] ==
"EDITOR")
8081 else if (valid && desc[0] ==
"CUTPOINT")
8085 else if ((valid && desc[0] ==
"DELETE") ||
8086 (valid && desc[0] ==
"CONFIRM"))
8095 LOG(VB_GENERAL, LOG_ERR,
"Unrecognised dialog event.");
8098 else if (Result < 0)
8115 else if (
Action ==
"CANCELPLAYLIST")
8141 else if (
Action ==
"TOGGLEMANUALZOOM")
8153 else if (
Action ==
"TOGGLESTRETCH")
8165 else if (
Action.startsWith(
"ADJUSTSTRETCH"))
8167 bool floatRead =
false;
8168 float stretch =
Action.right(
Action.length() - 13).toFloat(&floatRead);
8183 else if (
Action.startsWith(
"SELECTSCAN_"))
8215 else if (
Action.startsWith(
"TOGGLEPICCONTROLS"))
8220 else if (
Action ==
"TOGGLEASPECT")
8224 else if (
Action.startsWith(
"TOGGLEASPECT"))
8228 else if (
Action ==
"TOGGLEFILL")
8232 else if (
Action.startsWith(
"TOGGLEFILL"))
8236 else if (
Action ==
"MENU")
8240 else if (
Action ==
"AUTODETECT_FILL")
8250 if (
Action ==
"CHANGROUP_ALL_CHANNELS")
8256 Action.remove(
"CHANGROUP_");
8262 QString cur_channum;
8263 QString new_channum;
8269 new_channum = cur_channum;
8271 auto it = list.cbegin();
8272 for (; it != list.cend(); ++it)
8274 if ((*it).m_chanNum == cur_channum)
8280 if (it == list.end())
8285 if (it != list.end())
8286 new_channum = (*it).m_chanNum;
8289 LOG(VB_CHANNEL, LOG_INFO,
LOC +
8290 QString(
"Channel Group: '%1'->'%2'")
8291 .arg(cur_channum, new_channum));
8297 if (cur_channum != new_channum && !new_channum.isEmpty())
8316 else if (
Action ==
"SCHEDULE")
8324 else if (
Action.startsWith(
"VISUALISER"))
8328 else if (
Action.startsWith(
"3D"))
8337 if (
Action ==
"TOGGLEBROWSE")
8339 else if (
Action ==
"PREVCHAN")
8341 else if (
Action.startsWith(
"SWITCHTOINPUT_"))
8346 else if (
Action ==
"EDIT")
8377 int chapter =
Action.right(3).toInt();
8382 int title =
Action.right(3).toInt();
8387 int angle =
Action.right(3).toInt();
8390 else if (
Action ==
"EDIT")
8395 else if (
Action ==
"TOGGLEAUTOEXPIRE")
8399 else if (
Action.startsWith(
"TOGGLECOMMSKIP"))
8403 else if (
Action ==
"QUEUETRANSCODE")
8407 else if (
Action ==
"QUEUETRANSCODE_AUTO")
8411 else if (
Action ==
"QUEUETRANSCODE_HIGH")
8415 else if (
Action ==
"QUEUETRANSCODE_MEDIUM")
8419 else if (
Action ==
"QUEUETRANSCODE_LOW")
8441 LOG(VB_GENERAL, LOG_ERR,
LOC +
8442 "Unknown menu action selected: " +
Action);
8453 bool visible =
false;
8466 if (
Action ==
"CHANNELLOCK")
8471 #define BUTTON(action, text) \
8472 result = Context.AddButton(Menu, active, (action), (text), "", false, "")
8473 #define BUTTON2(action, textActive, textInactive) \
8474 result = Context.AddButton(Menu, active, (action), (textActive), (textInactive), false, "")
8475 #define BUTTON3(action, textActive, textInactive, isMenu) \
8476 result = Context.AddButton(Menu, active, (action), (textActive), (textInactive), (isMenu), "")
8491 const QString &actionName = Context.
m_action;
8493 bool result =
false;
8496 result = Context.
m_menu.
Show(Context.
m_node, QDomNode(), *
this, Menu,
false);
8513 if (actionName ==
"DIALOG_CUTPOINT_MOVEPREV_0")
8521 BUTTON2(actionName, tr(
"Move Previous Cut End Here"), tr(
"Move Start of Cut Here"));
8524 else if (actionName ==
"DIALOG_CUTPOINT_MOVENEXT_0")
8532 BUTTON2(actionName, tr(
"Move Next Cut Start Here"), tr(
"Move End of Cut Here"));
8535 else if (actionName ==
"DIALOG_CUTPOINT_CUTTOBEGINNING_0")
8538 BUTTON(actionName, tr(
"Cut to Beginning"));
8540 else if (actionName ==
"DIALOG_CUTPOINT_CUTTOEND_0")
8545 BUTTON(actionName, tr(
"Cut to End"));
8548 else if (actionName ==
"DIALOG_CUTPOINT_DELETE_0")
8551 BUTTON2(actionName, tr(
"Delete This Cut"), tr(
"Join Surrounding Cuts"));
8553 else if (actionName ==
"DIALOG_CUTPOINT_NEWCUT_0")
8556 BUTTON(actionName, tr(
"Add New Cut"));
8558 else if (actionName ==
"DIALOG_CUTPOINT_UNDO_0")
8562 QString text = tr(
"Undo - %1");
8563 result = Context.
AddButton(Menu, active, actionName, text,
"",
false,
8566 else if (actionName ==
"DIALOG_CUTPOINT_REDO_0")
8570 QString text = tr(
"Redo - %1");
8571 result = Context.
AddButton(Menu, active, actionName, text,
"",
false,
8574 else if (actionName ==
"DIALOG_CUTPOINT_CLEARMAP_0")
8576 BUTTON(actionName, tr(
"Clear Cuts"));
8578 else if (actionName ==
"DIALOG_CUTPOINT_INVERTMAP_0")
8580 BUTTON(actionName, tr(
"Reverse Cuts"));
8582 else if (actionName ==
"DIALOG_CUTPOINT_LOADCOMMSKIP_0")
8584 BUTTON(actionName, tr(
"Load Detected Commercials"));
8586 else if (actionName ==
"DIALOG_CUTPOINT_REVERT_0")
8588 BUTTON(actionName, tr(
"Undo Changes"));
8590 else if (actionName ==
"DIALOG_CUTPOINT_REVERTEXIT_0")
8592 BUTTON(actionName, tr(
"Exit Without Saving"));
8594 else if (actionName ==
"DIALOG_CUTPOINT_SAVEMAP_0")
8596 BUTTON(actionName, tr(
"Save Cuts"));
8598 else if (actionName ==
"DIALOG_CUTPOINT_SAVEEXIT_0")
8600 BUTTON(actionName, tr(
"Save Cuts and Exit"));
8614 if (!text.isEmpty())
8615 BUTTON(actionName, text);
8626 const QString &actionName = Context.
m_action;
8628 bool result =
false;
8633 result = Context.
m_menu.
Show(Context.
m_node, QDomNode(), *
this, Menu,
false);
8723 if (
prefix ==
"SELECTSUBTITLE_")
8725 else if (
prefix ==
"SELECTRAWTEXT_")
8727 else if (
prefix ==
"SELECTCC708_")
8729 else if (
prefix ==
"SELECTCC608_")
8731 else if (
prefix ==
"SELECTTTC_")
8733 else if (
prefix ==
"SELECTAUDIO_")
8756 static const std::array<const speed,9> s_speeds {{
8757 { 0,
"", tr(
"Adjust")},
8758 { 50,
"0.5", tr(
"0.5x")},
8759 { 90,
"0.9", tr(
"0.9x")},
8760 {100,
"1.0", tr(
"1.0x")},
8761 {110,
"1.1", tr(
"1.1x")},
8762 {120,
"1.2", tr(
"1.2x")},
8763 {130,
"1.3", tr(
"1.3x")},
8764 {140,
"1.4", tr(
"1.4x")},
8765 {150,
"1.5", tr(
"1.5x")},
8768 for (
const auto & speed : s_speeds)
8790 BUTTON(
"CHANGROUP_ALL_CHANNELS", tr(
"All Channels"));
8791 ChannelGroupList::const_iterator it;
8795 QString
action =
prefix + QString::number(it->m_grpId);
8805 static constexpr std::array<const uint,3> kCasOrd { 0, 2, 1 };
8806 for (
uint csm : kCasOrd)
8823 QString chapter1 = QString(
"%1").arg(i+1, size, 10, QChar(48));
8824 QString chapter2 = QString(
"%1").arg(i+1, 3 , 10, QChar(48));
8826 QString desc = chapter1 + QString(
" (%1)").arg(timestr);
8839 QString angleIdx = QString(
"%1").arg(i, 3, 10, QChar(48));
8854 QString titleIdx = QString(
"%1").arg(i, 3, 10, QChar(48));
8867 QVector <QString> addednames;
8869 for (
auto & input : inputs)
8871 if (input.m_inputId == inputid ||
8872 addednames.contains(input.m_displayName))
8875 addednames += input.m_displayName;
8876 QString
action = QString(
"SWITCHTOINPUT_") +
8877 QString::number(input.m_inputId);
8889 uint sourceid =
info[
"sourceid"].toUInt();
8890 QMap<uint, bool> sourceids;
8892 for (
auto & input : inputs)
8894 if (input.m_sourceId == sourceid ||
8895 sourceids[input.m_sourceId])
8898 sourceids[input.m_sourceId] =
true;
8899 QString
action = QString(
"SWITCHTOINPUT_") +
8900 QString::number(input.m_inputId);
8907 if (actionName ==
"TOGGLEAUDIOSYNC")
8909 BUTTON(actionName, tr(
"Adjust Audio Sync"));
8913 BUTTON(actionName, tr(
"None"));
8915 else if (actionName ==
"DISABLEUPMIX")
8920 BUTTON(actionName, tr(
"Disable Audio Upmixer"));
8923 else if (actionName ==
"ENABLEUPMIX")
8928 BUTTON(actionName, tr(
"Auto Detect"));
8931 else if (actionName ==
"AUTODETECT_FILL")
8938 BUTTON(actionName, tr(
"Auto Detect"));
8941 else if (actionName ==
"TOGGLEMANUALZOOM")
8943 BUTTON(actionName, tr(
"Manual Zoom Mode"));
8945 else if (actionName ==
"DISABLESUBS")
8949 BUTTON(actionName, tr(
"Disable Subtitles"));
8951 else if (actionName ==
"ENABLESUBS")
8955 BUTTON(actionName, tr(
"Enable Subtitles"));
8957 else if (actionName ==
"DISABLEFORCEDSUBS")
8963 BUTTON(actionName, tr(
"Disable Forced Subtitles"));
8966 else if (actionName ==
"ENABLEFORCEDSUBS")
8972 BUTTON(actionName, tr(
"Enable Forced Subtitles"));
8975 else if (actionName ==
"DISABLEEXTTEXT")
8979 BUTTON(actionName, tr(
"Disable External Subtitles"));
8981 else if (actionName ==
"ENABLEEXTTEXT")
8985 BUTTON(actionName, tr(
"Enable External Subtitles"));
8987 else if (actionName ==
"TOGGLETTM")
8990 BUTTON(actionName, tr(
"Toggle Teletext Menu"));
8992 else if (actionName ==
"TOGGLESUBZOOM")
8995 BUTTON(actionName, tr(
"Adjust Subtitle Zoom"));
8997 else if (actionName ==
"TOGGLESUBDELAY")
9003 BUTTON(actionName, tr(
"Adjust Subtitle Delay"));
9006 else if (actionName ==
"PAUSE")
9009 BUTTON2(actionName, tr(
"Play"), tr(
"Pause"));
9011 else if (actionName ==
"TOGGLESTRETCH")
9013 BUTTON(actionName, tr(
"Toggle"));
9015 else if (actionName ==
"TOGGLEBROWSE")
9018 BUTTON(actionName, tr(
"Toggle Browse Mode"));
9020 else if (actionName ==
"CANCELPLAYLIST")
9023 BUTTON(actionName, tr(
"Cancel Playlist"));
9025 else if (actionName ==
"DEBUGOSD")
9027 BUTTON(actionName, tr(
"Playback Data"));
9029 else if (actionName ==
"JUMPFFWD")
9032 BUTTON(actionName, tr(
"Jump Ahead"));
9034 else if (actionName ==
"JUMPRWND")
9037 BUTTON(actionName, tr(
"Jump Back"));
9039 else if (actionName ==
"JUMPTODVDROOTMENU")
9044 BUTTON2(actionName, tr(
"DVD Root Menu"), tr(
"Top menu"));
9047 else if (actionName ==
"JUMPTOPOPUPMENU")
9050 BUTTON(actionName, tr(
"Popup menu"));
9052 else if (actionName ==
"JUMPTODVDTITLEMENU")
9055 BUTTON(actionName, tr(
"DVD Title Menu"));
9057 else if (actionName ==
"JUMPTODVDCHAPTERMENU")
9060 BUTTON(actionName, tr(
"DVD Chapter Menu"));
9062 else if (actionName ==
"PREVCHAN")
9065 BUTTON(actionName, tr(
"Previous Channel"));
9067 else if (actionName ==
"GUIDE")
9069 BUTTON(actionName, tr(
"Program Guide"));
9071 else if (actionName ==
"FINDER")
9073 BUTTON(actionName, tr(
"Program Finder"));
9075 else if (actionName ==
"VIEWSCHEDULED")
9077 BUTTON(actionName, tr(
"Upcoming Recordings"));
9079 else if (actionName ==
"SCHEDULE")
9081 BUTTON(actionName, tr(
"Edit Recording Schedule"));
9083 else if (actionName ==
"DIALOG_JUMPREC_X_0")
9085 BUTTON3(actionName, tr(
"Recorded Program"),
"",
true);
9091 else if (actionName ==
"JUMPPREV")
9106 else if (actionName ==
"EDIT")
9112 BUTTON2(actionName, tr(
"Edit Channel"), tr(
"Edit Recording"));
9115 else if (actionName ==
"TOGGLEAUTOEXPIRE")
9121 tr(
"Turn Auto-Expire OFF"), tr(
"Turn Auto-Expire ON"));
9124 else if (actionName ==
"QUEUETRANSCODE")
9129 BUTTON2(actionName, tr(
"Stop Transcoding"), tr(
"Default"));
9132 else if (actionName ==
"QUEUETRANSCODE_AUTO")
9137 BUTTON(actionName, tr(
"Autodetect"));
9140 else if (actionName ==
"QUEUETRANSCODE_HIGH")
9145 BUTTON(actionName, tr(
"High Quality"));
9148 else if (actionName ==
"QUEUETRANSCODE_MEDIUM")
9153 BUTTON(actionName, tr(
"Medium Quality"));
9156 else if (actionName ==
"QUEUETRANSCODE_LOW")
9161 BUTTON(actionName, tr(
"Low Quality"));
9173 if (!text.isEmpty())
9174 BUTTON(actionName, text);
9234 QString cur_channum = QString();
9237 if (!prev_channum.isEmpty() && prev_channum != cur_channum)
9289 QString text = Menu.
Translate(Node.toElement().attribute(
"text", Menu.
GetName()));
9290 const char* windowtitle {
"???" };
9296 Menu.
Show(Node, Selected, *
this, &
menu);
9297 QDomNode parent = Node.parentNode();
9298 if (!parent.parentNode().isNull())
9302 menu.m_back = {
"", v };
9311 map.insert(
"title", tr(
"Edit"));
9320 (void)tr(
"Playback Menu");
9321 (void)tr(
"Playback Compact Menu");
9323 (void)tr(
"Select Audio Track");
9324 (void)tr(
"Visualisation");
9326 (void)tr(
"Change Aspect Ratio");
9327 (void)tr(
"Adjust Fill");
9328 (void)tr(
"Adjust Picture");
9330 (void)tr(
"Advanced");
9331 (void)tr(
"Video Scan");
9332 (void)tr(
"Deinterlacer");
9333 (void)tr(
"Subtitles");
9334 (void)tr(
"Select Subtitle");
9335 (void)tr(
"Text Subtitles");
9336 (void)tr(
"Select ATSC CC");
9337 (void)tr(
"Select VBI CC");
9338 (void)tr(
"Select Teletext CC");
9339 (void)tr(
"Playback");
9340 (void)tr(
"Adjust Time Stretch");
9341 (void)tr(
"Picture-in-Picture");
9343 (void)tr(
"Channel Groups");
9344 (void)tr(
"Navigate");
9345 (void)tr(
"Commercial Auto-Skip");
9346 (void)tr(
"Chapter");
9349 (void)tr(
"Schedule");
9351 (void)tr(
"Jump to Program");
9352 (void)tr(
"Switch Input");
9353 (void)tr(
"Switch Source");
9355 (void)tr(
"Begin Transcoding");
9358 (void)tr(
"Edit Cut Points");
9359 (void)tr(
"Edit Cut Points (Compact)");
9360 (void)tr(
"Cut List Options");
9368 "menu_playback.xml", tr(
"Playback Menu"),
9369 metaObject()->className(),
"TV Playback");
9371 "menu_playback_compact.xml", tr(
"Playback Compact Menu"),
9372 metaObject()->className(),
"TV Playback");
9384 if (Level < 0 || Level > 1)
9398 QList<QString> titles_seen;
9404 for (
auto *pi : *infoList)
9406 if (pi->GetRecordingGroup() !=
"LiveTV" || LiveTVInAllPrograms ||
9407 pi->GetRecordingGroup() == currecgroup)
9415 QMap<QString,ProgramList>::const_iterator Iprog;
9419 auto progIndex =
static_cast<uint>(plist.
size());
9420 const QString& group = Iprog.key();
9425 if (progIndex == 1 && Level == 0)
9427 dialog.m_buttons.push_back( {Iprog.key(), QString(
"JUMPPROG %1 0").arg(group) });
9429 else if (progIndex > 1 && Level == 0)
9431 QString act = QString(
"DIALOG_%1_%2_1")
9433 dialog.m_buttons.push_back( {group, act,
true, Selected == group });
9435 else if (Level == 1 && Iprog.key() == Category)
9437 for (
auto pit = plist.
begin(); pit != plist.
end(); ++pit)
9441 if (titles_seen.contains(
p->GetTitle()))
9444 titles_seen.push_back(
p->GetTitle());
9447 for (
auto *q : plist)
9451 if (q->GetTitle() !=
p->GetTitle())
9454 dialog.m_buttons.push_back( { q->GetSubtitle().isEmpty() ?
9455 q->GetTitle() : q->GetSubtitle(),
9456 QString(
"JUMPPROG %1 %2").arg(Iprog.key()).arg(j) });
9464 while (!infoList->empty())
9466 delete infoList->back();
9467 infoList->pop_back();
9472 if (!Category.isEmpty())
9475 dialog.m_back = { Category,
"DIALOG_" +
ACTION_JUMPREC +
"_X_0" };
9476 else if (Level == 0)
9500 if (!message.isEmpty())
9513 desc = tr(
"Auto-Expire OFF");
9518 desc = tr(
"Auto-Expire ON");
9523 if (!desc.isEmpty())
9539 if (!desc.isEmpty())
9548 if (!Desc.isEmpty())
9563 for (
const auto&
action : std::as_const(Actions))
9565 if (!
action.startsWith(
"JUMPPROG"))
9569 QString key =
action.section(
" ",1,-2);
9570 uint index =
action.section(
" ",-1,-1).toUInt(&ok);
9587 LOG(VB_GENERAL, LOG_ERR,
LOC + QString(
"Failed to locate jump to program '%1' @ %2")
9588 .arg(key,
action.section(
" ",-1,-1)));
9610 QTimer::singleShot(0,
this, Jump);
9618 LOG(VB_GENERAL, LOG_ERR,
"Failed to open jump to program GUI");
9626 std::chrono::minutes mins { 0min };
9649 if (Time.length() > 11)
9651 bool intRead =
false;
9652 mins = std::chrono::minutes(Time.right(Time.length() - 11).toUInt(&intRead));
9665 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Invalid time " + Time);
9670 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Invalid time string " + Time);
9682 out = tr(
"Sleep") +
" " + QString::number(mins.count());
9695 errorText = tr(
"MythTV is already using all available "
9696 "inputs for the channel you selected. "
9697 "If you want to watch an in-progress recording, "
9698 "select one from the playback menu. If you "
9699 "want to watch Live TV, cancel one of the "
9700 "in-progress recordings from the delete "
9704 errorText = tr(
"Error: MythTV is using all inputs, "
9705 "but there are no active recordings?");
9708 errorText = tr(
"MythTV has no capture cards defined. "
9709 "Please run the mythtv-setup program.");
9846 else if (!dvd->StartOfTitle())
9852 std::chrono::seconds titleLength = dvd->GetTotalTimeOfTitle();
9853 std::chrono::seconds
chapterLength = dvd->GetChapterLength();
9876 bool in_menu = dvd->IsInMenu();
9877 if (in_still && !dvd->NumMenuButtons())
9879 dvd->SkipStillFrame();
9882 else if (!dvd->EndOfTitle() && !in_still && !in_menu)
9886 else if (!in_still && !in_menu)
9888 std::chrono::seconds titleLength = dvd->GetTotalTimeOfTitle();
9889 std::chrono::seconds
chapterLength = dvd->GetChapterLength();
9890 std::chrono::seconds currentTime = dvd->GetCurrentTime();
9935 bool allowed =
false;
9958 videotype = tr(
"Live TV");
9960 videotype = tr(
"this DVD");
9964 videotype = tr(
"this Video");
9967 if (videotype.isEmpty())
9968 videotype = tr(
"this recording");
9972 dialog.m_buttons.push_back({tr(
"Exit %1").arg(videotype),
ACTION_STOP});
9974 dialog.m_buttons.push_back({tr(
"Exit Without Saving"),
"DIALOG_VIDEOEXIT_CLEARLASTPLAYEDPOSITION_0"});
9977 dialog.m_buttons.push_back({tr(
"Delete this recording"),
"DIALOG_VIDEOEXIT_CONFIRMDELETE_0"});
9979 dialog.m_buttons.push_back({tr(
"Keep watching"),
"DIALOG_VIDEOEXIT_KEEPWATCHING_0"});
9980 dialog.m_back = {
"",
"DIALOG_VIDEOEXIT_KEEPWATCHING_0",
true };
9981 emit ChangeOSDDialog(dialog);
9983 if (m_videoExitDialogTimerId)
9984 KillTimer(m_videoExitDialogTimerId);
9985 m_videoExitDialogTimerId = StartTimer(kVideoExitDialogTimeout, __LINE__);
9995 LOG(VB_GENERAL, LOG_ERR,
"It is unsafe to delete at the moment");
10003 LOG(VB_GENERAL, LOG_ERR,
"This program cannot be deleted at this time.");
10010 QString message = tr(
"Cannot delete program ") + QString(
"%1 ").arg(pginfo.
GetTitle());
10013 message += QString(
"\"%1\" ").arg(pginfo.
GetSubtitle());
10017 message += tr(
"because it is not a recording.");
10021 message += tr(
"because it is in use by");
10024 for (
int i = 0; (i + 2) < byWho.size(); i += 3)
10030 message +=
" " + byWho[i+2];
10034 {{ tr(
"OK"),
"DIALOG_DELETE_OK_0" }},
10035 {
"",
"DIALOG_DELETE_OK_0",
true }});
10058 QString message = QString(
"%1\n%2\n%3")
10059 .arg(Title, infoMap[
"title"], infoMap[
"timedate"]);
10065 if (Title ==
"End Of Recording")
10067 dialog.m_buttons.push_back({tr(
"Delete it, but allow it to re-record"),
"DIALOG_VIDEOEXIT_DELETEANDRERECORD_0"});
10068 dialog.m_buttons.push_back({tr(
"Delete it"),
"DIALOG_VIDEOEXIT_JUSTDELETE_0"});
10069 dialog.m_buttons.push_back({tr(
"Save it so I can watch it again"),
ACTION_STOP,
false,
true});
10073 dialog.m_buttons.push_back({tr(
"Yes, and allow re-record"),
"DIALOG_VIDEOEXIT_DELETEANDRERECORD_0"});
10074 dialog.m_buttons.push_back({tr(
"Yes, delete it"),
"DIALOG_VIDEOEXIT_JUSTDELETE_0"});
10075 dialog.m_buttons.push_back({tr(
"No, keep it"),
ACTION_STOP,
false,
true});
10077 dialog.m_back = {
"",
"DIALOG_PLAY_0_0",
true };
10101 if (
Action ==
"DELETEANDRERECORD" && delete_ok)
10108 else if (
Action ==
"JUSTDELETE" && delete_ok)
10114 else if (
Action ==
"CONFIRMDELETE")
10119 else if (
Action ==
"KEEPWATCHING" && !near_end)
10123 else if (
Action ==
"CLEARLASTPLAYEDPOSITION")
10201 bool paused =
false;
10253 case Qt::ApplicationState::ApplicationSuspended:
10255 LOG(VB_GENERAL, LOG_NOTICE,
"Exiting playback on app suspecnd");
void ChangePictureAttribute(PictureAttribute Attribute, bool Direction, int Value)
static SignalMonitorList Parse(const QStringList &slist)
Converts a list of strings to SignalMonitorValue classes.
void HandleStateChange()
Changes the state to the state on the front of the state change queue.
bool Create(void) override
void onApplicationStateChange(Qt::ApplicationState State)
static QString toCommaList(const QVector< uint > &list)
bool IsNearEnd(void)
Returns true iff near end of recording.
static const std::chrono::milliseconds kEndOfPlaybackCheckFrequency
void emitTVPlaybackUnpaused(void)
bool IsActionable(const QString &Action, const QStringList &Actions)
static constexpr const char * OSD_DLG_MENU
void SetLength(std::chrono::seconds len)
bool isActive(void) const
@ 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...
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
@ kDisplayNUVTeletextCaptions
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
@ kStartTVIgnoreLastPlayPos
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 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.
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
@ kDisplayRawTextSubtitle
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 SetInitialTVState(bool islivetv)
determine initial tv state and playgroup for the recording
static bool IsPaused()
Check whether playback is paused.
void HandleVideoExitDialogTimerEvent()
int GetQueuedInputAsInt(bool *OK=nullptr, int Base=10) const
static int ConfiguredTunerCards()
If any cards are configured, return the number.
int Playback(const ProgramInfo &ProgInfo)
void ToggleOSD(bool IncludeStatusOSD)
Cycle through the available Info OSDs.
std::vector< InputInfo > RemoteRequestFreeInputInfo(uint excluded_input)
InfoMap m_chanEditMap
Channel Editing initial map.
static const uint kPreviousSource
#define ACTION_3DTOPANDBOTTOMDISCARD
static QStringList lastProgramStringList
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)
QRecursiveMutex m_chanEditMapLock
Lock for chanEditMap and ddMap.
void HandleEndOfRecordingExitPromptTimerEvent()
void SendSystemEvent(const QString &msg)
void EditSchedule(int EditType=kScheduleProgramGuide)
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
std::chrono::seconds GetTitleDuration(int Title)
@ kAdjustingPicture_Channel
MythMediaBuffer * m_buffer
static EMBEDRETURNVOID RunPlaybackBoxPtr
void ChangeChannel(int channeldirection)
void SetTeletextPage(uint Page)
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
uint GetSignalLockTimeout(const QString &input)
QString m_queuedChanNum
Input key presses queued up so far to form a valid ChanNum.
bool m_savePosOnExit
False until first timer event.
QString toString(Verbosity v=kLongDescription, const QString &sep=":", const QString &grp="\"") const
void LockDeletePlayer(const char *file, int line) const
prevent MythPlayer from being deleted used to ensure player can only be deleted after osd in TV() is ...
SleepTimerInfo(QString String, std::chrono::milliseconds MilliSeconds)
void PlaybackMenuShow(const MythTVMenu &Menu, const QDomNode &Node, const QDomNode &Selected)
QString GetQueuedInput() const
bool MenuItemDisplayCutlist(const MythTVMenuItemContext &Context, MythOSDDialogData *Menu)
static constexpr const char * OSD_DLG_IDLE
void SetCaptionsEnabled(bool Enable, bool UpdateOSD=true)
void HandleSpeedChangeTimerEvent()
void run(const QString &name, Class *object, void(Class::*fn)())
virtual void ToMap(InfoMap &progMap, bool showrerecord=false, uint star_range=10, uint date_format=0) const
Converts ProgramInfo into QString QHash containing each field in ProgramInfo converted into localized...
void GetResolutionSetting(const QString &type, int &width, int &height, double &forced_aspect, double &refresh_rate, int index=-1)
void PopPreviousChannel(bool ImmediateChange)
void DoEditSchedule(int EditType=kScheduleProgramGuide)
std::deque< QString > StringDeque
static bool IsTunable(uint ChanId)
void RegisterForPlayback(QObject *sender, PlaybackStartCb method)
static const uint kInputKeysMax
@ kStartTVIgnoreProgStart
void SetLastProgram(const ProgramInfo *ProgInfo)
@ 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)
#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()
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)
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)
void ReturnPlayerLock() const
@ kPictureAttributeSupported_None
AutoExpireType QueryAutoExpire(void) const
Returns "autoexpire" field from "recorded" table.
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)
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 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={})
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
static const std::array< const mark, 16 > marks
#define ACTION_TOGGLEBOOKMARK
bool DiscMenuHandleAction(const QStringList &Actions) const
volatile int m_saveLastPlayPosTimerId
void exit(int retcode=0)
Use this to exit from the thread if you are using a Qt event loop.
void UpdateOSDStatus(const QString &Title, const QString &Desc, const QString &Value, int Type, const QString &Units, int Position=0, enum OSDTimeout Timeout=kOSDTimeout_Med)
MythMainWindow * m_mainWindow
MythMainWindow * GetMythMainWindow(void)
bool IsVideoFile(void) const
QMutex m_channelGroupLock
Lock necessary when modifying channel group variables.
void UpdateOSDSignal(const QStringList &List)
Updates Signal portion of OSD...
void DoTogglePictureAttribute(PictureAdjustType Type)
void RemoteCancelNextRecording(uint inputid, bool cancel)
bool m_weDisabledGUI
true if this instance disabled MythUI drawing.
void SetCommBreakMap(const frm_dir_map_t &NewMap)
static const int kInitFFRWSpeed
void ForceNextStateNone()
void DisableCaptions(uint Mode, bool UpdateOSD=true)
void TVInWantingPlayback(bool b)
Let the TV class tell us if we was interrupted following a call to WantingPlayback().
PictureAttributeSupported toMask(PictureAttribute PictureAttribute)
StereoscopicMode m_stereoOverride
bool HasPlayer(void) const
void BrowseChannel(const QString &Channum)
QAtomicInt m_referenceCount
std::chrono::duration< CHRONO_TYPE, std::ratio< 1, 90000 > > pts
void SetWatched(bool ForceWatched=false)
Determines if the recording should be considered watched.
bool CheckChannel(const QString &channel)
Checks if named channel exists on current tuner.
void ChangeCaptionTrack(int Direction)
@ 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)
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
std::chrono::milliseconds m_audioOffset
void PauseRecorder(void)
Tells TVRec to pause a recorder, used for channel and input changes.
T dequeue()
Removes item from front of list and returns a copy. O(1).
static bool ScreenShot(int Width=0, int Height=0, QString Filename="")
QString GetBasename(void) const
virtual int IncrRef(void)
Increments reference count.
MythDeque< QString > m_networkControlCommands
void WindowResized(const QSize &Size)
bool DoSetPauseState(bool Pause)
void PauseAudioUntilReady()
bool DoPlayerSeek(float Time)
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
#define ACTION_JUMPCHAPTER
@ 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 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.
@ kDisplayTeletextCaptions
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)
@ kStartTVByNetworkCommand
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