本文整理汇总了C++中CPVRChannel::SetEPGScraper方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRChannel::SetEPGScraper方法的具体用法?C++ CPVRChannel::SetEPGScraper怎么用?C++ CPVRChannel::SetEPGScraper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRChannel
的用法示例。
在下文中一共展示了CPVRChannel::SetEPGScraper方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateChannel
bool CPVRChannelGroup::UpdateChannel(const CFileItem &item, bool bHidden, bool bVirtual, bool bEPGEnabled, bool bParentalLocked, int iEPGSource, int iChannelNumber, const CStdString &strChannelName, const CStdString &strIconPath, const CStdString &strStreamURL)
{
if (!item.HasPVRChannelInfoTag())
return false;
CSingleLock lock(m_critSection);
/* get the real channel from the group */
CPVRChannel *channel = GetByUniqueID(item.GetPVRChannelInfoTag()->UniqueID());
if (!channel)
return false;
channel->SetChannelName(strChannelName);
channel->SetHidden(bHidden);
channel->SetLocked(bParentalLocked);
channel->SetIconPath(strIconPath);
if (bVirtual)
channel->SetStreamURL(strStreamURL);
if (iEPGSource == 0)
channel->SetEPGScraper("client");
// TODO add other scrapers
channel->SetEPGEnabled(bEPGEnabled);
/* set new values in the channel tag */
if (bHidden)
{
SortByChannelNumber(); // or previous changes will be overwritten
RemoveFromGroup(*channel);
}
else
{
SetChannelNumber(*channel, iChannelNumber);
}
return true;
}
示例2: SaveList
void CGUIDialogPVRChannelManager::SaveList() // XXX investigate: renumbering doesn't work
{
if (!m_bContainsChanges)
return;
CPVRDatabase *database = CPVRManager::Get()->GetTVDatabase();
if (!database || !database->Open())
return;
CGUIDialogProgress* pDlgProgress = (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS);
pDlgProgress->SetHeading(190);
pDlgProgress->SetLine(0, "");
pDlgProgress->SetLine(1, 328);
pDlgProgress->SetLine(2, "");
pDlgProgress->StartModal();
pDlgProgress->Progress();
pDlgProgress->SetPercentage(0);
int iActiveChannels = 0;
for (int iListPtr = 0; iListPtr < m_channelItems->Size(); iListPtr++)
{
if (m_channelItems->Get(iListPtr)->GetPropertyBOOL("ActiveChannel"))
++iActiveChannels;
}
// int iNextChannelNumber = 1;
// int iNextHiddenChannelNumber = iActiveChannels + 1;
bool bHasChangedItems = false;
for (int iListPtr = 0; iListPtr < m_channelItems->Size(); iListPtr++)
{
bool bChanged = false;
CFileItemPtr pItem = m_channelItems->Get(iListPtr);
if (!pItem)
continue;
CPVRChannel *channel = pItem->GetPVRChannelInfoTag();
if (!channel)
{
//TODO add new channel
continue;
}
/* get values from the form */
bool bHidden = !pItem->GetPropertyBOOL("ActiveChannel");
bool bVirtual = pItem->GetPropertyBOOL("Virtual");
bool bEPGEnabled = pItem->GetPropertyBOOL("UseEPG");
int iEPGSource = pItem->GetPropertyInt("EPGSource");
CStdString strChannelName = pItem->GetProperty("Name");
CStdString strIconPath = pItem->GetProperty("Icon");
CStdString strStreamURL = pItem->GetProperty("StreamURL");
/* set new values in the channel tag */
// TODO
// if (bHidden)
// bChanged = channel->SetChannelNumber(iNextHiddenChannelNumber++) || bChanged;
// else
// bChanged = channel->SetChannelNumber(iNextChannelNumber++) || bChanged;
bChanged = channel->SetChannelName(strChannelName) || bChanged;
bChanged = channel->SetHidden(bHidden) || bChanged;
bChanged = channel->SetIconPath(strIconPath) || bChanged;
if (bVirtual)
bChanged = channel->SetStreamURL(strStreamURL) || bChanged;
if (iEPGSource == 0)
bChanged = channel->SetEPGScraper("client") || bChanged;
// TODO add other scrapers
bChanged = channel->SetEPGEnabled(bEPGEnabled) || bChanged;
if (bChanged)
{
bHasChangedItems = true;
channel->Persist(true);
}
pItem->SetProperty("Changed", false);
pDlgProgress->SetPercentage(iListPtr * 100 / m_channelItems->Size());
}
if (bHasChangedItems)
{
database->CommitInsertQueries();
CPVRManager::Get()->Start(); // XXX not a nice way to refresh the channels, but works for now
}
database->Close();
m_bContainsChanges = false;
pDlgProgress->Close();
}