本文整理汇总了C++中CNetworkInterface::GetMacAddressRaw方法的典型用法代码示例。如果您正苦于以下问题:C++ CNetworkInterface::GetMacAddressRaw方法的具体用法?C++ CNetworkInterface::GetMacAddressRaw怎么用?C++ CNetworkInterface::GetMacAddressRaw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CNetworkInterface
的用法示例。
在下文中一共展示了CNetworkInterface::GetMacAddressRaw方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initialize
bool CAirTunesServer::Initialize(const std::string &password)
{
bool ret = false;
Deinitialize();
if (m_pLibShairplay->Load())
{
raop_callbacks_t ao = {};
ao.cls = m_pPipe;
ao.audio_init = AudioOutputFunctions::audio_init;
ao.audio_set_volume = AudioOutputFunctions::audio_set_volume;
ao.audio_set_metadata = AudioOutputFunctions::audio_set_metadata;
ao.audio_set_coverart = AudioOutputFunctions::audio_set_coverart;
ao.audio_process = AudioOutputFunctions::audio_process;
ao.audio_destroy = AudioOutputFunctions::audio_destroy;
ao.audio_remote_control_id = AudioOutputFunctions::audio_remote_control_id;
ao.audio_set_progress = AudioOutputFunctions::audio_set_progress;
m_pLibShairplay->EnableDelayedUnload(false);
m_pRaop = m_pLibShairplay->raop_init(1, &ao, RSA_KEY);//1 - we handle one client at a time max
ret = m_pRaop != NULL;
if(ret)
{
char macAdr[6];
unsigned short port = (unsigned short)m_port;
m_pLibShairplay->raop_set_log_level(m_pRaop, RAOP_LOG_WARNING);
if(g_advancedSettings.CanLogComponent(LOGAIRTUNES))
{
m_pLibShairplay->raop_set_log_level(m_pRaop, RAOP_LOG_DEBUG);
}
m_pLibShairplay->raop_set_log_callback(m_pRaop, shairplay_log, NULL);
CNetworkInterface *net = g_application.getNetwork().GetFirstConnectedInterface();
if (net)
{
net->GetMacAddressRaw(macAdr);
}
ret = m_pLibShairplay->raop_start(m_pRaop, &port, macAdr, 6, password.c_str()) >= 0;
}
}
return ret;
}