corehaptics

package
v0.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Rendered for darwin/amd64

Overview

Package corehaptics provides purego-based Go bindings for the macOS CoreHaptics framework.

Apple documentation: https://developer.apple.com/documentation/corehaptics

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CHHapticAudioResourceKeyLoopEnabled

func CHHapticAudioResourceKeyLoopEnabled() uintptr

func CHHapticAudioResourceKeyUseVolumeEnvelope

func CHHapticAudioResourceKeyUseVolumeEnvelope() uintptr

func CHHapticDynamicParameterIDAudioAttackTimeControl

func CHHapticDynamicParameterIDAudioAttackTimeControl() uintptr

func CHHapticDynamicParameterIDAudioBrightnessControl

func CHHapticDynamicParameterIDAudioBrightnessControl() uintptr

func CHHapticDynamicParameterIDAudioDecayTimeControl

func CHHapticDynamicParameterIDAudioDecayTimeControl() uintptr

func CHHapticDynamicParameterIDAudioPanControl

func CHHapticDynamicParameterIDAudioPanControl() uintptr

func CHHapticDynamicParameterIDAudioPitchControl

func CHHapticDynamicParameterIDAudioPitchControl() uintptr

func CHHapticDynamicParameterIDAudioReleaseTimeControl

func CHHapticDynamicParameterIDAudioReleaseTimeControl() uintptr

func CHHapticDynamicParameterIDAudioVolumeControl

func CHHapticDynamicParameterIDAudioVolumeControl() uintptr

func CHHapticDynamicParameterIDHapticAttackTimeControl

func CHHapticDynamicParameterIDHapticAttackTimeControl() uintptr

func CHHapticDynamicParameterIDHapticDecayTimeControl

func CHHapticDynamicParameterIDHapticDecayTimeControl() uintptr

func CHHapticDynamicParameterIDHapticIntensityControl

func CHHapticDynamicParameterIDHapticIntensityControl() uintptr

func CHHapticDynamicParameterIDHapticReleaseTimeControl

func CHHapticDynamicParameterIDHapticReleaseTimeControl() uintptr

func CHHapticDynamicParameterIDHapticSharpnessControl

func CHHapticDynamicParameterIDHapticSharpnessControl() uintptr

func CHHapticEventParameterIDAttackTime

func CHHapticEventParameterIDAttackTime() uintptr

func CHHapticEventParameterIDAudioBrightness

func CHHapticEventParameterIDAudioBrightness() uintptr

func CHHapticEventParameterIDAudioPan

func CHHapticEventParameterIDAudioPan() uintptr

func CHHapticEventParameterIDAudioPitch

func CHHapticEventParameterIDAudioPitch() uintptr

func CHHapticEventParameterIDAudioVolume

func CHHapticEventParameterIDAudioVolume() uintptr

func CHHapticEventParameterIDDecayTime

func CHHapticEventParameterIDDecayTime() uintptr

func CHHapticEventParameterIDHapticIntensity

func CHHapticEventParameterIDHapticIntensity() uintptr

func CHHapticEventParameterIDHapticSharpness

func CHHapticEventParameterIDHapticSharpness() uintptr

func CHHapticEventParameterIDReleaseTime

func CHHapticEventParameterIDReleaseTime() uintptr

func CHHapticEventParameterIDSustained

func CHHapticEventParameterIDSustained() uintptr

func CHHapticEventTypeAudioContinuous

func CHHapticEventTypeAudioContinuous() uintptr

func CHHapticEventTypeAudioCustom

func CHHapticEventTypeAudioCustom() uintptr

func CHHapticEventTypeHapticContinuous

func CHHapticEventTypeHapticContinuous() uintptr

func CHHapticEventTypeHapticTransient

func CHHapticEventTypeHapticTransient() uintptr

func CHHapticPatternKeyEvent

func CHHapticPatternKeyEvent() uintptr

func CHHapticPatternKeyEventDuration

func CHHapticPatternKeyEventDuration() uintptr

func CHHapticPatternKeyEventParameters

func CHHapticPatternKeyEventParameters() uintptr

func CHHapticPatternKeyEventType

func CHHapticPatternKeyEventType() uintptr

func CHHapticPatternKeyEventWaveformLoopEnabled

func CHHapticPatternKeyEventWaveformLoopEnabled() uintptr

func CHHapticPatternKeyEventWaveformPath

func CHHapticPatternKeyEventWaveformPath() uintptr

func CHHapticPatternKeyEventWaveformUseVolumeEnvelope

func CHHapticPatternKeyEventWaveformUseVolumeEnvelope() uintptr

func CHHapticPatternKeyParameter

func CHHapticPatternKeyParameter() uintptr

func CHHapticPatternKeyParameterCurve

func CHHapticPatternKeyParameterCurve() uintptr

func CHHapticPatternKeyParameterCurveControlPoints

func CHHapticPatternKeyParameterCurveControlPoints() uintptr

func CHHapticPatternKeyParameterID

func CHHapticPatternKeyParameterID() uintptr

func CHHapticPatternKeyParameterValue

func CHHapticPatternKeyParameterValue() uintptr

func CHHapticPatternKeyPattern

func CHHapticPatternKeyPattern() uintptr

func CHHapticPatternKeyTime

func CHHapticPatternKeyTime() uintptr

func CHHapticPatternKeyVersion

func CHHapticPatternKeyVersion() uintptr

Types

type CHHapticAdvancedPatternPlayer

type CHHapticAdvancedPatternPlayer interface {
	CHHapticPatternPlayer
	PauseAtTimeError(time_ float64) (bool, error)
	ResumeAtTimeError(time_ float64) (bool, error)
	SeekToOffsetError(offsetTime float64) (bool, error)
	LoopEnabled() bool
	SetLoopEnabled(loopEnabled bool)
	LoopEnd() float64
	SetLoopEnd(loopEnd float64)
	PlaybackRate() float32
	SetPlaybackRate(playbackRate float32)
	IsMuted() bool
	SetIsMuted(isMuted bool)
	CompletionHandler() objc.Block
	SetCompletionHandler(completionHandler func(unsafe.Pointer))
}

CHHapticAdvancedPatternPlayer wraps the ObjC protocol CHHapticAdvancedPatternPlayer.

type CHHapticDeviceCapability

type CHHapticDeviceCapability interface {
}

CHHapticDeviceCapability wraps the ObjC protocol CHHapticDeviceCapability.

func CHHapticEngineCapabilitiesForHardware

func CHHapticEngineCapabilitiesForHardware() CHHapticDeviceCapability

Returns a device capability object that describes the device’s haptic support and limitations.

type CHHapticDynamicParameter

type CHHapticDynamicParameter struct {
	foundation.NSObject
}

A value that you send to a haptic pattern player to alter a property value during playback.

Apple documentation: https://developer.apple.com/documentation/corehaptics/chhapticdynamicparameter

func CHHapticDynamicParameterFromID

func CHHapticDynamicParameterFromID(id objc.ID) *CHHapticDynamicParameter

func (*CHHapticDynamicParameter) InitWithParameterIDValueRelativeTime

func (o *CHHapticDynamicParameter) InitWithParameterIDValueRelativeTime(parameterID *foundation.NSString, value float32, time_ float64) *CHHapticDynamicParameter

Creates a dynamic parameter from its ID, value, and start time.

func (*CHHapticDynamicParameter) ParameterID

func (o *CHHapticDynamicParameter) ParameterID() *foundation.NSString

@property parameterID The ID of the dynamic parameter to use.

func (*CHHapticDynamicParameter) RelativeTime

func (o *CHHapticDynamicParameter) RelativeTime() float64

@property relativeTime The time at which the parameter should be applied, relative to the start time for the pattern.

func (*CHHapticDynamicParameter) SetRelativeTime

func (o *CHHapticDynamicParameter) SetRelativeTime(relativeTime float64)

func (*CHHapticDynamicParameter) SetValue

func (o *CHHapticDynamicParameter) SetValue(value float32)

func (*CHHapticDynamicParameter) Value

func (o *CHHapticDynamicParameter) Value() float32

@property value The value of the parameter.

type CHHapticEngine

type CHHapticEngine struct {
	foundation.NSObject
}

An object that represents the connection to the haptic server.

Apple documentation: https://developer.apple.com/documentation/corehaptics/chhapticengine

func CHHapticEngineFromID

func CHHapticEngineFromID(id objc.ID) *CHHapticEngine

func (*CHHapticEngine) CreateAdvancedPlayerWithPatternError

func (o *CHHapticEngine) CreateAdvancedPlayerWithPatternError(pattern *CHHapticPattern) (CHHapticAdvancedPatternPlayer, error)

Creates an advanced haptic pattern player from a haptic pattern.

func (*CHHapticEngine) CreatePlayerWithPatternError

func (o *CHHapticEngine) CreatePlayerWithPatternError(pattern *CHHapticPattern) (CHHapticPatternPlayer, error)

Creates a standard haptic pattern player from a haptic pattern.

func (*CHHapticEngine) CurrentTime

func (o *CHHapticEngine) CurrentTime() float64

@property currentTime The absolute time from which all current and future event times may be calculated. The units are seconds.

func (*CHHapticEngine) InitAndReturnError

func (o *CHHapticEngine) InitAndReturnError() (*CHHapticEngine, error)

Creates an instance of the haptic engine.

func (*CHHapticEngine) InitWithAudioSessionError

func (o *CHHapticEngine) InitWithAudioSessionError(audioSession objc.ID) (*CHHapticEngine, error)

Creates a haptic engine from an audio session.

func (*CHHapticEngine) IsAutoShutdownEnabled

func (o *CHHapticEngine) IsAutoShutdownEnabled() bool

@property autoShutdownEnabled @abstract When auto shutdown is enabled, the haptic engine can start and stop the hardware dynamically, to conserve power. @discussion To conserve power, it is advised that the client stop the haptic engine when not in use. But when auto shutdown is enabled, the haptic engine will stop the hardware if it was running idle for a certain duration, and restart it later when required. Note that, because this operation is dynamic, it may affect the start times of the pattern players (e.g. `CHHapticPatternplayer`), if the engine has to resume from its shutdown state. This feature is disabled by default, but the client can enable it if needed.

func (*CHHapticEngine) IsMutedForAudio

func (o *CHHapticEngine) IsMutedForAudio() bool

@property isMutedForAudio When set to YES, the CHHapticEngine mutes audio playback from its players. @discussion Default is NO.

func (*CHHapticEngine) IsMutedForHaptics

func (o *CHHapticEngine) IsMutedForHaptics() bool

@property isMutedForHaptics When set to YES, the CHHapticEngine mutes haptic playback from its players. @discussion Default is NO.

func (*CHHapticEngine) NotifyWhenPlayersFinished

func (o *CHHapticEngine) NotifyWhenPlayersFinished(finishedHandler func(unsafe.Pointer) CHHapticEngineFinishedAction)

Notifies you when all haptic pattern players have finished playing their haptic patterns.

func (*CHHapticEngine) PlayPatternFromDataError

func (o *CHHapticEngine) PlayPatternFromDataError(data *foundation.NSData) (bool, error)

Plays a pattern from the specified data.

func (*CHHapticEngine) PlayPatternFromURLError

func (o *CHHapticEngine) PlayPatternFromURLError(fileURL *foundation.NSURL) (bool, error)

Plays a pattern that’s defined in a file at the specified URL.

func (*CHHapticEngine) PlaysAudioOnly

func (o *CHHapticEngine) PlaysAudioOnly() bool

@property playsAudioOnly If set to YES, the CHHapticEngine will ignore all events of type CHHapticEventTypeHaptic and play only audio events. @discussion This behavior change will only take effect after the engine is stopped and restarted. The default is NO.

func (*CHHapticEngine) PlaysHapticsOnly

func (o *CHHapticEngine) PlaysHapticsOnly() bool

@property playsHapticsOnly If set to YES, the CHHapticEngine will ignore all events of type CHHapticEventTypeAudio and play only haptic events. @discussion This behavior change will only take effect after the engine is stopped and restarted. The default is NO.

func (*CHHapticEngine) RegisterAudioResourceOptionsError

func (o *CHHapticEngine) RegisterAudioResourceOptionsError(resourceURL *foundation.NSURL, options *foundation.NSDictionary[objc.ID, objc.ID]) (uint, error)

Registers an external audio to use as a custom waveform.

func (*CHHapticEngine) ResetHandler

func (o *CHHapticEngine) ResetHandler() objc.Block

@property resetHandler @abstract This block will called asynchronously if the haptic engine has to reset itself after a server failure. @discussion In response to this handler being called, the client must release all haptic pattern players and recreate them. All CHHapticPattern objects and CHHapticEngine properties will have been preserved. In general, callbacks arrive on a non-main thread and it is the client's responsibility to handle it in a thread-safe manner.

func (*CHHapticEngine) SetAutoShutdownEnabled

func (o *CHHapticEngine) SetAutoShutdownEnabled(autoShutdownEnabled bool)

func (*CHHapticEngine) SetIsMutedForAudio

func (o *CHHapticEngine) SetIsMutedForAudio(isMutedForAudio bool)

func (*CHHapticEngine) SetIsMutedForHaptics

func (o *CHHapticEngine) SetIsMutedForHaptics(isMutedForHaptics bool)

func (*CHHapticEngine) SetPlaysAudioOnly

func (o *CHHapticEngine) SetPlaysAudioOnly(playsAudioOnly bool)

func (*CHHapticEngine) SetPlaysHapticsOnly

func (o *CHHapticEngine) SetPlaysHapticsOnly(playsHapticsOnly bool)

func (*CHHapticEngine) SetResetHandler

func (o *CHHapticEngine) SetResetHandler(resetHandler func())

func (*CHHapticEngine) SetStoppedHandler

func (o *CHHapticEngine) SetStoppedHandler(stoppedHandler func(CHHapticEngineStoppedReason))

func (*CHHapticEngine) StartAndReturnError

func (o *CHHapticEngine) StartAndReturnError() (bool, error)

Synchronously starts the haptic engine.

func (*CHHapticEngine) StartWithCompletionHandler

func (o *CHHapticEngine) StartWithCompletionHandler(completionHandler func(unsafe.Pointer))

Asynchronously starts the haptic engine.

func (*CHHapticEngine) StopWithCompletionHandler

func (o *CHHapticEngine) StopWithCompletionHandler(completionHandler func(unsafe.Pointer))

Asynchronously stops the haptic engine and executes the completion handler once the engine has stopped.

func (*CHHapticEngine) StoppedHandler

func (o *CHHapticEngine) StoppedHandler() objc.Block

func (*CHHapticEngine) UnregisterAudioResourceError

func (o *CHHapticEngine) UnregisterAudioResourceError(resourceID uint) (bool, error)

Unregisters an external audio file that you previously registered with the engine.

type CHHapticEngineFinishedAction

type CHHapticEngineFinishedAction int64

Possible actions to take after the haptic engine finishes execution.

const (
	CHHapticEngineFinishedActionStopEngine         CHHapticEngineFinishedAction = 1
	CHHapticEngineFinishedActionLeaveEngineRunning CHHapticEngineFinishedAction = 2
)

func (CHHapticEngineFinishedAction) String

type CHHapticEngineStoppedReason

type CHHapticEngineStoppedReason int64

The enumeration of reasons the haptic engine stopped running.

const (
	CHHapticEngineStoppedReasonAudioSessionInterrupt    CHHapticEngineStoppedReason = 1
	CHHapticEngineStoppedReasonApplicationSuspended     CHHapticEngineStoppedReason = 2
	CHHapticEngineStoppedReasonIdleTimeout              CHHapticEngineStoppedReason = 3
	CHHapticEngineStoppedReasonNotifyWhenFinished       CHHapticEngineStoppedReason = 4
	CHHapticEngineStoppedReasonEngineDestroyed          CHHapticEngineStoppedReason = 5
	CHHapticEngineStoppedReasonGameControllerDisconnect CHHapticEngineStoppedReason = 6
	CHHapticEngineStoppedReasonSystemError              CHHapticEngineStoppedReason = -1
)

func (CHHapticEngineStoppedReason) String

type CHHapticErrorCode

type CHHapticErrorCode int64

Error codes for framework operations.

const (
	CHHapticErrorCodeEngineNotRunning         CHHapticErrorCode = -4805
	CHHapticErrorCodeOperationNotPermitted    CHHapticErrorCode = -4806
	CHHapticErrorCodeEngineStartTimeout       CHHapticErrorCode = -4808
	CHHapticErrorCodeNotSupported             CHHapticErrorCode = -4809
	CHHapticErrorCodeServerInitFailed         CHHapticErrorCode = -4810
	CHHapticErrorCodeServerInterrupted        CHHapticErrorCode = -4811
	CHHapticErrorCodeInvalidPatternPlayer     CHHapticErrorCode = -4812
	CHHapticErrorCodeInvalidPatternData       CHHapticErrorCode = -4813
	CHHapticErrorCodeInvalidPatternDictionary CHHapticErrorCode = -4814
	CHHapticErrorCodeInvalidAudioSession      CHHapticErrorCode = -4815
	CHHapticErrorCodeInvalidEngineParameter   CHHapticErrorCode = -4816
	CHHapticErrorCodeInvalidParameterType     CHHapticErrorCode = -4820
	CHHapticErrorCodeInvalidEventType         CHHapticErrorCode = -4821
	CHHapticErrorCodeInvalidEventTime         CHHapticErrorCode = -4822
	CHHapticErrorCodeInvalidEventDuration     CHHapticErrorCode = -4823
	CHHapticErrorCodeInvalidAudioResource     CHHapticErrorCode = -4824
	CHHapticErrorCodeResourceNotAvailable     CHHapticErrorCode = -4825
	CHHapticErrorCodeBadEventEntry            CHHapticErrorCode = -4830
	CHHapticErrorCodeBadParameterEntry        CHHapticErrorCode = -4831
	CHHapticErrorCodeInvalidTime              CHHapticErrorCode = -4840
	CHHapticErrorCodeFileNotFound             CHHapticErrorCode = -4851
	CHHapticErrorCodeInsufficientPower        CHHapticErrorCode = -4897
	CHHapticErrorCodeUnknownError             CHHapticErrorCode = -4898
	CHHapticErrorCodeMemoryError              CHHapticErrorCode = -4899
)

func (CHHapticErrorCode) String

func (e CHHapticErrorCode) String() string

type CHHapticEvent

type CHHapticEvent struct {
	foundation.NSObject
}

An object that describes a single haptic or audio event.

Apple documentation: https://developer.apple.com/documentation/corehaptics/chhapticevent

func CHHapticEventFromID

func CHHapticEventFromID(id objc.ID) *CHHapticEvent

func (*CHHapticEvent) Duration

func (o *CHHapticEvent) Duration() float64

@property duration The duration for this event. Units are seconds. If unset (0.0), Continuous event types will have no fixed end.

func (*CHHapticEvent) EventParameters

func (o *CHHapticEvent) EventParameters() *foundation.NSArray[*CHHapticEventParameter]

@property eventParameters NSArray of Event parameters. Can be empty.

func (*CHHapticEvent) InitWithAudioResourceIDParametersRelativeTime

func (o *CHHapticEvent) InitWithAudioResourceIDParametersRelativeTime(resID uint, eventParams *foundation.NSArray[*CHHapticEventParameter], time_ float64) *CHHapticEvent

Initializes a haptic event from a previously loaded audio resource, specifying event parameters and start time.

func (*CHHapticEvent) InitWithAudioResourceIDParametersRelativeTimeDuration

func (o *CHHapticEvent) InitWithAudioResourceIDParametersRelativeTimeDuration(resID uint, eventParams *foundation.NSArray[*CHHapticEventParameter], time_ float64, duration float64) *CHHapticEvent

Initializes a haptic event from a previously loaded audio resource, specifying event parameters, start time, and duration.

func (*CHHapticEvent) InitWithEventTypeParametersRelativeTime

func (o *CHHapticEvent) InitWithEventTypeParametersRelativeTime(type_ *foundation.NSString, eventParams *foundation.NSArray[*CHHapticEventParameter], time_ float64) *CHHapticEvent

Initializes a haptic event of the specified type, parameters, and start time.

func (*CHHapticEvent) InitWithEventTypeParametersRelativeTimeDuration

func (o *CHHapticEvent) InitWithEventTypeParametersRelativeTimeDuration(type_ *foundation.NSString, eventParams *foundation.NSArray[*CHHapticEventParameter], time_ float64, duration float64) *CHHapticEvent

Initializes a haptic event of the specified type, parameters, start time, and duration.

func (*CHHapticEvent) RelativeTime

func (o *CHHapticEvent) RelativeTime() float64

@property relativeTime The relative time for this event versus the start time of the pattern. Units are seconds.

func (*CHHapticEvent) SetDuration

func (o *CHHapticEvent) SetDuration(duration float64)

func (*CHHapticEvent) SetRelativeTime

func (o *CHHapticEvent) SetRelativeTime(relativeTime float64)

func (*CHHapticEvent) Type

func (o *CHHapticEvent) Type() *foundation.NSString

@property type The type of event.

type CHHapticEventParameter

type CHHapticEventParameter struct {
	foundation.NSObject
}

A static parameter value that represents a single property of the haptic pattern.

Apple documentation: https://developer.apple.com/documentation/corehaptics/chhapticeventparameter

func CHHapticEventParameterFromID

func CHHapticEventParameterFromID(id objc.ID) *CHHapticEventParameter

func (*CHHapticEventParameter) InitWithParameterIDValue

func (o *CHHapticEventParameter) InitWithParameterIDValue(parameterID *foundation.NSString, value float32) *CHHapticEventParameter

Creates a haptic event parameter from its ID and value.

func (*CHHapticEventParameter) ParameterID

func (o *CHHapticEventParameter) ParameterID() *foundation.NSString

@property parameterID The ID of the event parameter to use.

func (*CHHapticEventParameter) SetValue

func (o *CHHapticEventParameter) SetValue(value float32)

func (*CHHapticEventParameter) Value

func (o *CHHapticEventParameter) Value() float32

@property value The value of the event parameter.

type CHHapticParameterAttributes

type CHHapticParameterAttributes interface {
	MinValue() float32
	MaxValue() float32
	DefaultValue() float32
}

CHHapticParameterAttributes wraps the ObjC protocol CHHapticParameterAttributes.

type CHHapticParameterCurve

type CHHapticParameterCurve struct {
	foundation.NSObject
}

A curve that you send to a haptic pattern player to alter a property value gradually during playback.

Apple documentation: https://developer.apple.com/documentation/corehaptics/chhapticparametercurve

func CHHapticParameterCurveFromID

func CHHapticParameterCurveFromID(id objc.ID) *CHHapticParameterCurve

func (*CHHapticParameterCurve) ControlPoints

func (*CHHapticParameterCurve) InitWithParameterIDControlPointsRelativeTime

func (o *CHHapticParameterCurve) InitWithParameterIDControlPointsRelativeTime(parameterID *foundation.NSString, controlPoints *foundation.NSArray[*CHHapticParameterCurveControlPoint], relativeTime float64) *CHHapticParameterCurve

Creates a parameter curve from its parameter ID, control points, and start time.

func (*CHHapticParameterCurve) ParameterID

func (o *CHHapticParameterCurve) ParameterID() *foundation.NSString

func (*CHHapticParameterCurve) RelativeTime

func (o *CHHapticParameterCurve) RelativeTime() float64

func (*CHHapticParameterCurve) SetRelativeTime

func (o *CHHapticParameterCurve) SetRelativeTime(relativeTime float64)

type CHHapticParameterCurveControlPoint

type CHHapticParameterCurveControlPoint struct {
	foundation.NSObject
}

A single control point in a parameter curve.

Apple documentation: https://developer.apple.com/documentation/corehaptics/chhapticparametercurvecontrolpoint

func CHHapticParameterCurveControlPointFromID

func CHHapticParameterCurveControlPointFromID(id objc.ID) *CHHapticParameterCurveControlPoint

func (*CHHapticParameterCurveControlPoint) InitWithRelativeTimeValue

func (o *CHHapticParameterCurveControlPoint) InitWithRelativeTimeValue(time_ float64, value float32) *CHHapticParameterCurveControlPoint

@method initWithRelativeTime:value @abstract Initialize a CHHapticParameterCurveControlPoint with a relative time and value. @param value The value of the associated parameter. @param time The time at which the associated parameter will reach this value, relative to the start time of the parameter curve.

func (*CHHapticParameterCurveControlPoint) RelativeTime

func (o *CHHapticParameterCurveControlPoint) RelativeTime() float64

func (*CHHapticParameterCurveControlPoint) SetRelativeTime

func (o *CHHapticParameterCurveControlPoint) SetRelativeTime(relativeTime float64)

func (*CHHapticParameterCurveControlPoint) SetValue

func (o *CHHapticParameterCurveControlPoint) SetValue(value float32)

func (*CHHapticParameterCurveControlPoint) Value

type CHHapticPattern

type CHHapticPattern struct {
	foundation.NSObject
}

An object representing a haptic waveform.

Apple documentation: https://developer.apple.com/documentation/corehaptics/chhapticpattern

func CHHapticPatternFromID

func CHHapticPatternFromID(id objc.ID) *CHHapticPattern

func (*CHHapticPattern) Duration

func (o *CHHapticPattern) Duration() float64

@property duration Pattern duration is calculated as the start time of the pattern's last event or parameter, plus that event's duration if present.

func (*CHHapticPattern) ExportDictionaryAndReturnError

func (o *CHHapticPattern) ExportDictionaryAndReturnError() (*foundation.NSDictionary[*foundation.NSString, objc.ID], error)

Returns the dictionary representation of the haptic pattern.

func (*CHHapticPattern) InitWithContentsOfURLError

func (o *CHHapticPattern) InitWithContentsOfURLError(ahapURL *foundation.NSURL) (*CHHapticPattern, error)

Creates a haptic pattern with the contents of an AHAP file.

func (*CHHapticPattern) InitWithDictionaryError

func (o *CHHapticPattern) InitWithDictionaryError(patternDict *foundation.NSDictionary[*foundation.NSString, objc.ID]) (*CHHapticPattern, error)

Creates a haptic pattern from a property list dictionary.

func (*CHHapticPattern) InitWithEventsParameterCurvesError

func (o *CHHapticPattern) InitWithEventsParameterCurvesError(events *foundation.NSArray[*CHHapticEvent], parameterCurves *foundation.NSArray[*CHHapticParameterCurve]) (*CHHapticPattern, error)

Constructs a haptic pattern from a series of events and parameter curves.

func (*CHHapticPattern) InitWithEventsParametersError

func (o *CHHapticPattern) InitWithEventsParametersError(events *foundation.NSArray[*CHHapticEvent], parameters *foundation.NSArray[*CHHapticDynamicParameter]) (*CHHapticPattern, error)

Constructs a haptic pattern from a series of events and parameters.

type CHHapticPatternPlayer

type CHHapticPatternPlayer interface {
	StartAtTimeError(time_ float64) (bool, error)
	StopAtTimeError(time_ float64) (bool, error)
	SendParametersAtTimeError(parameters *foundation.NSArray[*CHHapticDynamicParameter], time_ float64) (bool, error)
	ScheduleParameterCurveAtTimeError(parameterCurve *CHHapticParameterCurve, time_ float64) (bool, error)
	CancelAndReturnError() (bool, error)
	IsMuted() bool
	SetIsMuted(isMuted bool)
}

CHHapticPatternPlayer wraps the ObjC protocol CHHapticPatternPlayer.

type Idtype_t

type Idtype_t int64
const (
	P_ALL  Idtype_t = 0
	P_PID  Idtype_t = 1
	P_PGID Idtype_t = 2
)

func (Idtype_t) String

func (e Idtype_t) String() string

type Ptrauth_key

type Ptrauth_key int64
const (
	Ptrauth_key_none                     Ptrauth_key = -1
	Ptrauth_key_asia                     Ptrauth_key = 0
	Ptrauth_key_asib                     Ptrauth_key = 1
	Ptrauth_key_asda                     Ptrauth_key = 2
	Ptrauth_key_asdb                     Ptrauth_key = 3
	Ptrauth_key_process_independent_code Ptrauth_key = 0
	Ptrauth_key_process_dependent_code   Ptrauth_key = 1
	Ptrauth_key_process_independent_data Ptrauth_key = 2
	Ptrauth_key_process_dependent_data   Ptrauth_key = 3
	Ptrauth_key_return_address           Ptrauth_key = 1
	Ptrauth_key_frame_pointer            Ptrauth_key = 3
	Ptrauth_key_function_pointer         Ptrauth_key = 0
	Ptrauth_key_block_function           Ptrauth_key = 0
	Ptrauth_key_cxx_vtable_pointer       Ptrauth_key = 2
	Ptrauth_key_method_list_pointer      Ptrauth_key = 2
	Ptrauth_key_objc_isa_pointer         Ptrauth_key = 2
	Ptrauth_key_objc_super_pointer       Ptrauth_key = 2
	Ptrauth_key_objc_sel_pointer         Ptrauth_key = 3
	Ptrauth_key_objc_class_ro_pointer    Ptrauth_key = 2
	Ptrauth_key_block_descriptor_pointer Ptrauth_key = 2
	Ptrauth_key_init_fini_pointer        Ptrauth_key = 0
)

func (Ptrauth_key) String

func (e Ptrauth_key) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL