本文整理汇总了C++中PeripheralPtr::Initialise方法的典型用法代码示例。如果您正苦于以下问题:C++ PeripheralPtr::Initialise方法的具体用法?C++ PeripheralPtr::Initialise怎么用?C++ PeripheralPtr::Initialise使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PeripheralPtr
的用法示例。
在下文中一共展示了PeripheralPtr::Initialise方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreatePeripheral
void CPeripherals::CreatePeripheral(CPeripheralBus &bus, const PeripheralScanResult& result)
{
PeripheralPtr peripheral;
PeripheralScanResult mappedResult = result;
if (mappedResult.m_busType == PERIPHERAL_BUS_UNKNOWN)
mappedResult.m_busType = bus.Type();
/* check whether there's something mapped in peripherals.xml */
GetMappingForDevice(bus, mappedResult);
switch(mappedResult.m_mappedType)
{
case PERIPHERAL_HID:
peripheral = PeripheralPtr(new CPeripheralHID(mappedResult, &bus));
break;
case PERIPHERAL_NIC:
peripheral = PeripheralPtr(new CPeripheralNIC(mappedResult, &bus));
break;
case PERIPHERAL_DISK:
peripheral = PeripheralPtr(new CPeripheralDisk(mappedResult, &bus));
break;
case PERIPHERAL_NYXBOARD:
peripheral = PeripheralPtr(new CPeripheralNyxboard(mappedResult, &bus));
break;
case PERIPHERAL_TUNER:
peripheral = PeripheralPtr(new CPeripheralTuner(mappedResult, &bus));
break;
case PERIPHERAL_BLUETOOTH:
peripheral = PeripheralPtr(new CPeripheralBluetooth(mappedResult, &bus));
break;
case PERIPHERAL_CEC:
#if defined(HAVE_LIBCEC)
if (bus.Type() == PERIPHERAL_BUS_CEC)
peripheral = PeripheralPtr(new CPeripheralCecAdapter(mappedResult, &bus));
#else
if (!m_bMissingLibCecWarningDisplayed)
{
m_bMissingLibCecWarningDisplayed = true;
CLog::Log(LOGWARNING, "%s - libCEC support has not been compiled in, so the CEC adapter cannot be used.", __FUNCTION__);
CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Warning, g_localizeStrings.Get(36000), g_localizeStrings.Get(36017));
}
#endif
break;
case PERIPHERAL_IMON:
peripheral = PeripheralPtr(new CPeripheralImon(mappedResult, &bus));
break;
case PERIPHERAL_JOYSTICK:
peripheral = PeripheralPtr(new CPeripheralJoystick(mappedResult, &bus));
break;
default:
break;
}
if (peripheral)
{
/* try to initialise the new peripheral
* Initialise() will make sure that each device is only initialised once */
if (peripheral->Initialise())
bus.Register(peripheral);
else
{
CLog::Log(LOGDEBUG, "%s - failed to initialise peripheral on '%s'", __FUNCTION__, mappedResult.m_strLocation.c_str());
}
}
}