本文整理汇总了C++中CNetworkInterface::GetAccessPoints方法的典型用法代码示例。如果您正苦于以下问题:C++ CNetworkInterface::GetAccessPoints方法的具体用法?C++ CNetworkInterface::GetAccessPoints怎么用?C++ CNetworkInterface::GetAccessPoints使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CNetworkInterface
的用法示例。
在下文中一共展示了CNetworkInterface::GetAccessPoints方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnInitWindow
void CGUIDialogAccessPoints::OnInitWindow()
{
m_wasItemSelected = false;
CGUIDialog::OnInitWindow();
CGUIMessage msgReset(GUI_MSG_LABEL_RESET, GetID(), CONTROL_ACCESS_POINTS);
OnMessage(msgReset);
CStdString ifaceName(m_interfaceName);
CNetworkInterface* iface = g_application.getNetwork().GetInterfaceByName(ifaceName);
m_aps = iface->GetAccessPoints();
for (int i = 0; i < (int) m_aps.size(); i++)
{
CFileItem *item = new CFileItem(m_aps[i].getEssId());
int q = m_aps[i].getQuality();
if (q <= 20) item->SetThumbnailImage("ap-signal1.png");
else if (q <= 40) item->SetThumbnailImage("ap-signal2.png");
else if (q <= 60) item->SetThumbnailImage("ap-signal3.png");
else if (q <= 80) item->SetThumbnailImage("ap-signal4.png");
else if (q <= 100) item->SetThumbnailImage("ap-signal5.png");
if (m_aps[i].getEncryptionMode() != ENC_NONE)
item->SetIconImage("ap-lock.png");
CGUIMessage msg(GUI_MSG_LABEL_ADD, GetID(), CONTROL_ACCESS_POINTS, 0, 0, item);
OnMessage(msg);
}
CFileItem *item = new CFileItem(g_localizeStrings.Get(1047));
CGUIMessage msg(GUI_MSG_LABEL_ADD, GetID(), CONTROL_ACCESS_POINTS, 0, 0, item);
OnMessage(msg);
}
示例2: OnInitWindow
void CGUIDialogAccessPoints::OnInitWindow()
{
m_wasItemSelected = false;
CGUIDialog::OnInitWindow();
CGUIMessage msgReset(GUI_MSG_LABEL_RESET, GetID(), CONTROL_ACCESS_POINTS);
OnMessage(msgReset);
m_accessPoints->Clear();
std::string ifaceName(m_interfaceName);
CNetworkInterface* iface = CServiceBroker::GetNetwork().GetInterfaceByName(ifaceName);
m_aps = iface->GetAccessPoints();
for (int i = 0; i < (int) m_aps.size(); i++)
{
CFileItemPtr item(new CFileItem(m_aps[i].getEssId()));
int q = m_aps[i].getQuality();
if (q <= 20) item->SetArt("thumb", "ap-signal1.png");
else if (q <= 40) item->SetArt("thumb", "ap-signal2.png");
else if (q <= 60) item->SetArt("thumb", "ap-signal3.png");
else if (q <= 80) item->SetArt("thumb", "ap-signal4.png");
else if (q <= 100) item->SetArt("thumb", "ap-signal5.png");
if (m_aps[i].getEncryptionMode() != ENC_NONE)
item->SetIconImage("ap-lock.png");
m_accessPoints->Add(item);
}
CFileItemPtr item(new CFileItem(g_localizeStrings.Get(1047)));
m_accessPoints->Add(item);
CGUIMessage msg(GUI_MSG_LABEL_BIND, GetID(), CONTROL_ACCESS_POINTS, 0, 0, m_accessPoints);
OnMessage(msg);
}