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); }
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; }
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; }