| 95 | return UpdateUserSelectionState(nUserId, pState->m_eState, newSubState); |
| 96 | } |
| 97 | XnStatus UserSelector::UpdateUserTracking(XnUserID nUserId, XnBool bTracked, XnInt64 newSubState) |
| 98 | { |
| 99 | // update by checking the current state is ok and then update it based on the success and the |
| 100 | // sub state. |
| 101 | UserSelectionState* pState; |
| 102 | XnStatus nRetVal = m_hUsersState.Get(nUserId,pState); |
| 103 | if(nRetVal!=XN_STATUS_OK) |
| 104 | { |
| 105 | return nRetVal; |
| 106 | } |
| 107 | if(pState == NULL || pState->m_eState != XN_SELECTION_SELECTED) |
| 108 | { |
| 109 | xnLogError("SAMPLE","User %d should have been in an unselected state but was instead in %d state.\n", nUserId, pState->m_eState); |
| 110 | return XN_STATUS_ERROR; // this should be only called when a user is selected! |
| 111 | } |
| 112 | XnSelectionState newState = bTracked ? XN_SELECTION_TRACKING : XN_SELECTION_FAILED; |
| 113 | |
| 114 | return UpdateUserSelectionState(nUserId, newState, newSubState); |
| 115 | } |
| 116 | |
| 117 | XnStatus UserSelector::AddNewUser(XnUserID nUserId) |
| 118 | { |
no test coverage detected