本文整理汇总了C++中CPVRChannelPtr::GetRecording方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRChannelPtr::GetRecording方法的具体用法?C++ CPVRChannelPtr::GetRecording怎么用?C++ CPVRChannelPtr::GetRecording使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRChannelPtr
的用法示例。
在下文中一共展示了CPVRChannelPtr::GetRecording方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PlayFile
bool CGUIWindowPVRBase::PlayFile(CFileItem *item, bool bPlayMinimized /* = false */, bool bCheckResume /* = true */)
{
if (item->m_bIsFolder)
{
return false;
}
CPVRChannelPtr channel = item->HasPVRChannelInfoTag() ? item->GetPVRChannelInfoTag() : CPVRChannelPtr();
if (item->GetPath() == g_application.CurrentFile() ||
(channel && channel->HasRecording() && channel->GetRecording()->GetPath() == g_application.CurrentFile()))
{
CGUIMessage msg(GUI_MSG_FULLSCREEN, 0, GetID());
g_windowManager.SendMessage(msg);
return true;
}
CMediaSettings::GetInstance().SetVideoStartWindowed(bPlayMinimized);
if (item->HasPVRRecordingInfoTag())
{
return PlayRecording(item, bPlayMinimized, bCheckResume);
}
else
{
bool bSwitchSuccessful(false);
CPVRChannelPtr channel(item->GetPVRChannelInfoTag());
if (channel && g_PVRManager.CheckParentalLock(channel))
{
CPVRRecordingPtr recording = channel->GetRecording();
if (recording)
{
CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*) g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (pDialog)
{
pDialog->SetHeading(CVariant{19687}); // Play recording
pDialog->SetLine(0, CVariant{""});
pDialog->SetLine(1, CVariant{12021}); // Start from beginning
pDialog->SetLine(2, CVariant{recording->m_strTitle});
pDialog->Open();
if (pDialog->IsConfirmed())
{
CFileItem recordingItem(recording);
return PlayRecording(&recordingItem, CSettings::GetInstance().GetBool(CSettings::SETTING_PVRPLAYBACK_PLAYMINIMIZED), bCheckResume);
}
}
}
/* try a fast switch */
if ((g_PVRManager.IsPlayingTV() || g_PVRManager.IsPlayingRadio()) &&
(channel->IsRadio() == g_PVRManager.IsPlayingRadio()))
{
if (channel->StreamURL().empty())
bSwitchSuccessful = g_application.m_pPlayer->SwitchChannel(channel);
}
if (!bSwitchSuccessful)
{
CApplicationMessenger::GetInstance().PostMsg(TMSG_MEDIA_PLAY, 0, 0, static_cast<void*>(new CFileItem(*item)));
return true;
}
}
if (!bSwitchSuccessful)
{
std::string channelName = g_localizeStrings.Get(19029); // Channel
if (channel)
channelName = channel->ChannelName();
std::string msg = StringUtils::Format(g_localizeStrings.Get(19035).c_str(), channelName.c_str()); // CHANNELNAME could not be played. Check the log for details.
CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Error,
g_localizeStrings.Get(19166), // PVR information
msg);
return false;
}
}
return true;
}
示例2: SwitchToChannel
bool CPVRGUIActions::SwitchToChannel(const CFileItemPtr &item, bool bPlayMinimized, bool bCheckResume) const
{
if (item->m_bIsFolder)
return false;
const CPVRChannelPtr channel(CPVRItem(item).GetChannel());
if ((channel && g_PVRManager.IsPlayingChannel(channel)) ||
(channel && channel->HasRecording() && g_PVRManager.IsPlayingRecording(channel->GetRecording())))
{
CGUIMessage msg(GUI_MSG_FULLSCREEN, 0, g_windowManager.GetActiveWindow());
g_windowManager.SendMessage(msg);
return true;
}
CMediaSettings::GetInstance().SetVideoStartWindowed(bPlayMinimized);
// switch to channel or if recording present, ask whether to switch or play recording...
bool bSwitchSuccessful(false);
if (channel && g_PVRManager.CheckParentalLock(channel))
{
const CPVRRecordingPtr recording(channel->GetRecording());
if (recording)
{
bool bCancel(false);
bool bPlayRecording = CGUIDialogYesNo::ShowAndGetInput(CVariant{19687}, // "Play recording"
CVariant{""},
CVariant{12021}, // "Play from beginning"
CVariant{recording->m_strTitle},
bCancel,
CVariant{19000}, // "Switch to channel"
CVariant{19687}, // "Play recording"
0); // no autoclose
if (bCancel)
return false;
if (bPlayRecording)
{
const CFileItemPtr recordingItem(new CFileItem(recording));
return PlayRecording(recordingItem, CServiceBroker::GetSettings().GetBool(CSettings::SETTING_PVRPLAYBACK_PLAYMINIMIZED), bCheckResume);
}
}
/* try a fast switch */
if ((g_PVRManager.IsPlayingTV() || g_PVRManager.IsPlayingRadio()) &&
(channel->IsRadio() == g_PVRManager.IsPlayingRadio()))
{
if (channel->StreamURL().empty())
bSwitchSuccessful = g_application.m_pPlayer->SwitchChannel(channel);
}
if (!bSwitchSuccessful)
{
CApplicationMessenger::GetInstance().PostMsg(TMSG_MEDIA_PLAY, 0, 0, static_cast<void*>(new CFileItem(channel)));
return true;
}
}
if (!bSwitchSuccessful)
{
std::string channelName = g_localizeStrings.Get(19029); // Channel
if (channel)
channelName = channel->ChannelName();
std::string msg = StringUtils::Format(g_localizeStrings.Get(19035).c_str(), channelName.c_str()); // CHANNELNAME could not be played. Check the log for details.
CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Error, g_localizeStrings.Get(19166), msg); // PVR information
return false;
}
return true;
}