ml_headset_fit.h
Classes
Name | |
---|---|
struct | MLHeadsetFitState Headset fit state. |
Types
Name | |
---|---|
typedef struct MLHeadsetFitState | MLHeadsetFitState Headset fit state. |
Enums
Name | |
---|---|
enum | MLHeadsetFitStatus { MLHeadsetFitStatus_Unknown = 0, MLHeadsetFitStatus_NotWorn, MLHeadsetFitStatus_GoodFit, MLHeadsetFitStatus_BadFit, MLHeadsetFitStatus_Ensure32Bits = 0x7FFFFFFF } Represents the different fit status that the system can report. |
Functions
Name | |
---|---|
void | MLHeadsetFitStateInit(MLHeadsetFitState * inout_state) Initialize MLHeadsetFitState. |
MLResult | MLHeadsetFitCreateClient(MLHandle * out_handle) Creates a headset fit client. |
MLResult | MLHeadsetFitDestroyClient(MLHandle handle) Destroys headset fit client. |
MLResult | MLHeadsetFitGetState(MLHandle handle, MLHeadsetFitState * out_state) Gets information about the user's current headset fit. |
Enums Documentation
MLHeadsetFitStatus
Enumerator | Value | Description |
---|---|---|
MLHeadsetFitStatus_Unknown | 0 | Headset fit status not available for unknown reason. |
MLHeadsetFitStatus_NotWorn | Headset not worn. | |
MLHeadsetFitStatus_GoodFit | Good fit. | |
MLHeadsetFitStatus_BadFit | Bad fit. | |
MLHeadsetFitStatus_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Represents the different fit status that the system can report.
If status is neither NotWorn nor Unknown, then headset is being worn.
Deprecated since 1.6.0. Scheduled for removal.
API Level:
- 20
Types Documentation
MLHeadsetFitState
typedef struct MLHeadsetFitState MLHeadsetFitState;
Headset fit state.
Deprecated since 1.6.0. Scheduled for removal.
API Level:
- 20
Functions Documentation
MLHeadsetFitStateInit
static inline void MLHeadsetFitStateInit(
MLHeadsetFitState * inout_state
)
Initialize MLHeadsetFitState.
Parameters
MLHeadsetFitState * | inout_state | Set up the version for inout_state and zero all other fields. |
Deprecated since 1.6.0. Scheduled for removal.
API Level:
- 20
MLHeadsetFitCreateClient
MLResult MLHeadsetFitCreateClient(
MLHandle * out_handle
)
Creates a headset fit client.
Parameters
MLHandle * | out_handle | A pointer to an MLHandle to the newly created headset fit client. |
Returns
MLResult | MLResult_InvalidParam | Failed to create headset fit client due to an invalid input parameter. |
MLResult | MLResult_Ok | Successfully created headset fit client. |
MLResult | MLResult_UnspecifiedFailure | Failed to create headset fit client due to an unknown failure. |
Required Permissions:
- None
Deprecated since 1.6.0. Scheduled for removal.
API Level:
- 20
MLHeadsetFitDestroyClient
MLResult MLHeadsetFitDestroyClient(
MLHandle handle
)
Destroys headset fit client.
Parameters
MLHandle | handle | MLHandle to the headset fit client created by MLHeadsetFitCreateClient. |
Returns
MLResult | MLResult_Ok | Successfully destroyed headset fit client. |
MLResult | MLResult_InvalidParam | MLHandle is invalid. |
MLResult | MLResult_UnspecifiedFailure | Failed to destroy headset fit client due to an unknown failure. |
Required Permissions:
- None
Deprecated since 1.6.0. Scheduled for removal.
API Level:
- 20
MLHeadsetFitGetState
MLResult MLHeadsetFitGetState(
MLHandle handle,
MLHeadsetFitState * out_state
)
Gets information about the user's current headset fit.
Parameters
MLHandle | handle | Handle to the headset fit information created by MLHeadsetFitCreateClient. |
MLHeadsetFitState * | out_state | Information about headset fit state. |
Returns
MLResult | MLResult_InvalidParam | Failed to receive headset fit state due to an invalid input parameter. |
MLResult | MLResult_Ok | Successfully returned headset fit state. |
MLResult | MLResult_UnspecifiedFailure | Failed to receive headset fit state due to an unknown failure. |
Required Permissions:
- None
Deprecated since 1.6.0. Scheduled for removal.
API Level:
- 20
Source code
// %BANNER_BEGIN%
// ---------------------------------------------------------------------
// %COPYRIGHT_BEGIN%
// Copyright (c) 2022 Magic Leap, Inc. All Rights Reserved.
// Use of this file is governed by the Software License Agreement,
// located here: https://www.magicleap.com/software-license-agreement-ml2
// Terms and conditions applicable to third-party materials accompanying
// this distribution may also be found in the top-level NOTICE file
// appearing herein.
// %COPYRIGHT_END%
// ---------------------------------------------------------------------
// %BANNER_END%
#pragma once
#include "ml_api.h"
#include "ml_types.h"
#include <string.h>
ML_EXTERN_C_BEGIN
typedef enum MLHeadsetFitStatus {
MLHeadsetFitStatus_Unknown = 0,
MLHeadsetFitStatus_NotWorn,
MLHeadsetFitStatus_GoodFit,
MLHeadsetFitStatus_BadFit,
MLHeadsetFitStatus_Ensure32Bits = 0x7FFFFFFF
} MLHeadsetFitStatus;
typedef ML_DEPRECATED_MSG("Use XR_ML_user_calibration OpenXR extention.") struct MLHeadsetFitState {
uint32_t version;
MLHeadsetFitStatus fit_status;
int64_t epoch_timestamp_us;
} MLHeadsetFitState;
ML_DEPRECATED_MSG("Use XR_ML_user_calibration OpenXR extention.")
ML_STATIC_INLINE void MLHeadsetFitStateInit(MLHeadsetFitState *inout_state) {
if(inout_state) {
memset(inout_state, 0, sizeof(MLHeadsetFitState));
inout_state->version = 1;
}
}
ML_DEPRECATED_MSG("Use XR_ML_user_calibration OpenXR extention.")
ML_API MLResult ML_CALL MLHeadsetFitCreateClient(MLHandle *out_handle);
ML_DEPRECATED_MSG("Use XR_ML_user_calibration OpenXR extention.")
ML_API MLResult ML_CALL MLHeadsetFitDestroyClient(MLHandle handle);
ML_DEPRECATED_MSG("Use XR_ML_user_calibration OpenXR extention.")
ML_API MLResult ML_CALL MLHeadsetFitGetState(MLHandle handle, MLHeadsetFitState *out_state);
ML_EXTERN_C_END