| 6165 | } |
| 6166 | |
| 6167 | XN_C_API XnStatus xnRegisterToCalibrationInProgress(XnNodeHandle hInstance, XnCalibrationInProgress handler, void* pCookie, XnCallbackHandle* phCallback) |
| 6168 | { |
| 6169 | XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_USER); |
| 6170 | XN_VALIDATE_OUTPUT_PTR(phCallback); |
| 6171 | XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface; |
| 6172 | XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode; |
| 6173 | |
| 6174 | CalibrationInProgressCookie* pRegCookie; |
| 6175 | XN_VALIDATE_ALLOC(pRegCookie, CalibrationInProgressCookie); |
| 6176 | pRegCookie->handler = handler; |
| 6177 | pRegCookie->hNode = hInstance; |
| 6178 | pRegCookie->pUserCookie = pCookie; |
| 6179 | |
| 6180 | XnStatus nRetVal = XN_STATUS_OK; |
| 6181 | if (pInterface->Skeleton.RegisterToCalibrationInProgress != NULL) |
| 6182 | { |
| 6183 | pInterface->Skeleton.RegisterToCalibrationInProgress(hModuleNode, xnModuleCalibrationInProgress, pRegCookie, &pRegCookie->hCallback); |
| 6184 | } |
| 6185 | else |
| 6186 | { |
| 6187 | // Versions before 1.3.2 didn't have this API. Fabricate it. |
| 6188 | pInterface->Skeleton.RegisterCalibrationCallbacks(hModuleNode, xnModuleCalibrationInProgressViaStart, NULL, pRegCookie, &pRegCookie->hCallback); |
| 6189 | } |
| 6190 | if (nRetVal != XN_STATUS_OK) |
| 6191 | { |
| 6192 | xnOSFree(pRegCookie); |
| 6193 | return (nRetVal); |
| 6194 | } |
| 6195 | |
| 6196 | *phCallback = pRegCookie; |
| 6197 | |
| 6198 | return XN_STATUS_OK; |
| 6199 | } |
| 6200 | XN_C_API void xnUnregisterFromCalibrationInProgress(XnNodeHandle hInstance, XnCallbackHandle hCallback) |
| 6201 | { |
| 6202 | XN_VALIDATE_INTERFACE_TYPE_RET(hInstance, XN_NODE_TYPE_USER, ); |
no test coverage detected