117 lines
3.2 KiB
Swift
Generated
117 lines
3.2 KiB
Swift
Generated
///
|
|
/// NativeBPMEstimate.swift
|
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
/// https://github.com/mrousavy/nitro
|
|
/// Copyright © Marc Rousavy @ Margelo
|
|
///
|
|
|
|
import NitroModules
|
|
|
|
/**
|
|
* Represents an instance of `NativeBPMEstimate`, backed by a C++ struct.
|
|
*/
|
|
public typealias NativeBPMEstimate = margelo.nitro.haptika.ppg.NativeBPMEstimate
|
|
|
|
public extension NativeBPMEstimate {
|
|
private typealias bridge = margelo.nitro.haptika.ppg.bridge.swift
|
|
|
|
/**
|
|
* Create a new instance of `NativeBPMEstimate`.
|
|
*/
|
|
init(bpm: Double?, temporalBpm: Double?, frequencyBpm: Double?, methodAgreementBpm: Double?, validPeakCount: Double, rejectedPeakCount: Double, confidence: Double, selectedChannel: String) {
|
|
self.init({ () -> bridge.std__optional_double_ in
|
|
if let __unwrappedValue = bpm {
|
|
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
} else {
|
|
return .init()
|
|
}
|
|
}(), { () -> bridge.std__optional_double_ in
|
|
if let __unwrappedValue = temporalBpm {
|
|
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
} else {
|
|
return .init()
|
|
}
|
|
}(), { () -> bridge.std__optional_double_ in
|
|
if let __unwrappedValue = frequencyBpm {
|
|
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
} else {
|
|
return .init()
|
|
}
|
|
}(), { () -> bridge.std__optional_double_ in
|
|
if let __unwrappedValue = methodAgreementBpm {
|
|
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
} else {
|
|
return .init()
|
|
}
|
|
}(), validPeakCount, rejectedPeakCount, confidence, std.string(selectedChannel))
|
|
}
|
|
|
|
@inline(__always)
|
|
var bpm: Double? {
|
|
return { () -> Double? in
|
|
if bridge.has_value_std__optional_double_(self.__bpm) {
|
|
let __unwrapped = bridge.get_std__optional_double_(self.__bpm)
|
|
return __unwrapped
|
|
} else {
|
|
return nil
|
|
}
|
|
}()
|
|
}
|
|
|
|
@inline(__always)
|
|
var temporalBpm: Double? {
|
|
return { () -> Double? in
|
|
if bridge.has_value_std__optional_double_(self.__temporalBpm) {
|
|
let __unwrapped = bridge.get_std__optional_double_(self.__temporalBpm)
|
|
return __unwrapped
|
|
} else {
|
|
return nil
|
|
}
|
|
}()
|
|
}
|
|
|
|
@inline(__always)
|
|
var frequencyBpm: Double? {
|
|
return { () -> Double? in
|
|
if bridge.has_value_std__optional_double_(self.__frequencyBpm) {
|
|
let __unwrapped = bridge.get_std__optional_double_(self.__frequencyBpm)
|
|
return __unwrapped
|
|
} else {
|
|
return nil
|
|
}
|
|
}()
|
|
}
|
|
|
|
@inline(__always)
|
|
var methodAgreementBpm: Double? {
|
|
return { () -> Double? in
|
|
if bridge.has_value_std__optional_double_(self.__methodAgreementBpm) {
|
|
let __unwrapped = bridge.get_std__optional_double_(self.__methodAgreementBpm)
|
|
return __unwrapped
|
|
} else {
|
|
return nil
|
|
}
|
|
}()
|
|
}
|
|
|
|
@inline(__always)
|
|
var validPeakCount: Double {
|
|
return self.__validPeakCount
|
|
}
|
|
|
|
@inline(__always)
|
|
var rejectedPeakCount: Double {
|
|
return self.__rejectedPeakCount
|
|
}
|
|
|
|
@inline(__always)
|
|
var confidence: Double {
|
|
return self.__confidence
|
|
}
|
|
|
|
@inline(__always)
|
|
var selectedChannel: String {
|
|
return String(self.__selectedChannel)
|
|
}
|
|
}
|