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 "Capsule/CDefinesPrivate.h"
6#include "Capsule/CSession.h"
7
8#ifdef __cplusplus
9 extern "C" {
10#endif
11
15 CLC_CLASS_WN(NFBCalibratorPrivate, clCNFBCalibrator);
16
26 CL_DLL clCNFBCalibrator clCNFBCalibrator_CreateOrGet(clCSession session) NOEXCEPT;
27
28 typedef enum clCIndividualNFBCalibrationStage {
29 clCIndividualNFBCalibrationStage1,
30 clCIndividualNFBCalibrationStage2,
31 clCIndividualNFBCalibrationStage3,
32 clCIndividualNFBCalibrationStage4,
33} clCIndividualNFBCalibrationStage;
41 CL_DLL void clCNFBCalibrator_CalibrateIndividualNFB(clCNFBCalibrator nfbCalibrator,
42 clCIndividualNFBCalibrationStage stage,
43 clCError* error) NOEXCEPT;
44
50 CL_DLL void clCNFBCalibrator_CalibrateIndividualNFBQuick(clCNFBCalibrator nfbCalibratorPtr,
51 clCError* error) NOEXCEPT;
52
53 CLC_STRUCT(clCNFBCalibratorDelegateIndividualNFBCalibrationStage);
54 typedef void (*clCNFBCalibratorHandlerIndividualNFBCalibrationStage)(clCNFBCalibrator);
58 CL_DLL void clCNFBCalibratorDelegateIndividualNFBCalibrationStage_Set(
59 clCNFBCalibratorDelegateIndividualNFBCalibrationStage delegate,
60 clCNFBCalibratorHandlerIndividualNFBCalibrationStage handler) NOEXCEPT;
67 CL_DLL clCNFBCalibratorDelegateIndividualNFBCalibrationStage
68 clCNFBCalibrator_GetOnIndividualNFBStageFinishedEvent(clCNFBCalibrator nfbCalibrator) NOEXCEPT;
69
70 struct clCIndividualNFBData {
74 float individualFrequency = 0.0f;
78 float individualPeakFrequency = 0.0f;
82 float individualPeakFrequencyPower = 0.0f;
86 float individualPeakFrequencySuppression = 0.0f;
90 float individualBandwidth = 0.0f;
94 float individualNormalizedPower = 0.0f;
98 float lowerFrequency = 0.0f;
102 float upperFrequency = 0.0f;
103};
104
105 typedef enum clCIndividualNFBCalibrationFailReason {
106 clC_IndividualNFBCalibrationFailReason_None = 0,
107 clC_IndividualNFBCalibrationFailReason_TooManyArtifacts,
108 clC_IndividualNFBCalibrationFailReason_PeakIsABorder,
109} clCIndividualNFBCalibrationFailReason;
110
111 CLC_STRUCT(clCNFBCalibratorDelegateIndividualNFBCalibrated);
112 typedef void (*clCNFBCalibratorHandlerIndividualNFBCalibrated)(
113 clCNFBCalibrator, const clCIndividualNFBData*, clCIndividualNFBCalibrationFailReason);
117 CL_DLL void clCNFBCalibratorDelegateIndividualNFBCalibrated_Set(
118 clCNFBCalibratorDelegateIndividualNFBCalibrated delegate,
119 clCNFBCalibratorHandlerIndividualNFBCalibrated handler) NOEXCEPT;
126 CL_DLL clCNFBCalibratorDelegateIndividualNFBCalibrated
127 clCNFBCalibrator_GetOnIndividualNFBCalibratedEvent(clCNFBCalibrator nfbCalibrator) NOEXCEPT;
128
135 CL_DLL bool clCNFBCalibrator_IsCalibrated(clCNFBCalibrator nfbCalibrator) NOEXCEPT;
142 CL_DLL bool clCNFBCalibrator_HasCalibrationFailed(clCNFBCalibrator nfbCalibrator) NOEXCEPT;
143
150 CL_DLL bool clCNFBCalibrator_IsReady(clCNFBCalibrator nfbCalibrator) NOEXCEPT;
151
152 CLC_STRUCT(clCNFBCalibratorDelegateReadyToCalibrate);
153 typedef void (*clCNFBCalibratorHandlerReadyToCalibrate)(clCNFBCalibrator);
157 CL_DLL void clCNFBCalibratorDelegateReadyToCalibrate_Set(
158 clCNFBCalibratorDelegateReadyToCalibrate delegate,
159 clCNFBCalibratorHandlerReadyToCalibrate handler) NOEXCEPT;
166 CL_DLL clCNFBCalibratorDelegateReadyToCalibrate
167 clCNFBCalibrator_GetOnReadyToCalibrate(clCNFBCalibrator nfbCalibrator) NOEXCEPT;
168
169#ifdef __cplusplus
170}
171#endif
CDefinesPrivate.h
CLC_STRUCT
#define CLC_STRUCT(Name)
Definition CDefinesPrivate.h:24
NOEXCEPT
#define NOEXCEPT
Definition CDefinesPrivate.h:52
CL_DLL
#define CL_DLL
Definition CDefinesPrivate.h:21
CLC_CLASS_WN
#define CLC_CLASS_WN(Wrapped, Name)
Definition CDefinesPrivate.h:54
clCError
clCError
Capsule error.
Definition CError.h:8
clCIndividualNFBCalibrationStage
clCIndividualNFBCalibrationStage
Definition CNFBCalibrator.h:28
clCIndividualNFBCalibrationStage2
@ clCIndividualNFBCalibrationStage2
Definition CNFBCalibrator.h:30
clCIndividualNFBCalibrationStage1
@ clCIndividualNFBCalibrationStage1
Definition CNFBCalibrator.h:29
clCIndividualNFBCalibrationStage4
@ clCIndividualNFBCalibrationStage4
Definition CNFBCalibrator.h:32
clCIndividualNFBCalibrationStage3
@ clCIndividualNFBCalibrationStage3
Definition CNFBCalibrator.h:31
clCNFBCalibrator_CreateOrGet
CL_DLL clCNFBCalibrator clCNFBCalibrator_CreateOrGet(clCSession session) NOEXCEPT
Obtain an individual NFB calibrator for the session. If not present, it'll be created.
clCNFBCalibrator_IsReady
CL_DLL bool clCNFBCalibrator_IsReady(clCNFBCalibrator nfbCalibrator) NOEXCEPT
Is calibrator ready to calibrate individual NFB data.
clCNFBCalibratorHandlerIndividualNFBCalibrated
void(* clCNFBCalibratorHandlerIndividualNFBCalibrated)(clCNFBCalibrator, const clCIndividualNFBData *, clCIndividualNFBCalibrationFailReason)
Definition CNFBCalibrator.h:112
clCNFBCalibratorDelegateReadyToCalibrate_Set
CL_DLL void clCNFBCalibratorDelegateReadyToCalibrate_Set(clCNFBCalibratorDelegateReadyToCalibrate delegate, clCNFBCalibratorHandlerReadyToCalibrate handler) NOEXCEPT
Set handler for calibrator ready to calibrate.
clCNFBCalibrator_GetOnIndividualNFBStageFinishedEvent
CL_DLL clCNFBCalibratorDelegateIndividualNFBCalibrationStage clCNFBCalibrator_GetOnIndividualNFBStageFinishedEvent(clCNFBCalibrator nfbCalibrator) NOEXCEPT
Get handler for individual calibration stage event.
clCNFBCalibratorHandlerReadyToCalibrate
void(* clCNFBCalibratorHandlerReadyToCalibrate)(clCNFBCalibrator)
Definition CNFBCalibrator.h:153
clCNFBCalibrator_HasCalibrationFailed
CL_DLL bool clCNFBCalibrator_HasCalibrationFailed(clCNFBCalibrator nfbCalibrator) NOEXCEPT
Has calibration failed.
clCNFBCalibrator_GetOnReadyToCalibrate
CL_DLL clCNFBCalibratorDelegateReadyToCalibrate clCNFBCalibrator_GetOnReadyToCalibrate(clCNFBCalibrator nfbCalibrator) NOEXCEPT
Get handler for calibrator ready to calibrate.
clCNFBCalibrator_CalibrateIndividualNFBQuick
CL_DLL void clCNFBCalibrator_CalibrateIndividualNFBQuick(clCNFBCalibrator nfbCalibratorPtr, clCError *error) NOEXCEPT
Start stage of quick individual NFB calibration.
clCNFBCalibratorDelegateIndividualNFBCalibrationStage_Set
CL_DLL void clCNFBCalibratorDelegateIndividualNFBCalibrationStage_Set(clCNFBCalibratorDelegateIndividualNFBCalibrationStage delegate, clCNFBCalibratorHandlerIndividualNFBCalibrationStage handler) NOEXCEPT
Set handler for individual calibration event.
clCIndividualNFBCalibrationFailReason
clCIndividualNFBCalibrationFailReason
Definition CNFBCalibrator.h:105
clC_IndividualNFBCalibrationFailReason_None
@ clC_IndividualNFBCalibrationFailReason_None
Definition CNFBCalibrator.h:106
clC_IndividualNFBCalibrationFailReason_PeakIsABorder
@ clC_IndividualNFBCalibrationFailReason_PeakIsABorder
Definition CNFBCalibrator.h:108
clC_IndividualNFBCalibrationFailReason_TooManyArtifacts
@ clC_IndividualNFBCalibrationFailReason_TooManyArtifacts
Definition CNFBCalibrator.h:107
clCNFBCalibrator_IsCalibrated
CL_DLL bool clCNFBCalibrator_IsCalibrated(clCNFBCalibrator nfbCalibrator) NOEXCEPT
Is calibration finished.
clCNFBCalibrator_CalibrateIndividualNFB
CL_DLL void clCNFBCalibrator_CalibrateIndividualNFB(clCNFBCalibrator nfbCalibrator, clCIndividualNFBCalibrationStage stage, clCError *error) NOEXCEPT
Start stage of individual NFB calibration.
clCNFBCalibratorDelegateIndividualNFBCalibrated_Set
CL_DLL void clCNFBCalibratorDelegateIndividualNFBCalibrated_Set(clCNFBCalibratorDelegateIndividualNFBCalibrated delegate, clCNFBCalibratorHandlerIndividualNFBCalibrated handler) NOEXCEPT
Set handler for individual calibration finish event.
clCNFBCalibratorHandlerIndividualNFBCalibrationStage
void(* clCNFBCalibratorHandlerIndividualNFBCalibrationStage)(clCNFBCalibrator)
Definition CNFBCalibrator.h:54
clCNFBCalibrator_GetOnIndividualNFBCalibratedEvent
CL_DLL clCNFBCalibratorDelegateIndividualNFBCalibrated clCNFBCalibrator_GetOnIndividualNFBCalibratedEvent(clCNFBCalibrator nfbCalibrator) NOEXCEPT
Get handler for individual calibration finish event.
CSession.h
clCIndividualNFBData
Definition CNFBCalibrator.h:70
clCIndividualNFBData::individualPeakFrequency
float individualPeakFrequency
Individual NFB peak frequency.
Definition CNFBCalibrator.h:78
clCIndividualNFBData::individualBandwidth
float individualBandwidth
Individual NFB bandwidth.
Definition CNFBCalibrator.h:90
clCIndividualNFBData::individualNormalizedPower
float individualNormalizedPower
NFB power.
Definition CNFBCalibrator.h:94
clCIndividualNFBData::individualPeakFrequencySuppression
float individualPeakFrequencySuppression
Individual NFB peak frequency suppression.
Definition CNFBCalibrator.h:86
clCIndividualNFBData::upperFrequency
float upperFrequency
Right frequency bound.
Definition CNFBCalibrator.h:102
clCIndividualNFBData::individualFrequency
float individualFrequency
Individual NFB frequency.
Definition CNFBCalibrator.h:74
clCIndividualNFBData::individualPeakFrequencyPower
float individualPeakFrequencyPower
Individual NFB peak frequency power.
Definition CNFBCalibrator.h:82
clCIndividualNFBData::lowerFrequency
float lowerFrequency
Left frequency bound.
Definition CNFBCalibrator.h:98