本文整理汇总了C++中PVR_MENUHOOKS类的典型用法代码示例。如果您正苦于以下问题:C++ PVR_MENUHOOKS类的具体用法?C++ PVR_MENUHOOKS怎么用?C++ PVR_MENUHOOKS使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PVR_MENUHOOKS类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessMenuHooks
void CPVRClients::ProcessMenuHooks(int iClientID, PVR_MENUHOOK_CAT cat)
{
PVR_MENUHOOKS *hooks = NULL;
// get client id
if (iClientID < 0 && cat == PVR_MENUHOOK_SETTING)
{
PVR_CLIENTMAP clients;
GetConnectedClients(clients);
if (clients.size() == 1)
{
iClientID = clients.begin()->first;
}
else if (clients.size() > 1)
{
// have user select client
CGUIDialogSelect* pDialog = (CGUIDialogSelect*)g_windowManager.GetWindow(WINDOW_DIALOG_SELECT);
pDialog->Reset();
pDialog->SetHeading(19196);
PVR_CLIENTMAP_ITR itrClients;
for (itrClients = clients.begin(); itrClients != clients.end(); itrClients++)
{
pDialog->Add(itrClients->second->GetBackendName());
}
pDialog->DoModal();
int selection = pDialog->GetSelectedLabel();
if (selection >= 0)
{
itrClients = clients.begin();
for (int i = 0; i < selection; i++)
itrClients++;
iClientID = itrClients->first;
}
}
}
if (iClientID < 0)
iClientID = GetPlayingClientID();
PVR_CLIENT client;
if (GetConnectedClient(iClientID, client) && client->HaveMenuHooks(cat))
{
hooks = client->GetMenuHooks();
std::vector<int> hookIDs;
CGUIDialogSelect* pDialog = (CGUIDialogSelect*)g_windowManager.GetWindow(WINDOW_DIALOG_SELECT);
pDialog->Reset();
pDialog->SetHeading(19196);
for (unsigned int i = 0; i < hooks->size(); i++)
pDialog->Add(client->GetString(hooks->at(i).iLocalizedStringId));
pDialog->DoModal();
int selection = pDialog->GetSelectedLabel();
if (selection >= 0)
client->CallMenuHook(hooks->at(selection));
}
}
示例2: ProcessMenuHooks
void CPVRClients::ProcessMenuHooks(int iClientID)
{
PVR_MENUHOOKS *hooks = NULL;
if (iClientID < 0)
iClientID = GetPlayingClientID();
if (GetMenuHooks(iClientID, hooks))
{
boost::shared_ptr<CPVRClient> client;
if (!GetValidClient(iClientID, client))
return;
std::vector<int> hookIDs;
CGUIDialogSelect* pDialog = (CGUIDialogSelect*)g_windowManager.GetWindow(WINDOW_DIALOG_SELECT);
pDialog->Reset();
pDialog->SetHeading(19196);
for (unsigned int i = 0; i < hooks->size(); i++)
pDialog->Add(client->GetString(hooks->at(i).iLocalizedStringId));
pDialog->DoModal();
int selection = pDialog->GetSelectedLabel();
if (selection >= 0)
{
client->CallMenuHook(hooks->at(selection));
}
}
else
{
CLog::Log(LOGERROR, "PVR - %s - cannot find client %d",__FUNCTION__, iClientID);
}
}
示例3: PVRAddMenuHook
void CAddonHelpers_PVR::PVRAddMenuHook(void *addonData, PVR_MENUHOOK *hook)
{
CAddonHelpers* addon = (CAddonHelpers*) addonData;
if (addon == NULL || hook == NULL)
{
CLog::Log(LOGERROR, "PVR: PVRAddMenuHook is called with NULL-Pointer!!!");
return;
}
CAddonHelpers_PVR* addonHelper = addon->GetHelperPVR();
CPVRClient* client = (CPVRClient*) addonHelper->m_addon;
PVR_MENUHOOKS *hooks = client->GetMenuHooks();
PVR_MENUHOOK hookInt;
hookInt.hook_id = hook->hook_id;
hookInt.string_id = hook->string_id;
hooks->push_back(hookInt);
}
示例4: PVRAddMenuHook
void CAddonCallbacksPVR::PVRAddMenuHook(void *addonData, PVR_MENUHOOK *hook)
{
CAddonCallbacks* addon = (CAddonCallbacks*) addonData;
if (addon == NULL || hook == NULL)
{
CLog::Log(LOGERROR, "CAddonCallbacksPVR - %s - called with a null pointer", __FUNCTION__);
return;
}
CAddonCallbacksPVR* addonHelper = addon->GetHelperPVR();
CPVRClient* client = (CPVRClient*) addonHelper->m_addon;
PVR_MENUHOOKS *hooks = client->GetMenuHooks();
PVR_MENUHOOK hookInt;
hookInt.iHookId = hook->iHookId;
hookInt.iLocalizedStringId = hook->iLocalizedStringId;
/* add this new hook */
hooks->push_back(hookInt);
}
示例5: GetConnectedClients
void CPVRClients::ProcessMenuHooks(int iClientID, PVR_MENUHOOK_CAT cat, const CFileItem *item)
{
// get client id
if (iClientID < 0 && cat == PVR_MENUHOOK_SETTING)
{
PVR_CLIENTMAP clients;
GetConnectedClients(clients);
if (clients.size() == 1)
{
iClientID = clients.begin()->first;
}
else if (clients.size() > 1)
{
// have user select client
CGUIDialogSelect* pDialog = (CGUIDialogSelect*)g_windowManager.GetWindow(WINDOW_DIALOG_SELECT);
pDialog->Reset();
pDialog->SetHeading(CVariant{19196});
PVR_CLIENTMAP_CITR itrClients;
for (itrClients = clients.begin(); itrClients != clients.end(); itrClients++)
{
pDialog->Add(itrClients->second->GetBackendName());
}
pDialog->Open();
int selection = pDialog->GetSelectedItem();
if (selection >= 0)
{
itrClients = clients.begin();
for (int i = 0; i < selection; i++)
itrClients++;
iClientID = itrClients->first;
}
}
}
if (iClientID < 0)
iClientID = GetPlayingClientID();
PVR_CLIENT client;
if (GetConnectedClient(iClientID, client) && client->HaveMenuHooks(cat))
{
PVR_MENUHOOKS *hooks = client->GetMenuHooks();
std::vector<int> hookIDs;
int selection = 0;
CGUIDialogSelect* pDialog = (CGUIDialogSelect*)g_windowManager.GetWindow(WINDOW_DIALOG_SELECT);
pDialog->Reset();
pDialog->SetHeading(CVariant{19196});
for (unsigned int i = 0; i < hooks->size(); i++)
if (hooks->at(i).category == cat || hooks->at(i).category == PVR_MENUHOOK_ALL)
{
pDialog->Add(g_localizeStrings.GetAddonString(client->ID(), hooks->at(i).iLocalizedStringId));
hookIDs.push_back(i);
}
if (hookIDs.size() > 1)
{
pDialog->Open();
selection = pDialog->GetSelectedItem();
}
if (selection >= 0)
client->CallMenuHook(hooks->at(hookIDs.at(selection)), item);
}
}