本文整理汇总了C++中XnDeviceModule类的典型用法代码示例。如果您正苦于以下问题:C++ XnDeviceModule类的具体用法?C++ XnDeviceModule怎么用?C++ XnDeviceModule使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XnDeviceModule类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: XN_VALIDATE_INPUT_PTR
XnStatus XnDeviceBase::UnregisterFromPropertyChange(const XnChar* Module, const XnChar* PropertyName, XnCallbackHandle hCallback)
{
XnStatus nRetVal = XN_STATUS_OK;
XN_VALIDATE_INPUT_PTR(Module);
XN_VALIDATE_INPUT_PTR(PropertyName);
XN_VALIDATE_INPUT_PTR(hCallback);
XnPropertyCallback* pRealCookie = (XnPropertyCallback*)hCallback;
XnDeviceModule* pModule;
nRetVal = FindModule(Module, &pModule);
XN_IS_STATUS_OK(nRetVal);
// first unregister it from property
nRetVal = pModule->UnregisterFromOnPropertyValueChanged(PropertyName, pRealCookie->hCallback);
XN_IS_STATUS_OK(nRetVal);
XnValue val = pRealCookie;
XnList::Iterator it = m_PropertyCallbacks.Find(val);
if (it != m_PropertyCallbacks.end())
{
m_PropertyCallbacks.Remove(it);
}
// now free the memory
XN_DELETE(pRealCookie);
return (XN_STATUS_OK);
}
示例2: RegisterToProps
XnStatus XnServerSensorInvoker::RegisterToProps(XnPropertySet* pProps)
{
XnStatus nRetVal = XN_STATUS_OK;
XnCallbackHandle hDummy = NULL;
for (XnPropertySetData::Iterator itMod = pProps->pData->Begin(); itMod != pProps->pData->End(); ++itMod)
{
XnActualPropertiesHash* pHash = itMod->Value();
XnDeviceModule* pModule;
nRetVal = m_sensor.FindModule(itMod->Key(), &pModule);
XN_IS_STATUS_OK(nRetVal);
for (XnActualPropertiesHash::Iterator itProp = pHash->Begin(); itProp != pHash->End(); ++itProp)
{
XnProperty* pProp;
nRetVal = pModule->GetProperty(itProp->Key(), &pProp);
XN_IS_STATUS_OK(nRetVal);
// no need to keep the handle. We only want to unregister when the stream is destroyed, and then
// it happens anyway.
nRetVal = pProp->OnChangeEvent().Register(PropertyChangedCallback, this, hDummy);
XN_IS_STATUS_OK(nRetVal);
}
}
return (XN_STATUS_OK);
}
开发者ID:DogfishLab88,项目名称:debian-openni-sensor-avin2-sensorkinect,代码行数:28,代码来源:XnServerSensorInvoker.cpp
示例3: XN_IS_STATUS_OK
XnStatus XnSensor::CreateDeviceModule(XnDeviceModuleHolder** ppModuleHolder)
{
XnStatus nRetVal = XN_STATUS_OK;
nRetVal = XnDeviceBase::CreateDeviceModule(ppModuleHolder);
XN_IS_STATUS_OK(nRetVal);
// add sensor properties
XnDeviceModule* pModule = (*ppModuleHolder)->GetModule();
XnProperty* pProps[] =
{
&m_ErrorState, &m_ResetSensorOnStartup, &m_Interface, &m_ReadFromEP1,
&m_ReadFromEP2, &m_ReadFromEP3, &m_ReadData, &m_NumberOfBuffers, &m_FirmwareParam,
&m_CmosBlankingUnits, &m_CmosBlankingTime, &m_Reset, &m_FirmwareMode, &m_Version,
&m_FixedParam, &m_FrameSync, &m_CloseStreamsOnShutdown, &m_InstancePointer, &m_ID,
&m_USBPath, &m_DeviceName, &m_VendorSpecificData,
};
nRetVal = pModule->AddProperties(pProps, sizeof(pProps)/sizeof(XnProperty*));
if (nRetVal != XN_STATUS_OK)
{
DestroyModule(*ppModuleHolder);
*ppModuleHolder = NULL;
return (nRetVal);
}
// configure it from global file
if (m_strGlobalConfigFile[0] != '\0')
{
nRetVal = pModule->LoadConfigFromFile(m_strGlobalConfigFile);
XN_IS_STATUS_OK(nRetVal);
}
return (XN_STATUS_OK);
}
示例4: RegisterToPropertyChange
XnStatus XnDeviceBase::RegisterToPropertyChange(const XnChar* Module, const XnChar* PropertyName, XnDeviceOnPropertyChangedEventHandler Handler, void* pCookie, XnCallbackHandle* phCallback)
{
XnStatus nRetVal = XN_STATUS_OK;
XnDeviceModule* pModule;
nRetVal = FindModule(Module, &pModule);
XN_IS_STATUS_OK(nRetVal);
XnPropertyCallback* pRealCookie;
XN_VALIDATE_NEW(pRealCookie, XnPropertyCallback, GetDeviceHandle(), Module, PropertyName, Handler, pCookie);
// register
nRetVal = pModule->RegisterForOnPropertyValueChanged(PropertyName, PropertyValueChangedCallback, pRealCookie, &pRealCookie->hCallback);
if (nRetVal != XN_STATUS_OK)
{
XN_DELETE(pRealCookie);
return (nRetVal);
}
m_PropertyCallbacks.AddLast(pRealCookie);
*phCallback = pRealCookie;
return (XN_STATUS_OK);
}
示例5: GetProperty
XnStatus XnDeviceBase::GetProperty(const XnChar* ModuleName, const XnChar* PropertyName, const XnGeneralBuffer& gbValue)
{
XnStatus nRetVal = XN_STATUS_OK;
XnDeviceModule* pModule;
nRetVal = FindModule(ModuleName, &pModule);
XN_IS_STATUS_OK(nRetVal);
nRetVal = pModule->GetProperty(PropertyName, gbValue);
XN_IS_STATUS_OK(nRetVal);
return XN_STATUS_OK;
}
示例6: SetProperty
XnStatus XnDeviceBase::SetProperty(const XnChar* ModuleName, const XnChar* PropertyName, const XnChar* csValue)
{
XnStatus nRetVal = XN_STATUS_OK;
XnDeviceModule* pModule;
nRetVal = FindModule(ModuleName, &pModule);
XN_IS_STATUS_OK(nRetVal);
nRetVal = pModule->SetProperty(PropertyName, csValue);
XN_IS_STATUS_OK(nRetVal);
return (XN_STATUS_OK);
}
示例7: GetPropertyType
XnStatus XnDeviceBase::GetPropertyType(const XnChar* ModuleName, const XnChar* PropertyName, XnPropertyType* pnType)
{
XnStatus nRetVal = XN_STATUS_OK;
XnDeviceModule* pModule;
nRetVal = FindModule(ModuleName, &pModule);
XN_IS_STATUS_OK(nRetVal);
nRetVal = pModule->GetPropertyType(PropertyName, pnType);
XN_IS_STATUS_OK(nRetVal);
return (XN_STATUS_OK);
}
示例8: SetProperty
XnStatus XnDeviceBase::SetProperty(const XnChar* ModuleName, XnUInt32 propertyId, const OniGeneralBuffer& gbValue)
{
XnStatus nRetVal = XN_STATUS_OK;
XnDeviceModule* pModule;
nRetVal = FindModule(ModuleName, &pModule);
XN_IS_STATUS_OK(nRetVal);
nRetVal = pModule->SetProperty(propertyId, gbValue);
XN_IS_STATUS_OK(nRetVal);
return (XN_STATUS_OK);
}
示例9: ConfigureModuleFromGlobalFile
XnStatus XnSensor::ConfigureModuleFromGlobalFile(const XnChar* strModule, const XnChar* strSection /* = NULL */)
{
XnStatus nRetVal = XN_STATUS_OK;
XnDeviceModule* pModule;
nRetVal = FindModule(strModule, &pModule);
XN_IS_STATUS_OK(nRetVal);
nRetVal = pModule->LoadConfigFromFile(m_strGlobalConfigFile, strSection);
XN_IS_STATUS_OK(nRetVal);
return (XN_STATUS_OK);
}
示例10: GetProperty
XnStatus XnDeviceBase::GetProperty(const XnChar* ModuleName, XnUInt32 propertyId, XnChar* csValue)
{
XnStatus nRetVal = XN_STATUS_OK;
XnDeviceModule* pModule;
nRetVal = FindModule(ModuleName, &pModule);
XN_IS_STATUS_OK(nRetVal);
nRetVal = pModule->GetProperty(propertyId, csValue);
XN_IS_STATUS_OK(nRetVal);
return XN_STATUS_OK;
}
示例11: HandleGeneralProperty
XnStatus XnStreamReaderDevice::HandleGeneralProperty(const XnChar* strModule, const XnChar* strName, const XnGeneralBuffer& gbValue)
{
XnStatus nRetVal = XN_STATUS_OK;
// find module
XnDeviceModule* pModule;
nRetVal = FindModule(strModule, &pModule);
XN_IS_STATUS_OK(nRetVal);
// update prop
nRetVal = pModule->UnsafeUpdateProperty(strName, gbValue);
XN_IS_STATUS_OK(nRetVal);
return (XN_STATUS_OK);
}
示例12: AddModule
XnStatus XnDeviceBase::AddModule(XnDeviceModuleHolder* pModuleHolder)
{
XnDeviceModule* pModule = pModuleHolder->GetModule();
// make sure module doesn't exist yet
if (m_Modules.Find(pModule->GetName()) != m_Modules.End())
{
xnLogError(XN_MASK_DEVICE, "A module with the name %s already exists!", pModule->GetName());
return XN_STATUS_ERROR;
}
// add it to the list
XnStatus nRetVal = m_Modules.Set(pModule->GetName(), pModuleHolder);
XN_IS_STATUS_OK(nRetVal);
return XN_STATUS_OK;
}
示例13: XN_VALIDATE_INPUT_PTR
XnStatus XnDeviceBase::BatchConfig(const XnPropertySet* pChangeSet)
{
XnStatus nRetVal = XN_STATUS_OK;
XN_VALIDATE_INPUT_PTR(pChangeSet);
for (XnPropertySetData::ConstIterator itModule = pChangeSet->pData->Begin(); itModule != pChangeSet->pData->End(); ++itModule)
{
// find this module
XnDeviceModule* pModule = NULL;
nRetVal = FindModule(itModule->Key(), &pModule);
XN_IS_STATUS_OK(nRetVal);
nRetVal = pModule->BatchConfig(*itModule->Value());
XN_IS_STATUS_OK(nRetVal);
}
return (XN_STATUS_OK);
}
示例14: return
XnStatus XnStreamReaderDevice::HandleIntProperty(const XnChar *strModule, const XnChar *strName, XnUInt64 nValue)
{
XnStatus nRetVal = XN_STATUS_OK;
// ignore some properties
if (strcmp(strModule, XN_MODULE_NAME_DEVICE) == 0 && strcmp(strName, XN_MODULE_PROPERTY_PRIMARY_STREAM) == 0)
{
return (XN_STATUS_OK);
}
// find module
XnDeviceModule* pModule;
nRetVal = FindModule(strModule, &pModule);
XN_IS_STATUS_OK(nRetVal);
// update prop
nRetVal = pModule->UnsafeUpdateProperty(strName, nValue);
XN_IS_STATUS_OK(nRetVal);
return (XN_STATUS_OK);
}
示例15: XN_IS_STATUS_OK
XnStatus XnSensorClient::CreateDeviceModule(XnDeviceModuleHolder** ppModuleHolder)
{
XnStatus nRetVal = XN_STATUS_OK;
nRetVal = XnDeviceBase::CreateDeviceModule(ppModuleHolder);
XN_IS_STATUS_OK(nRetVal);
// add sensor properties
XnDeviceModule* pModule = (*ppModuleHolder)->GetModule();
XnProperty* pProps[] = { &m_InstancePointer, &m_ErrorState };
nRetVal = pModule->AddProperties(pProps, sizeof(pProps)/sizeof(XnProperty*));
if (nRetVal != XN_STATUS_OK)
{
DestroyModule(*ppModuleHolder);
*ppModuleHolder = NULL;
return (nRetVal);
}
return (XN_STATUS_OK);
}