bool CGUIDialogPVRGuideInfo::OnClickButtonRecord(CGUIMessage &message) { bool bReturn = false; if (message.GetSenderId() == CONTROL_BTN_RECORD) { bReturn = true; const CEpgInfoTagPtr tag(m_progItem->GetEPGInfoTag()); if (!tag || !tag->HasPVRChannel()) { /* invalid channel */ CGUIDialogOK::ShowAndGetInput(CVariant{19033}, CVariant{19067}); Close(); return bReturn; } CFileItemPtr timerTag = g_PVRTimers->GetTimerForEpgTag(m_progItem.get()); bool bHasTimer = timerTag != NULL && timerTag->HasPVRTimerInfoTag(); if (!bHasTimer) ActionStartTimer(tag); else ActionCancelTimer(timerTag); } return bReturn; }
bool CGUIWindowPVRBase::StopRecordFile(const CFileItem &item) { if (!item.HasEPGInfoTag()) return false; const CEpgInfoTagPtr tag(item.GetEPGInfoTag()); if (!tag || !tag->HasPVRChannel()) return false; CFileItemPtr timer = g_PVRTimers->GetTimerForEpgTag(&item); if (!timer || !timer->HasPVRTimerInfoTag() || timer->GetPVRTimerInfoTag()->m_bIsRepeating) return false; return g_PVRTimers->DeleteTimer(*timer); }
bool CGUIWindowPVRBase::StopRecordFile(CFileItem *item) { if (!item->HasEPGInfoTag()) return false; const CEpgInfoTagPtr tag(item->GetEPGInfoTag()); if (!tag || !tag->HasPVRChannel()) return false; CFileItemPtr timer = g_PVRTimers->GetTimerForEpgTag(item); if (!timer || !timer->HasPVRTimerInfoTag()) return false; bool bDeleteScheduled(false); if (ConfirmDeleteTimer(timer.get(), bDeleteScheduled)) return g_PVRTimers->DeleteTimer(*timer, false, bDeleteScheduled); return false; }
void CGUIWindowPVRGuide::OnInputDone() { const int iChannelNumber = GetChannelNumber(); if (iChannelNumber >= 0) { for (const CFileItemPtr event : m_vecItems->GetList()) { const CEpgInfoTagPtr tag(event->GetEPGInfoTag()); if (tag->HasPVRChannel() && tag->PVRChannelNumber() == iChannelNumber) { CGUIEPGGridContainer* epgGridContainer = dynamic_cast<CGUIEPGGridContainer*>(GetControl(m_viewControl.GetCurrentControl())); if (epgGridContainer) { epgGridContainer->SetChannel(tag->ChannelTag()); return; } } } } }
void CGUIWindowPVRBase::ShowEPGInfo(CFileItem *item) { CEpgInfoTagPtr epgTag; CPVRChannelPtr channel; if (item->IsEPG()) { epgTag = item->GetEPGInfoTag(); channel = epgTag->ChannelTag(); } else if (item->IsPVRChannel()) { channel = item->GetPVRChannelInfoTag(); epgTag = channel->GetEPGNow(); } else if (item->IsPVRTimer()) { epgTag = item->GetPVRTimerInfoTag()->GetEpgInfoTag(); if (epgTag && epgTag->HasPVRChannel()) channel = epgTag->ChannelTag(); } if (channel && !g_PVRManager.CheckParentalLock(channel)) return; if (!epgTag) { CLog::Log(LOGERROR, "CGUIWindowPVRBase - %s - no epg tag!", __FUNCTION__); return; } CGUIDialogPVRGuideInfo* pDlgInfo = (CGUIDialogPVRGuideInfo*)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_GUIDE_INFO); if (!pDlgInfo) { CLog::Log(LOGERROR, "CGUIWindowPVRBase - %s - unable to get WINDOW_DIALOG_PVR_GUIDE_INFO!", __FUNCTION__); return; } pDlgInfo->SetProgInfo(epgTag); pDlgInfo->Open(); }
bool CGUIDialogPVRGuideInfo::OnClickButtonFind(CGUIMessage &message) { bool bReturn = false; if (message.GetSenderId() == CONTROL_BTN_FIND) { const CEpgInfoTagPtr tag(m_progItem->GetEPGInfoTag()); if (tag && tag->HasPVRChannel()) { int windowSearchId = tag->ChannelTag()->IsRadio() ? WINDOW_RADIO_SEARCH : WINDOW_TV_SEARCH; CGUIWindowPVRBase *windowSearch = (CGUIWindowPVRBase*) g_windowManager.GetWindow(windowSearchId); if (windowSearch) { Close(); g_windowManager.ActivateWindow(windowSearchId); bReturn = windowSearch->OnContextButton(*m_progItem.get(), CONTEXT_BUTTON_FIND); } } } return bReturn; }