11 #include <QCoreApplication>
67 #define round(x) ((int) ((x) + 0.5))
70 #define DEBUG_CHANNEL_PREFIX 0
71 #define DEBUG_ACTIONS 0
73 #define LOC QString("TV: ")
75 #define GetPlayer(X,Y) GetPlayerHaveLock(X, Y, __FILE__ , __LINE__)
76 #define GetOSDLock(X) GetOSDL(X, __FILE__, __LINE__)
78 #define SetOSDText(CTX, GROUP, FIELD, TEXT, TIMEOUT) { \
79 OSD *osd = GetOSDLock(CTX); \
82 QHash<QString,QString> map; \
83 map.insert(FIELD,TEXT); \
84 osd->SetText(GROUP, map, TIMEOUT); \
86 ReturnOSDLock(CTX, osd); }
88 #define SetOSDMessage(CTX, MESSAGE) \
89 SetOSDText(CTX, "osd_message", "message_text", MESSAGE, kOSDTimeout_Med)
91 #define HideOSDWindow(CTX, WINDOW) { \
92 OSD *osd = GetOSDLock(CTX); \
94 osd->HideWindow(WINDOW); \
95 ReturnOSDLock(CTX, osd); }
119 #ifdef USING_VALGRIND
162 setAutoDelete(
false);
171 m_parent->RunLoadDDMap(m_sourceid);
175 QMutexLocker locker(&m_lock);
182 QMutexLocker locker(&m_lock);
184 m_wait.wait(locker.mutex());
202 query.
prepare(
"SELECT COUNT(cardid) FROM capturecard;");
204 count = query.
value(0).toInt();
206 LOG(VB_RECORD, LOG_INFO,
207 "ConfiguredTunerCards() = " + QString::number(count));
214 vector<QMutex*> mutex;
215 mutex.push_back(mutex0);
218 va_start(argp, mutex0);
219 QMutex *cur = va_arg(argp, QMutex*);
222 mutex.push_back(cur);
223 cur = va_arg(argp, QMutex*);
227 for (
bool success =
false; !success;)
230 for (
uint i = 0; success && (i < mutex.size()); i++)
232 if (!(success = mutex[i]->tryLock()))
234 for (
uint j = 0; j < i; j++)
247 QMutexLocker locker(gTVLock);
253 QMutexLocker locker(gTVLock);
256 LOG(VB_GENERAL, LOG_WARNING,
LOC +
"Already have a TV object.");
265 QMutexLocker locker(gTVLock);
266 if (!tv || !gTV || (gTV != tv))
268 LOG(VB_GENERAL, LOG_ERR,
LOC +
"ReleaseTV - programmer error.");
280 QMutexLocker lock(gTVLock);
282 PlayerContext *ctx = gTV->GetPlayerReadLock(0, __FILE__, __LINE__);
283 PrepareToExitPlayer(ctx, __LINE__);
284 SetExitPlayer(
true,
true);
285 ReturnPlayerLock(ctx);
301 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"StartTV() -- begin");
305 bool quitAll =
false;
306 bool showDialogs =
true;
307 bool playCompleted =
false;
309 bool startSysEventSent =
false;
325 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Failed initializing TV");
334 if (!lastProgramStringList.empty())
343 startSysEventSent =
true;
350 QString playerError = QString::null;
355 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"tv->Playback() -- begin");
360 else if (!startSysEventSent)
362 startSysEventSent =
true;
366 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"tv->Playback() -- end");
370 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"tv->LiveTV() -- begin");
371 if (!tv->
LiveTV(showDialogs))
376 else if (!startSysEventSent)
378 startSysEventSent =
true;
385 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"tv->LiveTV() -- end");
389 if (!ConfiguredTunerCards())
390 LOG(VB_GENERAL, LOG_ERR,
LOC +
"No tuners configured");
392 LOG(VB_GENERAL, LOG_ERR,
LOC +
"No tuners free for live tv");
403 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Entering main playback loop.");
405 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Exiting main playback loop.");
415 curProgram = nextProgram;
434 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"StartTV -- process events 2 begin");
435 qApp->processEvents();
436 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"StartTV -- process events 2 end");
440 playCompleted =
true;
456 list.push_back(QString::number(curProgram->
GetChanID()));
459 list.push_back(allowrerecord ?
"1" :
"0");
460 MythEvent me(
"LOCAL_PBB_DELETE_RECORDINGS", list);
465 lastProgramStringList.clear();
474 if (!playerError.isEmpty())
478 ss, playerError,
false);
488 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"StartTV -- end");
490 return playCompleted;
499 QString
name(
string);
500 if (name ==
"playbackbox")
502 else if (name ==
"viewscheduled")
504 else if (name ==
"programguide")
506 else if (name ==
"programfinder")
508 else if (name ==
"scheduleeditor")
514 REG_KEY(
"TV Frontend", ACTION_PLAYBACK, QT_TRANSLATE_NOOP(
"MythControls",
515 "Play Program"),
"P");
516 REG_KEY(
"TV Frontend", ACTION_STOP, QT_TRANSLATE_NOOP(
"MythControls",
517 "Stop Program"),
"");
518 REG_KEY(
"TV Frontend", ACTION_TOGGLERECORD, QT_TRANSLATE_NOOP(
"MythControls",
519 "Toggle recording status of current program"),
"R");
520 REG_KEY(
"TV Frontend", ACTION_DAYLEFT, QT_TRANSLATE_NOOP(
"MythControls",
521 "Page the program guide back one day"),
"Home");
522 REG_KEY(
"TV Frontend", ACTION_DAYRIGHT, QT_TRANSLATE_NOOP(
"MythControls",
523 "Page the program guide forward one day"),
"End");
524 REG_KEY(
"TV Frontend", ACTION_PAGELEFT, QT_TRANSLATE_NOOP(
"MythControls",
525 "Page the program guide left"),
",,<");
526 REG_KEY(
"TV Frontend", ACTION_PAGERIGHT, QT_TRANSLATE_NOOP(
"MythControls",
527 "Page the program guide right"),
">,.");
528 REG_KEY(
"TV Frontend", ACTION_TOGGLEFAV, QT_TRANSLATE_NOOP(
"MythControls",
529 "Toggle the current channel as a favorite"),
"?");
530 REG_KEY(
"TV Frontend", ACTION_TOGGLEPGORDER, QT_TRANSLATE_NOOP(
"MythControls",
531 "Reverse the channel order in the program guide"),
"");
532 REG_KEY(
"TV Frontend", ACTION_GUIDE, QT_TRANSLATE_NOOP(
"MythControls",
533 "Show the Program Guide"),
"S");
534 REG_KEY(
"TV Frontend", ACTION_FINDER, QT_TRANSLATE_NOOP(
"MythControls",
535 "Show the Program Finder"),
"#");
536 REG_KEY(
"TV Frontend",
"NEXTFAV", QT_TRANSLATE_NOOP(
"MythControls",
537 "Cycle through channel groups and all channels in the "
538 "program guide."),
"/");
539 REG_KEY(
"TV Frontend",
"CHANUPDATE", QT_TRANSLATE_NOOP(
"MythControls",
540 "Switch channels without exiting guide in Live TV mode."),
"X");
541 REG_KEY(
"TV Frontend", ACTION_VOLUMEDOWN, QT_TRANSLATE_NOOP(
"MythControls",
542 "Volume down"),
"[,{,F10,Volume Down");
543 REG_KEY(
"TV Frontend", ACTION_VOLUMEUP, QT_TRANSLATE_NOOP(
"MythControls",
544 "Volume up"),
"],},F11,Volume Up");
545 REG_KEY(
"TV Frontend", ACTION_MUTEAUDIO, QT_TRANSLATE_NOOP(
"MythControls",
546 "Mute"),
"|,\\,F9,Volume Mute");
547 REG_KEY(
"TV Frontend",
"CYCLEAUDIOCHAN", QT_TRANSLATE_NOOP(
"MythControls",
548 "Cycle audio channels"),
"");
549 REG_KEY(
"TV Frontend",
"RANKINC", QT_TRANSLATE_NOOP(
"MythControls",
550 "Increase program or channel rank"),
"Right");
551 REG_KEY(
"TV Frontend",
"RANKDEC", QT_TRANSLATE_NOOP(
"MythControls",
552 "Decrease program or channel rank"),
"Left");
553 REG_KEY(
"TV Frontend",
"UPCOMING", QT_TRANSLATE_NOOP(
"MythControls",
554 "List upcoming episodes"),
"O");
555 REG_KEY(
"TV Frontend", ACTION_VIEWSCHEDULED, QT_TRANSLATE_NOOP(
"MythControls",
556 "List scheduled upcoming episodes"),
"");
557 REG_KEY(
"TV Frontend",
"DETAILS", QT_TRANSLATE_NOOP(
"MythControls",
558 "Show details"),
"U");
559 REG_KEY(
"TV Frontend",
"VIEWCARD", QT_TRANSLATE_NOOP(
"MythControls",
560 "Switch Capture Card view"),
"Y");
561 REG_KEY(
"TV Frontend",
"VIEWINPUT", QT_TRANSLATE_NOOP(
"MythControls",
562 "Switch Capture Card view"),
"C");
563 REG_KEY(
"TV Frontend",
"CUSTOMEDIT", QT_TRANSLATE_NOOP(
"MythControls",
564 "Edit Custom Record Rule"),
"");
565 REG_KEY(
"TV Frontend",
"CHANGERECGROUP", QT_TRANSLATE_NOOP(
"MythControls",
566 "Change Recording Group"),
"");
567 REG_KEY(
"TV Frontend",
"CHANGEGROUPVIEW", QT_TRANSLATE_NOOP(
"MythControls",
568 "Change Group View"),
"");
570 REG_KEY(
"TV Playback",
"BACK", QT_TRANSLATE_NOOP(
"MythControls",
571 "Exit or return to DVD menu"),
"Esc");
572 REG_KEY(
"TV Playback", ACTION_CLEAROSD, QT_TRANSLATE_NOOP(
"MythControls",
573 "Clear OSD"),
"Backspace");
574 REG_KEY(
"TV Playback", ACTION_PAUSE, QT_TRANSLATE_NOOP(
"MythControls",
576 REG_KEY(
"TV Playback", ACTION_SEEKFFWD, QT_TRANSLATE_NOOP(
"MythControls",
577 "Fast Forward"),
"Right");
578 REG_KEY(
"TV Playback", ACTION_SEEKRWND, QT_TRANSLATE_NOOP(
"MythControls",
580 REG_KEY(
"TV Playback", ACTION_SEEKARB, QT_TRANSLATE_NOOP(
"MythControls",
581 "Arbitrary Seek"),
"*");
582 REG_KEY(
"TV Playback", ACTION_SEEKABSOLUTE, QT_TRANSLATE_NOOP(
"MythControls",
583 "Seek to a position in seconds"),
"");
584 REG_KEY(
"TV Playback", ACTION_CHANNELUP, QT_TRANSLATE_NOOP(
"MythControls",
585 "Channel up"),
"Up");
586 REG_KEY(
"TV Playback", ACTION_CHANNELDOWN, QT_TRANSLATE_NOOP(
"MythControls",
587 "Channel down"),
"Down");
588 REG_KEY(
"TV Playback",
"NEXTFAV", QT_TRANSLATE_NOOP(
"MythControls",
589 "Switch to the next favorite channel"),
"/");
590 REG_KEY(
"TV Playback",
"PREVCHAN", QT_TRANSLATE_NOOP(
"MythControls",
591 "Switch to the previous channel"),
"H");
592 REG_KEY(
"TV Playback", ACTION_JUMPFFWD, QT_TRANSLATE_NOOP(
"MythControls",
593 "Jump ahead"),
"PgDown");
594 REG_KEY(
"TV Playback", ACTION_JUMPRWND, QT_TRANSLATE_NOOP(
"MythControls",
595 "Jump back"),
"PgUp");
596 REG_KEY(
"TV Playback",
"INFOWITHCUTLIST", QT_TRANSLATE_NOOP(
"MythControls",
597 "Info utilizing cutlist"),
"");
598 REG_KEY(
"TV Playback", ACTION_JUMPBKMRK, QT_TRANSLATE_NOOP(
"MythControls",
599 "Jump to bookmark"),
"K");
600 REG_KEY(
"TV Playback",
"FFWDSTICKY", QT_TRANSLATE_NOOP(
"MythControls",
601 "Fast Forward (Sticky) or Forward one second while paused"),
">,.");
602 REG_KEY(
"TV Playback",
"RWNDSTICKY", QT_TRANSLATE_NOOP(
"MythControls",
603 "Rewind (Sticky) or Rewind one second while paused"),
",,<");
604 REG_KEY(
"TV Playback",
"NEXTSOURCE", QT_TRANSLATE_NOOP(
"MythControls",
605 "Next Video Source"),
"Y");
606 REG_KEY(
"TV Playback",
"PREVSOURCE", QT_TRANSLATE_NOOP(
"MythControls",
607 "Previous Video Source"),
"");
608 REG_KEY(
"TV Playback",
"NEXTINPUT", QT_TRANSLATE_NOOP(
"MythControls",
610 REG_KEY(
"TV Playback",
"NEXTCARD", QT_TRANSLATE_NOOP(
"MythControls",
612 REG_KEY(
"TV Playback",
"SKIPCOMMERCIAL", QT_TRANSLATE_NOOP(
"MythControls",
613 "Skip Commercial"),
"Z,End");
614 REG_KEY(
"TV Playback",
"SKIPCOMMBACK", QT_TRANSLATE_NOOP(
"MythControls",
615 "Skip Commercial (Reverse)"),
"Q,Home");
616 REG_KEY(
"TV Playback", ACTION_JUMPSTART, QT_TRANSLATE_NOOP(
"MythControls",
617 "Jump to the start of the recording."),
"Ctrl+B");
618 REG_KEY(
"TV Playback",
"TOGGLEBROWSE", QT_TRANSLATE_NOOP(
"MythControls",
619 "Toggle channel browse mode"),
"O");
620 REG_KEY(
"TV Playback", ACTION_TOGGLERECORD, QT_TRANSLATE_NOOP(
"MythControls",
621 "Toggle recording status of current program"),
"R");
622 REG_KEY(
"TV Playback", ACTION_TOGGLEFAV, QT_TRANSLATE_NOOP(
"MythControls",
623 "Toggle the current channel as a favorite"),
"?");
624 REG_KEY(
"TV Playback", ACTION_VOLUMEDOWN, QT_TRANSLATE_NOOP(
"MythControls",
625 "Volume down"),
"[,{,F10,Volume Down");
626 REG_KEY(
"TV Playback", ACTION_VOLUMEUP, QT_TRANSLATE_NOOP(
"MythControls",
627 "Volume up"),
"],},F11,Volume Up");
628 REG_KEY(
"TV Playback", ACTION_MUTEAUDIO, QT_TRANSLATE_NOOP(
"MythControls",
629 "Mute"),
"|,\\,F9,Volume Mute");
630 REG_KEY(
"TV Playback", ACTION_SETVOLUME, QT_TRANSLATE_NOOP(
"MythControls",
631 "Set the volume"),
"");
632 REG_KEY(
"TV Playback",
"CYCLEAUDIOCHAN", QT_TRANSLATE_NOOP(
"MythControls",
633 "Cycle audio channels"),
"");
634 REG_KEY(
"TV Playback", ACTION_TOGGLEUPMIX, QT_TRANSLATE_NOOP(
"MythControls",
635 "Toggle audio upmixer"),
"Ctrl+U");
636 REG_KEY(
"TV Playback",
"TOGGLEPIPMODE", QT_TRANSLATE_NOOP(
"MythControls",
637 "Toggle Picture-in-Picture view"),
"V");
638 REG_KEY(
"TV Playback",
"TOGGLEPBPMODE", QT_TRANSLATE_NOOP(
"MythControls",
639 "Toggle Picture-by-Picture view"),
"Ctrl+V");
640 REG_KEY(
"TV Playback",
"CREATEPIPVIEW", QT_TRANSLATE_NOOP(
"MythControls",
641 "Create Picture-in-Picture view"),
"");
642 REG_KEY(
"TV Playback",
"CREATEPBPVIEW", QT_TRANSLATE_NOOP(
"MythControls",
643 "Create Picture-by-Picture view"),
"");
644 REG_KEY(
"TV Playback",
"NEXTPIPWINDOW", QT_TRANSLATE_NOOP(
"MythControls",
645 "Toggle active PIP/PBP window"),
"B");
646 REG_KEY(
"TV Playback",
"SWAPPIP", QT_TRANSLATE_NOOP(
"MythControls",
647 "Swap PBP/PIP Windows"),
"N");
648 REG_KEY(
"TV Playback",
"TOGGLEPIPSTATE", QT_TRANSLATE_NOOP(
"MythControls",
649 "Change PxP view"),
"");
650 REG_KEY(
"TV Playback",
"TOGGLEASPECT", QT_TRANSLATE_NOOP(
"MythControls",
651 "Toggle the video aspect ratio"),
"Ctrl+W");
652 REG_KEY(
"TV Playback",
"TOGGLEFILL", QT_TRANSLATE_NOOP(
"MythControls",
653 "Next Preconfigured Zoom mode"),
"W");
654 REG_KEY(
"TV Playback", ACTION_TOGGLESUBS, QT_TRANSLATE_NOOP(
"MythControls",
655 "Toggle any captions"),
"T");
656 REG_KEY(
"TV Playback", ACTION_ENABLESUBS, QT_TRANSLATE_NOOP(
"MythControls",
657 "Enable any captions"),
"");
658 REG_KEY(
"TV Playback", ACTION_DISABLESUBS, QT_TRANSLATE_NOOP(
"MythControls",
659 "Disable any captions"),
"");
660 REG_KEY(
"TV Playback",
"TOGGLETTC", QT_TRANSLATE_NOOP(
"MythControls",
661 "Toggle Teletext Captions"),
"");
662 REG_KEY(
"TV Playback",
"TOGGLESUBTITLE", QT_TRANSLATE_NOOP(
"MythControls",
663 "Toggle Subtitles"),
"");
664 REG_KEY(
"TV Playback",
"TOGGLECC608", QT_TRANSLATE_NOOP(
"MythControls",
665 "Toggle VBI CC"),
"");
666 REG_KEY(
"TV Playback",
"TOGGLECC708", QT_TRANSLATE_NOOP(
"MythControls",
667 "Toggle ATSC CC"),
"");
668 REG_KEY(
"TV Playback",
"TOGGLETTM", QT_TRANSLATE_NOOP(
"MythControls",
669 "Toggle Teletext Menu"),
"");
670 REG_KEY(
"TV Playback", ACTION_TOGGLEEXTTEXT, QT_TRANSLATE_NOOP(
"MythControls",
671 "Toggle External Subtitles"),
"");
672 REG_KEY(
"TV Playback", ACTION_ENABLEEXTTEXT, QT_TRANSLATE_NOOP(
"MythControls",
673 "Enable External Subtitles"),
"");
674 REG_KEY(
"TV Playback", ACTION_DISABLEEXTTEXT, QT_TRANSLATE_NOOP(
"MythControls",
675 "Disable External Subtitles"),
"");
676 REG_KEY(
"TV Playback",
"TOGGLERAWTEXT", QT_TRANSLATE_NOOP(
"MythControls",
677 "Toggle Text Subtitles"),
"");
679 REG_KEY(
"TV Playback",
"SELECTAUDIO_0", QT_TRANSLATE_NOOP(
"MythControls",
680 "Play audio track 1"),
"");
681 REG_KEY(
"TV Playback",
"SELECTAUDIO_1", QT_TRANSLATE_NOOP(
"MythControls",
682 "Play audio track 2"),
"");
683 REG_KEY(
"TV Playback",
"SELECTSUBTITLE_0",QT_TRANSLATE_NOOP(
"MythControls",
684 "Display subtitle 1"),
"");
685 REG_KEY(
"TV Playback",
"SELECTSUBTITLE_1",QT_TRANSLATE_NOOP(
"MythControls",
686 "Display subtitle 2"),
"");
687 REG_KEY(
"TV Playback",
"SELECTRAWTEXT_0",QT_TRANSLATE_NOOP(
"MythControls",
688 "Display Text Subtitle 1"),
"");
689 REG_KEY(
"TV Playback",
"SELECTCC608_0", QT_TRANSLATE_NOOP(
"MythControls",
690 "Display VBI CC1"),
"");
691 REG_KEY(
"TV Playback",
"SELECTCC608_1", QT_TRANSLATE_NOOP(
"MythControls",
692 "Display VBI CC2"),
"");
693 REG_KEY(
"TV Playback",
"SELECTCC608_2", QT_TRANSLATE_NOOP(
"MythControls",
694 "Display VBI CC3"),
"");
695 REG_KEY(
"TV Playback",
"SELECTCC608_3", QT_TRANSLATE_NOOP(
"MythControls",
696 "Display VBI CC4"),
"");
697 REG_KEY(
"TV Playback",
"SELECTCC708_0", QT_TRANSLATE_NOOP(
"MythControls",
698 "Display ATSC CC1"),
"");
699 REG_KEY(
"TV Playback",
"SELECTCC708_1", QT_TRANSLATE_NOOP(
"MythControls",
700 "Display ATSC CC2"),
"");
701 REG_KEY(
"TV Playback",
"SELECTCC708_2", QT_TRANSLATE_NOOP(
"MythControls",
702 "Display ATSC CC3"),
"");
703 REG_KEY(
"TV Playback",
"SELECTCC708_3", QT_TRANSLATE_NOOP(
"MythControls",
704 "Display ATSC CC4"),
"");
705 REG_KEY(
"TV Playback", ACTION_ENABLEFORCEDSUBS, QT_TRANSLATE_NOOP(
"MythControls",
706 "Enable Forced Subtitles"),
"");
707 REG_KEY(
"TV Playback", ACTION_DISABLEFORCEDSUBS, QT_TRANSLATE_NOOP(
"MythControls",
708 "Disable Forced Subtitles"),
"");
710 REG_KEY(
"TV Playback",
"NEXTAUDIO", QT_TRANSLATE_NOOP(
"MythControls",
711 "Next audio track"),
"+");
712 REG_KEY(
"TV Playback",
"PREVAUDIO", QT_TRANSLATE_NOOP(
"MythControls",
713 "Previous audio track"),
"-");
714 REG_KEY(
"TV Playback",
"NEXTSUBTITLE", QT_TRANSLATE_NOOP(
"MythControls",
715 "Next subtitle track"),
"");
716 REG_KEY(
"TV Playback",
"PREVSUBTITLE", QT_TRANSLATE_NOOP(
"MythControls",
717 "Previous subtitle track"),
"");
718 REG_KEY(
"TV Playback",
"NEXTRAWTEXT", QT_TRANSLATE_NOOP(
"MythControls",
719 "Next Text track"),
"");
720 REG_KEY(
"TV Playback",
"PREVRAWTEXT", QT_TRANSLATE_NOOP(
"MythControls",
721 "Previous Text track"),
"");
722 REG_KEY(
"TV Playback",
"NEXTCC608", QT_TRANSLATE_NOOP(
"MythControls",
723 "Next VBI CC track"),
"");
724 REG_KEY(
"TV Playback",
"PREVCC608", QT_TRANSLATE_NOOP(
"MythControls",
725 "Previous VBI CC track"),
"");
726 REG_KEY(
"TV Playback",
"NEXTCC708", QT_TRANSLATE_NOOP(
"MythControls",
727 "Next ATSC CC track"),
"");
728 REG_KEY(
"TV Playback",
"PREVCC708", QT_TRANSLATE_NOOP(
"MythControls",
729 "Previous ATSC CC track"),
"");
730 REG_KEY(
"TV Playback",
"NEXTCC", QT_TRANSLATE_NOOP(
"MythControls",
731 "Next of any captions"),
"");
733 REG_KEY(
"TV Playback",
"NEXTSCAN", QT_TRANSLATE_NOOP(
"MythControls",
734 "Next video scan overidemode"),
"");
735 REG_KEY(
"TV Playback",
"QUEUETRANSCODE", QT_TRANSLATE_NOOP(
"MythControls",
736 "Queue the current recording for transcoding"),
"X");
737 REG_KEY(
"TV Playback",
"SPEEDINC", QT_TRANSLATE_NOOP(
"MythControls",
738 "Increase the playback speed"),
"U");
739 REG_KEY(
"TV Playback",
"SPEEDDEC", QT_TRANSLATE_NOOP(
"MythControls",
740 "Decrease the playback speed"),
"J");
741 REG_KEY(
"TV Playback",
"ADJUSTSTRETCH", QT_TRANSLATE_NOOP(
"MythControls",
742 "Turn on time stretch control"),
"A");
743 REG_KEY(
"TV Playback",
"STRETCHINC", QT_TRANSLATE_NOOP(
"MythControls",
744 "Increase time stretch speed"),
"");
745 REG_KEY(
"TV Playback",
"STRETCHDEC", QT_TRANSLATE_NOOP(
"MythControls",
746 "Decrease time stretch speed"),
"");
747 REG_KEY(
"TV Playback",
"TOGGLESTRETCH", QT_TRANSLATE_NOOP(
"MythControls",
748 "Toggle time stretch speed"),
"");
749 REG_KEY(
"TV Playback", ACTION_TOGGELAUDIOSYNC,
750 QT_TRANSLATE_NOOP(
"MythControls",
751 "Turn on audio sync adjustment controls"),
"");
752 REG_KEY(
"TV Playback", ACTION_SETAUDIOSYNC,
753 QT_TRANSLATE_NOOP(
"MythControls",
754 "Set the audio sync adjustment"),
"");
755 REG_KEY(
"TV Playback",
"TOGGLEPICCONTROLS",
756 QT_TRANSLATE_NOOP(
"MythControls",
"Playback picture adjustments"),
758 REG_KEY(
"TV Playback", ACTION_TOGGLENIGHTMODE,
759 QT_TRANSLATE_NOOP(
"MythControls",
"Toggle night mode"),
"Ctrl+F");
760 REG_KEY(
"TV Playback", ACTION_SETBRIGHTNESS,
761 QT_TRANSLATE_NOOP(
"MythControls",
"Set the picture brightness"),
"");
762 REG_KEY(
"TV Playback", ACTION_SETCONTRAST,
763 QT_TRANSLATE_NOOP(
"MythControls",
"Set the picture contrast"),
"");
764 REG_KEY(
"TV Playback", ACTION_SETCOLOUR,
765 QT_TRANSLATE_NOOP(
"MythControls",
"Set the picture color"),
"");
766 REG_KEY(
"TV Playback", ACTION_SETHUE,
767 QT_TRANSLATE_NOOP(
"MythControls",
"Set the picture hue"),
"");
768 REG_KEY(
"TV Playback", ACTION_TOGGLESTUDIOLEVELS,
769 QT_TRANSLATE_NOOP(
"MythControls",
"Playback picture adjustments"),
771 REG_KEY(
"TV Playback", ACTION_TOGGLECHANCONTROLS,
772 QT_TRANSLATE_NOOP(
"MythControls",
"Recording picture adjustments "
773 "for this channel"),
"Ctrl+G");
774 REG_KEY(
"TV Playback", ACTION_TOGGLERECCONTROLS,
775 QT_TRANSLATE_NOOP(
"MythControls",
"Recording picture adjustments "
776 "for this recorder"),
"G");
777 REG_KEY(
"TV Playback",
"CYCLECOMMSKIPMODE",
778 QT_TRANSLATE_NOOP(
"MythControls",
"Cycle Commercial Skip mode"),
780 REG_KEY(
"TV Playback", ACTION_GUIDE, QT_TRANSLATE_NOOP(
"MythControls",
781 "Show the Program Guide"),
"S");
782 REG_KEY(
"TV Playback", ACTION_FINDER, QT_TRANSLATE_NOOP(
"MythControls",
783 "Show the Program Finder"),
"#");
784 REG_KEY(
"TV Playback", ACTION_TOGGLESLEEP, QT_TRANSLATE_NOOP(
"MythControls",
785 "Toggle the Sleep Timer"),
"F8");
786 REG_KEY(
"TV Playback", ACTION_PLAY, QT_TRANSLATE_NOOP(
"MythControls",
"Play"),
788 REG_KEY(
"TV Playback", ACTION_JUMPPREV, QT_TRANSLATE_NOOP(
"MythControls",
789 "Jump to previously played recording"),
"");
790 REG_KEY(
"TV Playback", ACTION_JUMPREC, QT_TRANSLATE_NOOP(
"MythControls",
791 "Display menu of recorded programs to jump to"),
"");
792 REG_KEY(
"TV Playback", ACTION_VIEWSCHEDULED, QT_TRANSLATE_NOOP(
"MythControls",
793 "Display scheduled recording list"),
"");
794 REG_KEY(
"TV Playback", ACTION_SIGNALMON, QT_TRANSLATE_NOOP(
"MythControls",
795 "Monitor Signal Quality"),
"Alt+F7");
796 REG_KEY(
"TV Playback", ACTION_JUMPTODVDROOTMENU,
797 QT_TRANSLATE_NOOP(
"MythControls",
"Jump to the DVD Root Menu"),
"");
798 REG_KEY(
"TV Playback", ACTION_JUMPTOPOPUPMENU,
799 QT_TRANSLATE_NOOP(
"MythControls",
"Jump to the Popup Menu"),
"");
800 REG_KEY(
"TV Playback", ACTION_JUMPTODVDCHAPTERMENU,
801 QT_TRANSLATE_NOOP(
"MythControls",
"Jump to the DVD Chapter Menu"),
"");
802 REG_KEY(
"TV Playback", ACTION_JUMPTODVDTITLEMENU,
803 QT_TRANSLATE_NOOP(
"MythControls",
"Jump to the DVD Title Menu"),
"");
804 REG_KEY(
"TV Playback", ACTION_EXITSHOWNOPROMPTS,
805 QT_TRANSLATE_NOOP(
"MythControls",
"Exit Show without any prompts"),
807 REG_KEY(
"TV Playback", ACTION_JUMPCHAPTER, QT_TRANSLATE_NOOP(
"MythControls",
808 "Jump to a chapter"),
"");
809 REG_KEY(
"TV Playback", ACTION_SWITCHTITLE, QT_TRANSLATE_NOOP(
"MythControls",
810 "Switch title"),
"");
811 REG_KEY(
"TV Playback", ACTION_SWITCHANGLE, QT_TRANSLATE_NOOP(
"MythControls",
812 "Switch angle"),
"");
813 REG_KEY(
"TV Playback", ACTION_ZOOMUP, QT_TRANSLATE_NOOP(
"MythControls",
814 "Zoom mode - shift up"),
"");
815 REG_KEY(
"TV Playback", ACTION_ZOOMDOWN, QT_TRANSLATE_NOOP(
"MythControls",
816 "Zoom mode - shift down"),
"");
817 REG_KEY(
"TV Playback", ACTION_ZOOMLEFT, QT_TRANSLATE_NOOP(
"MythControls",
818 "Zoom mode - shift left"),
"");
819 REG_KEY(
"TV Playback", ACTION_ZOOMRIGHT, QT_TRANSLATE_NOOP(
"MythControls",
820 "Zoom mode - shift right"),
"");
821 REG_KEY(
"TV Playback", ACTION_ZOOMASPECTUP,
822 QT_TRANSLATE_NOOP(
"MythControls",
823 "Zoom mode - increase aspect ratio"),
"");
824 REG_KEY(
"TV Playback", ACTION_ZOOMASPECTDOWN,
825 QT_TRANSLATE_NOOP(
"MythControls",
826 "Zoom mode - decrease aspect ratio"),
"");
827 REG_KEY(
"TV Playback", ACTION_ZOOMIN, QT_TRANSLATE_NOOP(
"MythControls",
828 "Zoom mode - zoom in"),
"");
829 REG_KEY(
"TV Playback", ACTION_ZOOMOUT, QT_TRANSLATE_NOOP(
"MythControls",
830 "Zoom mode - zoom out"),
"");
831 REG_KEY(
"TV Playback", ACTION_ZOOMQUIT, QT_TRANSLATE_NOOP(
"MythControls",
832 "Zoom mode - quit and abandon changes"),
"");
833 REG_KEY(
"TV Playback", ACTION_ZOOMCOMMIT, QT_TRANSLATE_NOOP(
"MythControls",
834 "Zoom mode - commit changes"),
"");
837 REG_KEY(
"TV Playback", ACTION_MENURED, QT_TRANSLATE_NOOP(
"MythControls",
839 REG_KEY(
"TV Playback", ACTION_MENUGREEN, QT_TRANSLATE_NOOP(
"MythControls",
840 "Menu Green"),
"F3");
841 REG_KEY(
"TV Playback", ACTION_MENUYELLOW, QT_TRANSLATE_NOOP(
"MythControls",
842 "Menu Yellow"),
"F4");
843 REG_KEY(
"TV Playback", ACTION_MENUBLUE, QT_TRANSLATE_NOOP(
"MythControls",
845 REG_KEY(
"TV Playback", ACTION_TEXTEXIT, QT_TRANSLATE_NOOP(
"MythControls",
847 REG_KEY(
"TV Playback", ACTION_MENUTEXT, QT_TRANSLATE_NOOP(
"MythControls",
849 REG_KEY(
"TV Playback", ACTION_MENUEPG, QT_TRANSLATE_NOOP(
"MythControls",
853 REG_KEY(
"TV Editing", ACTION_CLEARMAP, QT_TRANSLATE_NOOP(
"MythControls",
854 "Clear editing cut points"),
"C,Q,Home");
855 REG_KEY(
"TV Editing", ACTION_INVERTMAP, QT_TRANSLATE_NOOP(
"MythControls",
856 "Invert Begin/End cut points"),
"I");
857 REG_KEY(
"TV Editing", ACTION_SAVEMAP, QT_TRANSLATE_NOOP(
"MythControls",
859 REG_KEY(
"TV Editing", ACTION_LOADCOMMSKIP,QT_TRANSLATE_NOOP(
"MythControls",
860 "Load cuts from detected commercials"),
"Z,End");
861 REG_KEY(
"TV Editing", ACTION_NEXTCUT, QT_TRANSLATE_NOOP(
"MythControls",
862 "Jump to the next cut point"),
"PgDown");
863 REG_KEY(
"TV Editing", ACTION_PREVCUT, QT_TRANSLATE_NOOP(
"MythControls",
864 "Jump to the previous cut point"),
"PgUp");
865 REG_KEY(
"TV Editing", ACTION_BIGJUMPREW, QT_TRANSLATE_NOOP(
"MythControls",
866 "Jump back 10x the normal amount"),
",,<");
867 REG_KEY(
"TV Editing", ACTION_BIGJUMPFWD, QT_TRANSLATE_NOOP(
"MythControls",
868 "Jump forward 10x the normal amount"),
">,.");
871 REG_KEY(
"Teletext Menu", ACTION_NEXTPAGE, QT_TRANSLATE_NOOP(
"MythControls",
872 "Next Page"),
"Down");
873 REG_KEY(
"Teletext Menu", ACTION_PREVPAGE, QT_TRANSLATE_NOOP(
"MythControls",
874 "Previous Page"),
"Up");
875 REG_KEY(
"Teletext Menu", ACTION_NEXTSUBPAGE, QT_TRANSLATE_NOOP(
"MythControls",
876 "Next Subpage"),
"Right");
877 REG_KEY(
"Teletext Menu", ACTION_PREVSUBPAGE, QT_TRANSLATE_NOOP(
"MythControls",
878 "Previous Subpage"),
"Left");
879 REG_KEY(
"Teletext Menu", ACTION_TOGGLETT, QT_TRANSLATE_NOOP(
"MythControls",
880 "Toggle Teletext"),
"T");
881 REG_KEY(
"Teletext Menu", ACTION_MENURED, QT_TRANSLATE_NOOP(
"MythControls",
883 REG_KEY(
"Teletext Menu", ACTION_MENUGREEN, QT_TRANSLATE_NOOP(
"MythControls",
884 "Menu Green"),
"F3");
885 REG_KEY(
"Teletext Menu", ACTION_MENUYELLOW, QT_TRANSLATE_NOOP(
"MythControls",
886 "Menu Yellow"),
"F4");
887 REG_KEY(
"Teletext Menu", ACTION_MENUBLUE, QT_TRANSLATE_NOOP(
"MythControls",
889 REG_KEY(
"Teletext Menu", ACTION_MENUWHITE, QT_TRANSLATE_NOOP(
"MythControls",
890 "Menu White"),
"F6");
891 REG_KEY(
"Teletext Menu", ACTION_TOGGLEBACKGROUND,
892 QT_TRANSLATE_NOOP(
"MythControls",
"Toggle Background"),
"F7");
893 REG_KEY(
"Teletext Menu", ACTION_REVEAL, QT_TRANSLATE_NOOP(
"MythControls",
894 "Reveal hidden Text"),
"F8");
897 REG_KEY(
"TV Playback", ACTION_TOGGLEVISUALISATION,
898 QT_TRANSLATE_NOOP(
"MythControls",
"Toggle audio visualisation"),
"");
901 REG_KEY(
"TV Playback", ACTION_TOGGLEOSDDEBUG,
902 QT_TRANSLATE_NOOP(
"MythControls",
"Toggle OSD playback information"),
"");
905 REG_KEY(
"TV Playback", ACTION_3DNONE,
906 QT_TRANSLATE_NOOP(
"MythControls",
"No 3D"),
"");
907 REG_KEY(
"TV Playback", ACTION_3DSIDEBYSIDE,
908 QT_TRANSLATE_NOOP(
"MythControls",
"3D Side by Side"),
"");
909 REG_KEY(
"TV Playback", ACTION_3DSIDEBYSIDEDISCARD,
910 QT_TRANSLATE_NOOP(
"MythControls",
"Discard 3D Side by Side"),
"");
911 REG_KEY(
"TV Playback", ACTION_3DTOPANDBOTTOM,
912 QT_TRANSLATE_NOOP(
"MythControls",
"3D Top and Bottom"),
"");
913 REG_KEY(
"TV Playback", ACTION_3DTOPANDBOTTOMDISCARD,
914 QT_TRANSLATE_NOOP(
"MythControls",
"Discard 3D Top and Bottom"),
"");
962 db_channel_format(
"<num> <sign>"),
964 db_playback_exit_prompt(0), db_autoexpire_default(0),
965 db_auto_set_watched(
false), db_end_of_rec_exit_prompt(
false),
966 db_jump_prefer_osd(
true), db_use_gui_size_for_tv(
false),
967 db_start_in_guide(
false), db_toggle_bookmark(
false),
968 db_run_jobs_on_remote(
false), db_continue_embedded(
false),
969 db_use_fixed_size(
true), db_browse_always(
false),
970 db_browse_all_tuners(
false),
971 db_use_channel_groups(
false), db_remember_last_channel_group(
false),
973 tryUnflaggedSkip(
false),
975 ff_rew_repos(1.0f), ff_rew_reverse(
false),
981 stretchAdjustment(
false),
982 audiosyncAdjustment(
false),
983 subtitleZoomAdjustment(
false),
984 subtitleDelayAdjustment(
false),
987 endOfRecording(
false),
989 doSmartForward(
false),
990 queuedTranscode(
false),
993 askAllowLock(QMutex::Recursive),
995 chanEditMapLock(QMutex::Recursive),
996 ddMapSourceId(0), ddMapLoader(new
DDLoader(this)),
998 sleep_index(0), sleepTimerId(0), sleepDialogTimerId(0),
1000 idleTimerId(0), idleDialogTimerId(0),
1012 inPlaylist(
false), underNetworkControl(
false),
1014 jumpToProgramPIPState(
kPIPOff),
1015 jumpToProgram(
false),
1018 noHardwareDecoders(
false),
1022 lcdTitle(
""), lcdSubtitle(
""), lcdCallsign(
""),
1024 myWindow(NULL), weDisabledGUI(
false),
1025 disableDrawUnusedRects(
false),
1028 lcdTimerId(0), lcdVolumeTimerId(0),
1029 networkControlTimerId(0), jumpMenuTimerId(0),
1030 pipChangeTimerId(0),
1031 switchToInputTimerId(0), ccInputTimerId(0),
1032 asInputTimerId(0), queueInputTimerId(0),
1033 browseTimerId(0), updateOSDPosTimerId(0),
1034 updateOSDDebugTimerId(0),
1035 endOfPlaybackTimerId(0), embedCheckTimerId(0),
1036 endOfRecPromptTimerId(0), videoExitDialogTimerId(0),
1037 pseudoChangeChanTimerId(0), speedChangeTimerId(0),
1038 errorRecoveryTimerId(0), exitPlayerTimerId(0)
1040 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Creating TV object");
1043 setObjectName(
"TV");
1059 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Finished creating TV object");
1064 QMap<QString,QString> kv;
1065 kv[
"LiveTVIdleTimeout"] =
"0";
1066 kv[
"BrowseMaxForward"] =
"240";
1067 kv[
"PlaybackExitPrompt"] =
"0";
1068 kv[
"AutomaticSetWatched"] =
"0";
1069 kv[
"EndOfRecordingExitPrompt"] =
"0";
1070 kv[
"JumpToProgramOSD"] =
"1";
1071 kv[
"GuiSizeForTV"] =
"0";
1072 kv[
"WatchTVGuide"] =
"0";
1073 kv[
"AltClearSavedPosition"] =
"1";
1074 kv[
"JobsRunOnRecordHost"] =
"0";
1075 kv[
"ContinueEmbeddedTVPlay"] =
"0";
1076 kv[
"UseFixedWindowSize"] =
"1";
1077 kv[
"PersistentBrowseMode"] =
"0";
1078 kv[
"BrowseAllTuners"] =
"0";
1079 kv[
"ChannelOrdering"] =
"channum";
1081 kv[
"CustomFilters"] =
"";
1082 kv[
"ChannelFormat"] =
"<num> <sign>";
1084 kv[
"TryUnflaggedSkip"] =
"0";
1086 kv[
"ChannelGroupDefault"] =
"-1";
1087 kv[
"BrowseChannelGroup"] =
"0";
1088 kv[
"SmartForward"] =
"0";
1089 kv[
"FFRewReposTime"] =
"100";
1090 kv[
"FFRewReverse"] =
"1";
1092 kv[
"BrowseChannelGroup"] =
"0";
1093 kv[
"ChannelGroupDefault"] =
"-1";
1094 kv[
"ChannelGroupRememberLast"] =
"0";
1096 kv[
"VbiFormat"] =
"";
1097 kv[
"DecodeVBIFormat"] =
"";
1099 int ff_rew_def[8] = { 3, 5, 10, 20, 30, 60, 120, 180 };
1100 for (
uint i = 0; i <
sizeof(ff_rew_def)/
sizeof(ff_rew_def[0]); i++)
1101 kv[QString(
"FFRewSpeed%1").arg(i)] = QString::number(ff_rew_def[i]);
1105 QString db_channel_ordering;
1106 uint db_browse_max_forward;
1110 db_browse_max_forward = kv[
"BrowseMaxForward"].toInt() * 60;
1123 db_channel_ordering = kv[
"ChannelOrdering"];
1135 QString beVBI = kv[
"VbiFormat"];
1136 QString feVBI = kv[
"DecodeVBIFormat"];
1154 for (
uint i = 0; i <
sizeof(ff_rew_def)/
sizeof(ff_rew_def[0]); i++)
1155 ff_rew_speeds.push_back(kv[QString(
"FFRewSpeed%1").arg(i)].toInt());
1181 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Init -- begin");
1196 ybase, height, hmult);
1208 int gui_width = 0, gui_height = 0;
1210 fullscreen |= (0 == gui_width && 0 == gui_height);
1222 int maxWidth = 1920, maxHeight = 1440;
1255 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Created TvPlayWindow.");
1266 mainWindow->installEventFilter(
this);
1267 qApp->processEvents();
1274 qApp->processEvents();
1301 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"Init -- end");
1307 LOG(VB_PLAYBACK, LOG_INFO,
"TV::~TV() -- begin");
1324 LOG(VB_PLAYBACK, LOG_INFO,
"TV::~TV() -- lock");
1340 lcd->setFunctionLEDs(
FUNC_TV,
false);
1342 lcd->switchToTime();
1385 LOG(VB_PLAYBACK, LOG_INFO,
"TV::~TV() -- end");
1395 qApp->processEvents();
1409 int count =
player.size();
1410 for (
int i = 0; i < count; i++)
1444 0,
true,
"channum, callsign", groupID);
1480 status.insert(
"starttime",
1482 .toUTC().toString(
"yyyy-MM-ddThh:mm:ssZ"));
1483 status.insert(
"chanid",
1494 if (!info.
text[
"totalchapters"].isEmpty())
1496 QList<long long> chapters;
1499 foreach (
long long chapter, chapters)
1500 var << QVariant(chapter);
1501 status.insert(
"chaptertimes", var);
1508 int currenttrack = -1;
1511 for (
int i = 0; i < list.size(); i++)
1513 if (i == currenttrack)
1514 status.insert(
"currentsubtitletrack", list[i]);
1515 tracks.insert(
"SELECTSUBTITLE_" + QString::number(i), list[i]);
1522 for (
int i = 0; i < list.size(); i++)
1524 if (i == currenttrack)
1525 status.insert(
"currentsubtitletrack", list[i]);
1526 tracks.insert(
"SELECTTTC_" + QString::number(i), list[i]);
1533 for (
int i = 0; i < list.size(); i++)
1535 if (i == currenttrack)
1536 status.insert(
"currentsubtitletrack", list[i]);
1537 tracks.insert(
"SELECTCC708_" + QString::number(i), list[i]);
1544 for (
int i = 0; i < list.size(); i++)
1546 if (i == currenttrack)
1547 status.insert(
"currentsubtitletrack", list[i]);
1548 tracks.insert(
"SELECTCC608_" + QString::number(i), list[i]);
1555 for (
int i = 0; i < list.size(); i++)
1557 if (i == currenttrack)
1558 status.insert(
"currentsubtitletrack", list[i]);
1559 tracks.insert(
"SELECTRAWTEXT_" + QString::number(i), list[i]);
1565 status.insert(
"currentsubtitletrack", tr(
"External Subtitles"));
1566 tracks.insert(ACTION_ENABLEEXTTEXT, tr(
"External Subtitles"));
1569 status.insert(
"totalsubtitletracks", tracks.size());
1570 if (!tracks.isEmpty())
1571 status.insert(
"subtitletracks", tracks);
1576 for (
int i = 0; i < list.size(); i++)
1578 if (i == currenttrack)
1579 status.insert(
"currentaudiotrack", list[i]);
1580 tracks.insert(
"SELECTAUDIO_" + QString::number(i), list[i]);
1583 status.insert(
"totalaudiotracks", tracks.size());
1584 if (!tracks.isEmpty())
1585 status.insert(
"audiotracks", tracks);
1601 status.insert(
"brightness",
1604 if (supp & kPictureAttributeSupported_Brightness)
1606 status.insert(
"contrast",
1609 if (supp & kPictureAttributeSupported_Brightness)
1611 status.insert(
"colour",
1614 if (supp & kPictureAttributeSupported_Brightness)
1616 status.insert(
"hue",
1621 status.insert(
"studiolevels",
1630 QHashIterator<QString,QString> tit(info.
text);
1631 while (tit.hasNext())
1634 status.insert(tit.key(), tit.value());
1637 QHashIterator<QString,int> vit(info.
values);
1638 while (vit.hasNext())
1641 status.insert(vit.key(), vit.value());
1680 LOG(VB_GENERAL, LOG_INFO, QString(
"Using Idle Timer. %1 minutes")
1746 const QStringList &msg,
int timeuntil,
1747 bool hasrec,
bool haslater)
1750 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
"AskAllowRecording");
1768 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
"AskAllowRecording -- " +
1769 QString(
"adding '%1'").arg(info->
title));
1777 LOG(VB_GENERAL, LOG_INFO,
LOC +
"AskAllowRecording -- " +
1778 QString(
"removing '%1'").arg(info->
GetTitle()));
1799 QString single_rec =
1800 tr(
"MythTV wants to record \"%1\" on %2 in %d seconds. "
1803 QString record_watch = tr(
"Record and watch while it records");
1804 QString let_record1 = tr(
"Let it record and go back to the Main Menu");
1805 QString let_recordm = tr(
"Let them record and go back to the Main Menu");
1806 QString record_later1 = tr(
"Record it later, I want to watch TV");
1807 QString record_laterm = tr(
"Record them later, I want to watch TV");
1808 QString do_not_record1= tr(
"Don't let it record, I want to watch TV");
1809 QString do_not_recordm= tr(
"Don't let them record, I want to watch TV");
1814 QMap<QString,AskProgramInfo>::iterator
next = it;
1818 if ((*it).expiry <= timeNow)
1821 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
"UpdateOSDAskAllowDialog -- " +
1822 QString(
"removing '%1'").arg((*it).info->title));
1830 QString message = QString::null;
1836 (*it).is_in_same_input_group = (*it).is_conflicting =
true;
1841 bool busy_input_grps_loaded =
false;
1842 vector<uint> busy_input_grps;
1850 (*it).is_in_same_input_group =
1851 (cardid == (*it).info->GetCardID());
1853 if ((*it).is_in_same_input_group)
1857 if (!busy_input_grps_loaded)
1860 busy_input_grps_loaded =
true;
1863 vector<uint> input_grps =
1866 for (
uint i = 0; i < input_grps.size(); i++)
1868 if (
find(busy_input_grps.begin(), busy_input_grps.end(),
1869 input_grps[i]) != busy_input_grps.end())
1871 (*it).is_in_same_input_group =
true;
1882 if (!(*it).is_in_same_input_group)
1883 (*it).is_conflicting =
false;
1884 else if (cardid == (
uint)(*it).info->GetCardID())
1885 (*it).is_conflicting =
true;
1887 (*it).is_conflicting =
true;
1888 else if ((busy_input.
sourceid == (
uint)(*it).info->GetSourceID()) &&
1889 (busy_input.
mplexid == (
uint)(*it).info->QueryMplexID()))
1890 (*it).is_conflicting =
false;
1892 (*it).is_conflicting =
true;
1894 conflict_count += (*it).is_conflicting ? 1 : 0;
1901 if (conflict_count == 0)
1903 LOG(VB_GENERAL, LOG_INFO,
LOC +
"The scheduler wants to make "
1904 "a non-conflicting recording.");
1908 else if (conflict_count == 1 && ((*it).info->GetCardID() == cardid))
1911 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
"UpdateOSDAskAllowDialog -- " +
1919 .replace(
"<num>", (*it).info->GetChanNum())
1920 .replace(
"<sign>", (*it).info->GetChannelSchedulingID())
1921 .replace(
"<name>", (*it).info->GetChannelName());
1923 message = single_rec.arg((*it).info->GetTitle()).arg(channel);
1925 OSD *osd = GetOSDLock(ctx);
1930 osd->
DialogShow(OSD_DLG_ASKALLOW, message, timeuntil);
1932 false, !((*it).has_rec));
1934 osd->
DialogAddButton(((*it).has_later) ? record_later1 : do_not_record1,
1935 "DIALOG_ASKALLOW_CANCELRECORDING_0",
1936 false, ((*it).has_rec));
1942 if (conflict_count > 1)
1944 message = QObject::tr(
1945 "MythTV wants to record these programs in %d seconds:");
1949 bool has_rec =
false;
1953 if (!(*it).is_conflicting)
1956 QString title = (*it).info->GetTitle();
1957 if ((title.length() < 10) && !(*it).info->GetSubtitle().isEmpty())
1958 title +=
": " + (*it).info->GetSubtitle();
1959 if (title.length() > 20)
1960 title = title.left(17) +
"...";
1964 .replace(
"<num>", (*it).info->GetChanNum())
1965 .replace(
"<sign>", (*it).info->GetChannelSchedulingID())
1966 .replace(
"<name>", (*it).info->GetChannelName());
1968 if (conflict_count > 1)
1970 message += QObject::tr(
"\"%1\" on %2").arg(title).arg(channel);
1975 message = single_rec.arg((*it).info->GetTitle()).arg(channel);
1976 has_rec = (*it).has_rec;
1980 if (conflict_count > 1)
1983 message += QObject::tr(
"Do you want to:");
1986 bool all_have_later =
true;
1987 timeuntil = 9999999;
1991 if ((*it).is_conflicting)
1993 all_have_later &= (*it).has_later;
1996 timeuntil = min(timeuntil, max(tmp, 0));
1999 timeuntil = (9999999 == timeuntil) ? 0 : timeuntil;
2001 OSD *osd = GetOSDLock(ctx);
2002 if (osd && conflict_count > 1)
2005 osd->
DialogShow(OSD_DLG_ASKALLOW, message, timeuntil);
2008 osd->
DialogAddButton((all_have_later) ? record_laterm : do_not_recordm,
2009 "DIALOG_ASKALLOW_CANCELCONFLICTING_0");
2014 osd->
DialogShow(OSD_DLG_ASKALLOW, message, timeuntil);
2017 osd->
DialogAddButton((all_have_later) ? record_later1 : do_not_record1,
2018 "DIALOG_ASKALLOW_CANCELRECORDING_0",
2032 LOG(VB_GENERAL, LOG_ERR,
"allowrecordingbox : askAllowLock is locked");
2036 if (action ==
"CANCELRECORDING")
2041 else if (action ==
"CANCELCONFLICTING")
2043 QMap<QString,AskProgramInfo>::iterator it =
2047 if ((*it).is_conflicting)
2051 else if (action ==
"WATCH")
2126 #define TRANSITION(ASTATE,BSTATE) \
2127 ((ctxState == ASTATE) && (desiredNextState == BSTATE))
2129 #define SET_NEXT() do { nextState = desiredNextState; changed = true; } while(0)
2130 #define SET_LAST() do { nextState = ctxState; changed = true; } while(0)
2134 QByteArray msg_arr = msg.toLatin1();
2135 QString msg_i18n = QObject::tr(msg_arr.constData());
2136 QByteArray msg_i18n_arr = msg_i18n.toLatin1();
2137 return (msg_arr == msg_i18n_arr) ? msg_i18n : msg;
2150 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"HandleStateChange(%1) -- begin")
2155 LOG(VB_GENERAL, LOG_ERR,
LOC +
2156 "HandleStateChange(): Called after fatal error detected.");
2160 bool changed =
false;
2166 LOG(VB_GENERAL, LOG_WARNING,
LOC +
2167 "HandleStateChange() Warning, called with no state to change to.");
2175 LOG(VB_GENERAL, LOG_INFO,
LOC +
2176 QString(
"Attempting to change from %1 to %2")
2182 LOG(VB_GENERAL, LOG_ERR,
LOC +
"HandleStateChange(): "
2183 "Attempting to set to an error state!");
2212 QStringList reclist;
2215 query.
prepare(
"SELECT channum FROM channel "
2216 "WHERE chanid = :CHANID");
2219 channum = query.
value(0).toString();
2221 channum = QString::number(chanid);
2224 QString::number(chanid));
2232 vector<uint> excluded_cardids;
2245 LOG(VB_GENERAL, LOG_NOTICE,
LOC +
"Spawning LiveTV Recorder -- begin");
2247 if (chanid && !channum.isEmpty())
2252 LOG(VB_GENERAL, LOG_NOTICE,
LOC +
"Spawning LiveTV Recorder -- end");
2256 LOG(VB_GENERAL, LOG_ERR,
LOC +
2257 "HandleStateChange(): LiveTV not successfully started");
2271 LOG(VB_GENERAL, LOG_INFO,
LOC +
2272 QString(
"playbackURL(%1) cardtype(%2)")
2277 playbackURL,
false,
true,
2290 LOG(VB_GENERAL, LOG_ERR,
LOC +
"LiveTV not successfully started");
2296 else if (!ctx->
IsPIP())
2315 if ((mctx != ctx) && (GetPlayer(ctx,-1) == ctx))
2348 LOG(VB_GENERAL, LOG_ERR,
LOC +
2349 "Couldn't find recorder for in-progress recording");
2368 QString message =
"COMMFLAG_REQUEST ";
2381 else if (mctx != ctx)
2395 StopStuff(mctx, ctx,
true,
true,
false);
2397 if ((mctx != ctx) && (GetPlayer(ctx,-1) == ctx))
2408 LOG(VB_GENERAL, LOG_ERR,
LOC +
2409 QString(
"Unknown state transition: %1 to %2")
2413 else if (ctx->
GetState() != nextState)
2415 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Changing from %1 to %2")
2429 LOG(VB_GENERAL, LOG_INFO,
LOC +
"State is LiveTV & mctx == ctx");
2431 LOG(VB_GENERAL, LOG_INFO,
LOC +
"UpdateOSDInput done");
2433 LOG(VB_GENERAL, LOG_INFO,
LOC +
"UpdateLCD done");
2435 LOG(VB_GENERAL, LOG_INFO,
LOC +
"ITVRestart done");
2441 QString msg = tr(
"%1 Settings")
2445 SetOSDMessage(ctx, msg);
2491 mainWindow->setMinimumSize(
2493 mainWindow->setMaximumSize(
2495 QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
2508 LOG(VB_GENERAL, LOG_INFO,
LOC +
"Main UI disabled.");
2511 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
2512 QString(
"HandleStateChange(%1) -- end")
2527 maxWait = (maxWait <= 0) ? 40000 : maxWait;
2530 bool recording =
false, ok =
true;
2532 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Invalid Remote Encoder");
2541 LOG(VB_GENERAL, LOG_ERR,
LOC +
"StartRecorder() -- "
2542 "lost contact with backend");
2552 LOG(VB_GENERAL, LOG_ERR,
LOC +
"StartRecorder() -- "
2553 "timed out waiting for recorder to start");
2557 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
2558 QString(
"StartRecorder(): took %1 ms to start recorder.")
2578 bool stopRingBuffer,
bool stopPlayer,
bool stopRecorder)
2580 LOG(VB_PLAYBACK, LOG_INFO,
2581 LOC + QString(
"StopStuff() for player ctx %1 -- begin")
2596 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"StopStuff(): stopping ring buffer");
2607 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"StopStuff(): stopping player");
2610 for (
uint i = 1; mctx && (i <
player.size()); i++)
2611 StopStuff(mctx, GetPlayer(mctx,i),
true,
true,
true);
2617 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"StopStuff(): stopping recorder");
2622 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"StopStuff() -- end");
2629 QString loc =
LOC + QString(
"TeardownPlayer() player ctx %1")
2632 if (!mctx || !ctx || ctx_index < 0)
2634 LOG(VB_GENERAL, LOG_ERR, loc +
"-- error");
2638 LOG(VB_PLAYBACK, LOG_INFO, loc);
2661 const int timer_id = te->timerId();
2671 bool ignore =
false;
2681 bool handled =
true;
2732 while (still_exists && !ctx->
nextState.empty())
2742 still_exists =
false;
2813 QString netCmd = QString::null;
2828 if (!netCmd.isEmpty())
2844 OSD *osd = GetOSDLock(mctx);
2856 SetOSDMessage(mctx, tr(
"Last Program: %1 Doesn't Exist")
2860 LOG(VB_PLAYBACK, LOG_ERR,
LOC +
2861 "Last Program File does not exist");
2963 OSD *osd = GetOSDLock(actx);
2995 bool update =
false;
2997 OSD *osd = GetOSDLock(actx);
3022 OSD *osd = GetOSDLock(actx);
3056 LOG(VB_GENERAL, LOG_EMERG,
LOC +
3057 QString(
"Serious hardware decoder error detected. "
3058 "Disabling hardware decoders."));
3061 player[i]->SetNoHardwareDecoders();
3093 QString cmd = QString::null;
3110 if (cmd ==
"TOGGLEPIPMODE")
3112 else if (cmd ==
"TOGGLEPBPMODE")
3114 else if (cmd ==
"CREATEPIPVIEW")
3116 else if (cmd ==
"CREATEPBPVIEW")
3118 else if (cmd ==
"SWAPPIP")
3122 else if (mctx &&
player.size() == 2)
3123 PxPSwap(mctx, GetPlayer(mctx,1));
3125 else if (cmd ==
"TOGGLEPIPSTATE")
3150 QString lcd_time_string;
3151 bool showProgress =
true;
3166 progress = info.
values[
"position"] * 0.001f;
3168 lcd_time_string = info.
text[
"playedtime"] +
" / " + info.
text[
"totaltime"];
3171 lcd_time_string.remove(
' ');
3202 int x = QObject::startTimer(interval);
3205 LOG(VB_GENERAL, LOG_ERR,
LOC +
3206 QString(
"Failed to start timer on line %1 of %2")
3207 .arg(line).arg(__FILE__));
3214 QObject::killTimer(
id);
3242 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Switching to program: %1")
3312 bool is_playing =
false;
3314 for (
uint i = 0; mctx && (i <
player.size()); i++)
3374 OSD *osd = GetOSDLock(mctx);
3408 OSD *osd = GetOSDLock(mctx);
3435 bool restartTimer =
false;
3437 for (
uint i = 0; mctx && (i <
player.size()); i++)
3445 restartTimer =
true;
3449 LOG(VB_CHANNEL, LOG_INFO,
3450 QString(
"REC_PROGRAM -- channel change %1").arg(i));
3488 bool update_msg =
false;
3490 for (
uint i = 0; actx && (i <
player.size()); i++)
3498 for (
uint i = 0; actx && (i <
player.size()); i++)
3504 if (actx && update_msg)
3515 if ((e->type() == QEvent::Resize))
3520 if (QEvent::KeyPress == e->type())
3535 case QEvent::UpdateRequest:
3549 if (QEvent::Resize == e->type())
3560 if (QEvent::KeyPress == e->type())
3562 bool handled =
false;
3574 case QEvent::UpdateRequest:
3582 return QObject::event(e);
3594 bool handled =
true;
3596 if (action == ACTION_TOGGLEEXTTEXT)
3598 else if (ACTION_ENABLEEXTTEXT == action)
3600 else if (ACTION_DISABLEEXTTEXT == action)
3602 else if (ACTION_ENABLEFORCEDSUBS == action)
3604 else if (ACTION_DISABLEFORCEDSUBS == action)
3606 else if (action == ACTION_ENABLESUBS)
3608 else if (action == ACTION_DISABLESUBS)
3620 max(min(page - 1, 1), 0));
3652 else if (action.left(6) ==
"TOGGLE")
3662 else if (action.left(6) ==
"SELECT")
3665 int num = action.section(
"_", -1).toInt();
3671 else if (action.left(4) ==
"NEXT" || action.left(4) ==
"PREV")
3673 int dir = (action.left(4) ==
"NEXT") ? +1 : -1;
3677 else if (action.right(2) ==
"CC")
3692 QStringList::const_iterator it;
3693 for (it = actions.begin(); it != actions.end(); ++it)
3705 LOG(VB_GENERAL, LOG_DEBUG,
LOC + QString(
"ProcessKeypress() ignoreKeys: %1")
3707 #endif // DEBUG_ACTIONS
3715 QStringList actions;
3716 bool handled =
false;
3721 "TV Playback", e, actions);
3723 if (handled || actions.isEmpty())
3728 bool pause =
has_action(ACTION_PAUSE, actions);
3729 bool play =
has_action(ACTION_PLAY, actions);
3735 OSD *osd = GetOSDLock(actx);
3746 "TV Editing", e, actions);
3748 if (!handled && actx->
player)
3781 actions, current_frame);
3793 const QString txt = e->text();
3798 if (ok || txt==
"_" || txt==
"-" || txt==
"#" || txt==
".")
3809 QStringList tt_actions;
3811 "Teletext Menu", e, tt_actions);
3813 if (!handled && !tt_actions.isEmpty())
3815 for (
int i = 0; i < tt_actions.size(); i++)
3829 QStringList itv_actions;
3831 "TV Playback", e, itv_actions);
3833 if (!handled && !itv_actions.isEmpty())
3835 for (
int i = 0; i < itv_actions.size(); i++)
3848 "TV Playback", e, actions);
3850 if (handled || actions.isEmpty())
3867 actx, actions, isDVD, isMenuOrStill);
3874 for (
uint i = 0; i < actions.size(); ++i)
3875 LOG(VB_GENERAL, LOG_DEBUG,
LOC + QString(
"handled(%1) actions[%2](%3)")
3876 .arg(handled).arg(i).arg(actions[i]));
3877 #endif // DEBUG_ACTIONS
3884 for (
int i = 0; i < actions.size() && !handled; i++)
3886 QString
action = actions[i];
3888 int val = action.toInt(&ok);
3906 bool handled =
true;
3922 else if (
has_action(ACTION_CLEAROSD, actions) ||
3929 else if (
has_action(ACTION_TOGGLERECORD, actions))
3934 QStringList::const_iterator it = actions.begin();
3935 for (; it != actions.end(); ++it)
3937 if ((*it).length() == 1 && (*it)[0].isDigit())
3974 bool end_manual_zoom =
false;
3975 bool handled =
true;
3976 bool updateOSD =
true;
3980 else if (
has_action(ACTION_ZOOMDOWN, actions))
3982 else if (
has_action(ACTION_ZOOMLEFT, actions))
3984 else if (
has_action(ACTION_ZOOMRIGHT, actions))
3986 else if (
has_action(ACTION_ZOOMASPECTUP, actions))
3988 else if (
has_action(ACTION_ZOOMASPECTDOWN, actions))
3992 else if (
has_action(ACTION_ZOOMOUT, actions))
3994 else if (
has_action(ACTION_ZOOMQUIT, actions))
3997 end_manual_zoom =
true;
3999 else if (
has_action(ACTION_ZOOMCOMMIT, actions))
4001 end_manual_zoom =
true;
4018 else if (
has_action(ACTION_VOLUMEUP, actions))
4020 else if (
has_action(ACTION_VOLUMEDOWN, actions))
4026 end_manual_zoom =
true;
4030 end_manual_zoom =
true;
4033 else if (
has_action(ACTION_JUMPFFWD, actions))
4035 else if (
has_action(ACTION_JUMPRWND, actions))
4041 handled = !(
has_action(
"STRETCHINC", actions) ||
4048 QString msg = tr(
"Zoom Committed");
4052 if (end_manual_zoom)
4053 msg = tr(
"Zoom Ignored");
4057 else if (end_manual_zoom)
4058 msg = tr(
"%1 Committed")
4069 const QStringList &actions)
4074 bool handled =
true;
4092 const QStringList &actions)
4097 bool handled =
true;
4107 else if (
has_action(
"ADJUSTSTRETCH", actions))
4118 const QStringList &actions)
4123 bool handled =
true;
4133 else if (
has_action(ACTION_TOGGELAUDIOSYNC, actions))
4142 const QStringList &actions)
4147 bool handled =
true;
4157 else if (
has_action(ACTION_TOGGLESUBTITLEZOOM, actions))
4166 const QStringList &actions)
4171 bool handled =
true;
4181 else if (
has_action(ACTION_TOGGLESUBTITLEDELAY, actions))
4199 pts = (int64_t)(frame->
timecode * 90);
4212 if (ACTION_3DSIDEBYSIDE == action)
4214 else if (ACTION_3DSIDEBYSIDEDISCARD == action)
4216 else if (ACTION_3DTOPANDBOTTOM == action)
4218 else if (ACTION_3DTOPANDBOTTOMDISCARD == action)
4228 const QStringList &actions,
4229 bool isDVD,
bool isDVDStill)
4231 bool handled =
true;
4233 if (
has_action(
"SKIPCOMMERCIAL", actions) && !isDVD)
4235 else if (
has_action(
"SKIPCOMMBACK", actions) && !isDVD)
4237 else if (
has_action(
"QUEUETRANSCODE", actions) && !isDVD)
4239 else if (
has_action(
"QUEUETRANSCODE_AUTO", actions) && !isDVD)
4241 else if (
has_action(
"QUEUETRANSCODE_HIGH", actions) && !isDVD)
4243 else if (
has_action(
"QUEUETRANSCODE_MEDIUM", actions) && !isDVD)
4245 else if (
has_action(
"QUEUETRANSCODE_LOW", actions) && !isDVD)
4251 else if (
has_action(
"SPEEDINC", actions) && !isDVDStill)
4253 else if (
has_action(
"SPEEDDEC", actions) && !isDVDStill)
4255 else if (
has_action(
"ADJUSTSTRETCH", actions))
4257 else if (
has_action(
"CYCLECOMMSKIPMODE",actions) && !isDVD)
4261 QString msg = QString::null;
4271 SetOSDMessage(ctx, msg);
4273 else if (
has_action(ACTION_SEEKARB, actions) && !isDVD)
4278 SetOSDText(ctx,
"osd_input",
"osd_number_entry", tr(
"Seek:"),
4305 else if (
has_action(ACTION_JUMPRWND, actions))
4307 else if (
has_action(ACTION_JUMPFFWD, actions))
4309 else if (
has_action(ACTION_JUMPBKMRK, actions))
4323 else if (
has_action(ACTION_JUMPSTART,actions))
4325 DoSeek(ctx, 0, tr(
"Jump to Beginning"),
4329 else if (
has_action(ACTION_CLEAROSD, actions))
4333 else if (
has_action(ACTION_VIEWSCHEDULED, actions))
4338 else if (
has_action(ACTION_SIGNALMON, actions))
4345 if (timeout == 0xffffffff)
4347 SetOSDMessage(ctx,
"No Signal Monitor");
4362 else if (
has_action(ACTION_SCREENSHOT, actions))
4380 else if (
has_action(ACTION_EXITSHOWNOPROMPTS, actions))
4397 OSD *osd = GetOSDLock(ctx);
4411 bool do_exit =
false;
4466 else if (
has_action(ACTION_ENABLEUPMIX, actions))
4468 else if (
has_action(ACTION_DISABLEUPMIX, actions))
4470 else if (
has_action(ACTION_VOLUMEDOWN, actions))
4472 else if (
has_action(ACTION_VOLUMEUP, actions))
4474 else if (
has_action(
"CYCLEAUDIOCHAN", actions))
4476 else if (
has_action(ACTION_MUTEAUDIO, actions))
4495 else if (
has_action(ACTION_TOGGLEOSDDEBUG, actions))
4503 QStringList::const_iterator it = actions.begin();
4504 for (; it != actions.end() && !handled; ++it)
4513 bool handled =
false;
4517 for (
int i = 0; i < actions.size() && !handled; i++)
4519 QString
action = actions[i];
4521 int val = action.toInt(&ok);
4549 const QStringList &actions,
bool isDVD)
4551 bool handled =
true;
4558 else if (
has_action(ACTION_TOGGELAUDIOSYNC, actions))
4560 else if (
has_action(ACTION_TOGGLESUBTITLEZOOM, actions))
4562 else if (
has_action(ACTION_TOGGLESUBTITLEDELAY, actions))
4564 else if (
has_action(ACTION_TOGGLEVISUALISATION, actions))
4566 else if (
has_action(ACTION_ENABLEVISUALISATION, actions))
4568 else if (
has_action(ACTION_DISABLEVISUALISATION, actions))
4570 else if (
has_action(
"TOGGLEPICCONTROLS", actions))
4572 else if (
has_action(ACTION_TOGGLESTUDIOLEVELS, actions))
4574 else if (
has_action(ACTION_TOGGLENIGHTMODE, actions))
4576 else if (
has_action(
"TOGGLESTRETCH", actions))
4578 else if (
has_action(ACTION_TOGGLEUPMIX, actions))
4580 else if (
has_action(ACTION_TOGGLESLEEP, actions))
4582 else if (
has_action(ACTION_TOGGLERECORD, actions) && islivetv)
4584 else if (
has_action(ACTION_TOGGLEFAV, actions) && islivetv)
4586 else if (
has_action(ACTION_TOGGLECHANCONTROLS, actions) && islivetv)
4588 else if (
has_action(ACTION_TOGGLERECCONTROLS, actions) && islivetv)
4590 else if (
has_action(ACTION_TOGGLEINPUTS, actions) &&
4595 else if (
has_action(
"TOGGLEBROWSE", actions))
4618 bool toggle,
const QString &
action)
4620 QString visualiser = QString(
"");
4621 if (action.startsWith(
"VISUALISER"))
4622 visualiser = action.mid(11);
4627 bool want = enable || !visualiser.isEmpty();
4628 if (toggle && visualiser.isEmpty())
4632 tr(
"Visualisation Off"));
4642 bool handled =
true;
4648 else if (
has_action(
"TOGGLEPBPMODE", actions))
4650 else if (
has_action(
"CREATEPIPVIEW", actions))
4652 else if (
has_action(
"CREATEPBPVIEW", actions))
4656 else if (
has_action(
"TOGGLEPIPSTATE", actions))
4682 SetOSDMessage(ctx, QObject::tr(
"Bookmark Cleared"));
4689 info.
text[
"title"] = QObject::tr(
"Position");
4692 SetOSDMessage(ctx, QObject::tr(
"Bookmark Saved"));
4700 bool handled =
true;
4715 else if (
has_action(
"NEXTFAV", actions) && islivetv)
4717 else if (
has_action(
"NEXTSOURCE", actions) && islivetv)
4719 else if (
has_action(
"PREVSOURCE", actions) && islivetv)
4721 else if (
has_action(
"NEXTINPUT", actions) && islivetv)
4723 else if (
has_action(
"NEXTCARD", actions) && islivetv)
4727 else if (
has_action(
"PREVCHAN", actions) && islivetv)
4729 else if (
has_action(ACTION_CHANNELUP, actions))
4741 else if (
has_action(ACTION_CHANNELDOWN, actions))
4753 else if (
has_action(
"DELETE", actions) && !islivetv)
4760 else if (
has_action(ACTION_JUMPTODVDROOTMENU, actions) && isdisc)
4767 else if (
has_action(ACTION_JUMPTOPOPUPMENU, actions) && isdisc)
4784 const QString &command)
4787 #ifdef DEBUG_ACTIONS
4788 LOG(VB_GENERAL, LOG_DEBUG,
LOC +
"ProcessNetworkControlCommand(" +
4789 QString(
"%1) ignoreKeys: %2").arg(command).arg(ignoreKeys));
4794 LOG(VB_GENERAL, LOG_WARNING,
LOC +
4795 "Ignoring network control command"
4796 "\n\t\t\tbecause ignoreKeys is set");
4800 QStringList tokens = command.split(
" ", QString::SkipEmptyParts);
4801 if (tokens.size() < 2)
4803 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Not enough tokens"
4804 "in network control command" +
"\n\t\t\t" +
4805 QString(
"'%1'").arg(command));
4809 OSD *osd = GetOSDLock(ctx);
4817 LOG(VB_GENERAL, LOG_WARNING,
LOC +
4818 "Ignoring network control command\n\t\t\t" +
4819 QString(
"because dialog is waiting for a response"));
4823 if (tokens[1] !=
"QUERY")
4826 if (tokens.size() == 3 && tokens[1] ==
"CHANID")
4832 else if (tokens.size() == 3 && tokens[1] ==
"CHANNEL")
4836 if (tokens[2] ==
"UP")
4838 else if (tokens[2] ==
"DOWN")
4840 else if (tokens[2].contains(QRegExp(
"^[-\\.\\d_#]+$")))
4844 else if (tokens.size() == 3 && tokens[1] ==
"SPEED")
4848 if (tokens[2] ==
"0x")
4857 float tmpSpeed = 1.0f;
4860 if (tokens[2].contains(QRegExp(
"^\\-*\\d+x$")))
4862 QString speed = tokens[2].left(tokens[2].
length()-1);
4863 tmpSpeed = speed.toFloat(&ok);
4865 else if (tokens[2].contains(QRegExp(
"^\\-*\\d*\\.\\d+x$")))
4867 QString speed = tokens[2].left(tokens[2].
length() - 1);
4868 tmpSpeed = speed.toFloat(&ok);
4872 QRegExp re = QRegExp(
"^(\\-*\\d+)\\/(\\d+)x$");
4873 if (tokens[2].contains(re))
4875 QStringList matches = re.capturedTexts();
4877 int numerator, denominator;
4878 numerator = matches[1].toInt(&ok);
4879 denominator = matches[2].toInt(&ok);
4881 if (ok && denominator != 0)
4882 tmpSpeed =
static_cast<float>(numerator) /
4883 static_cast<float>(denominator);
4891 float searchSpeed = fabs(tmpSpeed);
4897 if (tmpSpeed == 0.0f)
4905 else if (tmpSpeed == 1.0f)
4926 else if (tmpSpeed > 1)
4934 else if (0.48 <= tmpSpeed && tmpSpeed <= 2.0) {
4942 LOG(VB_GENERAL, LOG_WARNING,
4943 QString(
"Couldn't find %1 speed. Setting Speed to 1x")
4952 LOG(VB_GENERAL, LOG_ERR,
4953 QString(
"Found an unknown speed of %1").arg(tokens[2]));
4957 else if (tokens.size() == 2 && tokens[1] ==
"STOP")
4966 else if (tokens.size() >= 3 && tokens[1] ==
"SEEK" && ctx->
HasPlayer())
4971 if (tokens[2] ==
"BEGINNING")
4972 DoSeek(ctx, 0, tr(
"Jump to Beginning"),
4975 else if (tokens[2] ==
"FORWARD")
4979 else if (tokens[2] ==
"BACKWARD")
4983 else if ((tokens[2] ==
"POSITION" ||
4984 tokens[2] ==
"POSITIONWITHCUTLIST") &&
4985 (tokens.size() == 4) &&
4986 (tokens[3].contains(QRegExp(
"^\\d+$"))))
4989 tokens[2] ==
"POSITIONWITHCUTLIST");
4992 else if (tokens.size() >= 3 && tokens[1] ==
"SUBTITLES")
4995 uint track = tokens[2].toUInt(&ok);
5008 uint finish = start + subs.size();
5009 if (track >= start && track < finish)
5018 finish = start + subs.size();
5019 if (track >= start && track < finish)
5028 finish = start + subs.size();
5029 if (track >= start && track < finish)
5038 finish = start + subs.size();
5039 if (track >= start && track < finish)
5048 finish = start + subs.size();
5049 if (track >= start && track < finish)
5058 finish = start + subs.size();
5059 if (track >= start && track < finish)
5067 else if (tokens.size() >= 3 && tokens[1] ==
"VOLUME")
5069 QRegExp re = QRegExp(
"(\\d+)%");
5070 if (tokens[2].contains(re))
5072 QStringList matches = re.capturedTexts();
5074 LOG(VB_GENERAL, LOG_INFO, QString(
"Set Volume to %1%")
5079 int vol = matches[1].toInt(&ok);
5084 if (0 <= vol && vol <= 100)
5100 ctx, tr(
"Adjust Volume"), tr(
"Volume"),
5101 QString::number(vol),
5109 else if (tokens.size() >= 3 && tokens[1] ==
"QUERY")
5111 if (tokens[2] ==
"POSITION")
5124 QRegExp re = QRegExp(
"Play (.*)x");
5127 QStringList matches = re.capturedTexts();
5128 speedStr = QString(
"%1x").arg(matches[1]);
5140 QString infoStr =
"";
5143 long long fplay = 0;
5164 infoStr =
"Recorded";
5172 if ((infoStr ==
"Recorded") || (infoStr ==
"LiveTV"))
5174 infoStr += QString(
" %1 %2 %3 %4 %5 %6 %7")
5175 .arg(info.
text[
"description"])
5186 QString position = info.
text[
"description"].section(
" ",0,0);
5187 infoStr += QString(
" %1 %2 %3 %4 %5")
5195 infoStr += QString(
" Subtitles:");
5200 infoStr += QString(
" *0:[None]*");
5202 infoStr += QString(
" 0:[None]");
5207 for (
uint i = 0; i < (
uint)subs.size(); i++)
5212 infoStr += QString(
" *%1:[%2]*").arg(n).arg(subs[i]);
5216 infoStr += QString(
" %1:[%2]").arg(n).arg(subs[i]);
5222 for (
uint i = 0; i < (
uint)subs.size(); i++)
5227 infoStr += QString(
" *%1:[%2]*").arg(n).arg(subs[i]);
5231 infoStr += QString(
" %1:[%2]").arg(n).arg(subs[i]);
5237 for (
uint i = 0; i < (
uint)subs.size(); i++)
5242 infoStr += QString(
" *%1:[%2]*").arg(n).arg(subs[i]);
5246 infoStr += QString(
" %1:[%2]").arg(n).arg(subs[i]);
5252 for (
uint i = 0; i < (
uint)subs.size(); i++)
5257 infoStr += QString(
" *%1:[%2]*").arg(n).arg(subs[i]);
5261 infoStr += QString(
" %1:[%2]").arg(n).arg(subs[i]);
5267 for (
uint i = 0; i < (
uint)subs.size(); i++)
5272 infoStr += QString(
" *%1:[%2]*").arg(n).arg(subs[i]);
5276 infoStr += QString(
" %1:[%2]").arg(n).arg(subs[i]);
5282 for (
uint i = 0; i < (
uint)subs.size(); i++)
5287 infoStr += QString(
" *%1:[%2]*").arg(n).arg(subs[i]);
5291 infoStr += QString(
" %1:[%2]").arg(n).arg(subs[i]);
5298 QString message = QString(
"NETWORK_CONTROL ANSWER %1")
5303 else if (tokens[2] ==
"VOLUME")
5307 QString message = QString(
"NETWORK_CONTROL ANSWER %1")
5321 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"CreatePBP() -- begin");
5325 LOG(VB_GENERAL, LOG_ERR,
LOC +
"CreatePBP() -- end : "
5326 "only allowed when player.size() == 1");
5333 LOG(VB_GENERAL, LOG_ERR,
LOC +
"CreatePBP() -- end : "
5334 "PBP not supported by video method.");
5390 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Failed to restart new main context");
5398 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
5399 QString(
"CreatePBP() -- end : %1").arg(ok));
5413 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
"CreatePIP -- begin");
5417 LOG(VB_GENERAL, LOG_ERR,
LOC +
5418 "CreatePIP called, but we're in PBP mode already, ignoring.");
5424 LOG(VB_GENERAL, LOG_ERR,
LOC +
"PiP not supported by video method.");
5451 player.push_back(pipctx);
5459 if (GetPlayer(ctx, i) == ctx)
5467 bool wantPiP = ctx->
IsPIP();
5469 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"StartPlayer(%1, %2, %3) -- begin")
5471 .arg((wantPiP) ?
"PiP" :
"main"));
5473 LOG(VB_PLAYBACK, LOG_INFO,
LOC +
5474 QString(
"Elapsed time since TV constructor was called: %1 ms")
5483 LOG(VB_GENERAL, LOG_INFO,
"StartPlayer PiP -- end : ok");
5488 LOG(VB_GENERAL, LOG_INFO,