本文整理汇总了C++中CCECBusDevice::GetCurrentPhysicalAddress方法的典型用法代码示例。如果您正苦于以下问题:C++ CCECBusDevice::GetCurrentPhysicalAddress方法的具体用法?C++ CCECBusDevice::GetCurrentPhysicalAddress怎么用?C++ CCECBusDevice::GetCurrentPhysicalAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCECBusDevice
的用法示例。
在下文中一共展示了CCECBusDevice::GetCurrentPhysicalAddress方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PersistConfiguration
bool CCECProcessor::PersistConfiguration(const libcec_configuration &configuration)
{
libcec_configuration persistConfiguration = configuration;
if (!CLibCEC::IsValidPhysicalAddress(configuration.iPhysicalAddress))
{
CCECBusDevice *device = GetPrimaryDevice();
if (device)
persistConfiguration.iPhysicalAddress = device->GetCurrentPhysicalAddress();
}
return m_communication ? m_communication->PersistConfiguration(persistConfiguration) : false;
}
示例2: SetConfiguration
bool CCECClient::SetConfiguration(const libcec_configuration &configuration)
{
bool bIsRunning(m_processor && m_processor->CECInitialised());
CCECBusDevice *primary = bIsRunning ? GetPrimaryDevice() : NULL;
uint16_t iPA = primary ? primary->GetCurrentPhysicalAddress() : CEC_INVALID_PHYSICAL_ADDRESS;
// update the callbacks
if (configuration.callbacks)
EnableCallbacks(configuration.callbackParam, configuration.callbacks);
// update the client version
SetClientVersion((cec_client_version)configuration.clientVersion);
// update the OSD name
CStdString strOSDName(configuration.strDeviceName);
SetOSDName(strOSDName);
// update the TV vendor override
SetTVVendorOverride((cec_vendor_id)configuration.tvVendor);
// just copy these
{
CLockObject lock(m_mutex);
m_configuration.bUseTVMenuLanguage = configuration.bUseTVMenuLanguage;
m_configuration.bActivateSource = configuration.bActivateSource;
m_configuration.bGetSettingsFromROM = configuration.bGetSettingsFromROM;
m_configuration.wakeDevices = configuration.wakeDevices;
m_configuration.powerOffDevices = configuration.powerOffDevices;
m_configuration.bPowerOffScreensaver = configuration.bPowerOffScreensaver;
m_configuration.bPowerOffOnStandby = configuration.bPowerOffOnStandby;
// client version 1.5.1
if (configuration.clientVersion >= CEC_CLIENT_VERSION_1_5_1)
m_configuration.bSendInactiveSource = configuration.bSendInactiveSource;
// client version 1.6.0
if (configuration.clientVersion >= CEC_CLIENT_VERSION_1_6_0)
{
m_configuration.bPowerOffDevicesOnStandby = configuration.bPowerOffDevicesOnStandby;
m_configuration.bShutdownOnStandby = configuration.bShutdownOnStandby;
}
// client version 1.6.2
if (configuration.clientVersion >= CEC_CLIENT_VERSION_1_6_2)
{
memcpy(m_configuration.strDeviceLanguage, configuration.strDeviceLanguage, 3);
}
// client version 1.6.3
if (configuration.clientVersion >= CEC_CLIENT_VERSION_1_6_3)
{
m_configuration.bMonitorOnly = configuration.bMonitorOnly;
}
// client version 1.8.0
if (configuration.clientVersion >= CEC_CLIENT_VERSION_1_8_0)
m_configuration.cecVersion = configuration.cecVersion;
// client version 1.8.2
if (configuration.clientVersion >= CEC_CLIENT_VERSION_1_8_2)
m_configuration.adapterType = configuration.adapterType;
// ensure that there is at least 1 device type set
if (m_configuration.deviceTypes.IsEmpty())
m_configuration.deviceTypes.Add(CEC_DEVICE_TYPE_RECORDING_DEVICE);
}
bool bNeedReinit(false);
// device types
if (SetDeviceTypes(configuration.deviceTypes))
{
// the device type changed. just copy the rest, and re-register
{
CLockObject lock(m_mutex);
m_configuration.iPhysicalAddress = configuration.iPhysicalAddress;
m_configuration.baseDevice = configuration.baseDevice;
m_configuration.iHDMIPort = configuration.iHDMIPort;
bNeedReinit = true;
}
}
else
{
// set the physical address
SetPhysicalAddress(configuration);
}
// persist the new configuration
PersistConfiguration(m_configuration);
if (!primary)
primary = GetPrimaryDevice();
if (bNeedReinit || !primary || primary->GetCurrentPhysicalAddress() != iPA)
{
// PA or device type changed
m_processor->RegisterClient(this);
}
else if (primary && configuration.bActivateSource == 1 && bIsRunning && !primary->IsActiveSource())
{
//.........这里部分代码省略.........