Capsule API Example

Loading...
Searching...
No Matches
CNFBCalibrator.h
Go to the documentation of this file.
1// Copyright. 2019 - 2024 PSBD. All rights reserved.
2
3#pragma once
4
5#include "CDefinesPrivate.h"
6#include "CDevice.h"
7#include "CError.h"
8
9#ifdef __cplusplus
10 extern "C" {
11#endif
12
16 CLC_CLASS_WN(NFBCalibratorPrivate, clCNFBCalibrator);
17
18 typedef enum clCIndividualNFBCalibrationStage {
19 clCIndividualNFBCalibrationStage_1 = 0,
20 clCIndividualNFBCalibrationStage_2,
21 clCIndividualNFBCalibrationStage_3,
22 clCIndividualNFBCalibrationStage_4,
23} clCIndividualNFBCalibrationStage;
24
25 typedef enum clCIndividualNFBCalibrationFailReason {
26 clC_IndividualNFBCalibrationFailReason_None = 0,
27 clC_IndividualNFBCalibrationFailReason_TooManyArtifacts,
28 clC_IndividualNFBCalibrationFailReason_PeakIsABorder,
29} clCIndividualNFBCalibrationFailReason;
30
31 typedef struct clCIndividualNFBData {
32 int64_t timestampMilli = -1;
33 clCIndividualNFBCalibrationFailReason failReason = clC_IndividualNFBCalibrationFailReason_None;
37 float individualFrequency = 10.F;
41 float individualPeakFrequency = 10.F;
45 float individualPeakFrequencyPower = 10.F;
49 float individualPeakFrequencySuppression = 2.F;
53 float individualBandwidth = 6.F;
57 float individualNormalizedPower = 0.5F;
61 float lowerFrequency = 7.F;
65 float upperFrequency = 13.F;
66} clCIndividualNFBData;
67
76 CL_DLL clCNFBCalibrator clCNFBCalibrator_CreateOrGet(clCDevice device) NOEXCEPT;
77
86 CL_DLL void clCNFBCalibrator_CalibrateIndividualNFB(clCNFBCalibrator calibrator, clCIndividualNFBCalibrationStage stage, clCError* error) NOEXCEPT;
87
94 CL_DLL void clCNFBCalibrator_CalibrateIndividualNFBQuick(clCNFBCalibrator calibrator, clCError* error) NOEXCEPT;
95
102 CL_DLL void clCNFBCalibrator_ImportIndividualNFBData(clCNFBCalibrator calibrator, const clCIndividualNFBData* individualNfbData, clCError* error) NOEXCEPT;
103
111 CL_DLL void clCNFBCalibrator_GetIndividualNFB(clCNFBCalibrator calibrator, clCIndividualNFBData* nfbData, clCError* error) NOEXCEPT;
112
119 CL_DLL bool clCNFBCalibrator_IsCalibrated(clCNFBCalibrator calibrator) NOEXCEPT;
126 CL_DLL bool clCNFBCalibrator_HasCalibrationFailed(clCNFBCalibrator calibrator) NOEXCEPT;
127
128 typedef void (*clCNFBCalibrator_CalibrationStageFinishedHandler)(clCNFBCalibrator calibrator) NOEXCEPT;
129 CL_DLL void clCNFBCalibrator_SetOnCalibrationStageFinishedEvent(clCNFBCalibrator calibrator, clCNFBCalibrator_CalibrationStageFinishedHandler handler) NOEXCEPT;
130
131 typedef void (*clCNFBCalibrator_CalibratedHandler)(clCNFBCalibrator calibrator, const clCIndividualNFBData*) NOEXCEPT;
132 CL_DLL void clCNFBCalibrator_SetOnCalibratedEvent(clCNFBCalibrator calibrator, clCNFBCalibrator_CalibratedHandler handler) NOEXCEPT;
133
134#ifdef __cplusplus
135}
136#endif
CDefinesPrivate.h
NOEXCEPT
#define NOEXCEPT
Definition CDefinesPrivate.h:82
CL_DLL
#define CL_DLL
Definition CDefinesPrivate.h:51
CLC_CLASS_WN
#define CLC_CLASS_WN(Wrapped, Name)
Definition CDefinesPrivate.h:84
CDevice.h
CError.h
clCIndividualNFBCalibrationStage
clCIndividualNFBCalibrationStage
Definition CNFBCalibrator.h:18
clCIndividualNFBCalibrationStage_4
@ clCIndividualNFBCalibrationStage_4
Definition CNFBCalibrator.h:22
clCIndividualNFBCalibrationStage_1
@ clCIndividualNFBCalibrationStage_1
Definition CNFBCalibrator.h:19
clCIndividualNFBCalibrationStage_3
@ clCIndividualNFBCalibrationStage_3
Definition CNFBCalibrator.h:21
clCIndividualNFBCalibrationStage_2
@ clCIndividualNFBCalibrationStage_2
Definition CNFBCalibrator.h:20
clCNFBCalibrator_CalibrateIndividualNFB
CL_DLL void clCNFBCalibrator_CalibrateIndividualNFB(clCNFBCalibrator calibrator, clCIndividualNFBCalibrationStage stage, clCError *error) NOEXCEPT
Start stage of individual NFB calibration.
clCNFBCalibrator_GetIndividualNFB
CL_DLL void clCNFBCalibrator_GetIndividualNFB(clCNFBCalibrator calibrator, clCIndividualNFBData *nfbData, clCError *error) NOEXCEPT
Get individual NFB metrics.
clCNFBCalibrator_CreateOrGet
CL_DLL clCNFBCalibrator clCNFBCalibrator_CreateOrGet(clCDevice device) NOEXCEPT
Obtain an individual NFB calibrator for the session. If not present, it'll be created.
clCNFBCalibrator_HasCalibrationFailed
CL_DLL bool clCNFBCalibrator_HasCalibrationFailed(clCNFBCalibrator calibrator) NOEXCEPT
Has calibration failed.
clCNFBCalibrator_SetOnCalibratedEvent
CL_DLL void clCNFBCalibrator_SetOnCalibratedEvent(clCNFBCalibrator calibrator, clCNFBCalibrator_CalibratedHandler handler) NOEXCEPT
clCNFBCalibrator_CalibratedHandler
void(* clCNFBCalibrator_CalibratedHandler)(clCNFBCalibrator calibrator, const clCIndividualNFBData *) NOEXCEPT
Definition CNFBCalibrator.h:131
clCNFBCalibrator_SetOnCalibrationStageFinishedEvent
CL_DLL void clCNFBCalibrator_SetOnCalibrationStageFinishedEvent(clCNFBCalibrator calibrator, clCNFBCalibrator_CalibrationStageFinishedHandler handler) NOEXCEPT
clCIndividualNFBCalibrationFailReason
clCIndividualNFBCalibrationFailReason
Definition CNFBCalibrator.h:25
clC_IndividualNFBCalibrationFailReason_None
@ clC_IndividualNFBCalibrationFailReason_None
Definition CNFBCalibrator.h:26
clC_IndividualNFBCalibrationFailReason_PeakIsABorder
@ clC_IndividualNFBCalibrationFailReason_PeakIsABorder
Definition CNFBCalibrator.h:28
clC_IndividualNFBCalibrationFailReason_TooManyArtifacts
@ clC_IndividualNFBCalibrationFailReason_TooManyArtifacts
Definition CNFBCalibrator.h:27
clCNFBCalibrator_CalibrationStageFinishedHandler
void(* clCNFBCalibrator_CalibrationStageFinishedHandler)(clCNFBCalibrator calibrator) NOEXCEPT
Definition CNFBCalibrator.h:128
clCIndividualNFBData
struct clCIndividualNFBData clCIndividualNFBData
clCNFBCalibrator_IsCalibrated
CL_DLL bool clCNFBCalibrator_IsCalibrated(clCNFBCalibrator calibrator) NOEXCEPT
Is calibration finished.
clCNFBCalibrator_CalibrateIndividualNFBQuick
CL_DLL void clCNFBCalibrator_CalibrateIndividualNFBQuick(clCNFBCalibrator calibrator, clCError *error) NOEXCEPT
Start stage of quick individual NFB calibration.
clCNFBCalibrator_ImportIndividualNFBData
CL_DLL void clCNFBCalibrator_ImportIndividualNFBData(clCNFBCalibrator calibrator, const clCIndividualNFBData *individualNfbData, clCError *error) NOEXCEPT
Import individual nfb data from external source.
clCError
Definition CError.h:28
clCIndividualNFBData
Definition CNFBCalibrator.h:31
clCIndividualNFBData::individualPeakFrequency
float individualPeakFrequency
Individual NFB peak frequency.
Definition CNFBCalibrator.h:41
clCIndividualNFBData::individualBandwidth
float individualBandwidth
Individual NFB bandwidth.
Definition CNFBCalibrator.h:53
clCIndividualNFBData::individualNormalizedPower
float individualNormalizedPower
NFB power.
Definition CNFBCalibrator.h:57
clCIndividualNFBData::individualPeakFrequencySuppression
float individualPeakFrequencySuppression
Individual NFB peak frequency suppression.
Definition CNFBCalibrator.h:49
clCIndividualNFBData::upperFrequency
float upperFrequency
Right frequency bound.
Definition CNFBCalibrator.h:65
clCIndividualNFBData::timestampMilli
int64_t timestampMilli
Definition CNFBCalibrator.h:32
clCIndividualNFBData::failReason
clCIndividualNFBCalibrationFailReason failReason
Definition CNFBCalibrator.h:33
clCIndividualNFBData::individualFrequency
float individualFrequency
Individual NFB frequency.
Definition CNFBCalibrator.h:37
clCIndividualNFBData::individualPeakFrequencyPower
float individualPeakFrequencyPower
Individual NFB peak frequency power.
Definition CNFBCalibrator.h:45
clCIndividualNFBData::lowerFrequency
float lowerFrequency
Left frequency bound.
Definition CNFBCalibrator.h:61