Protocol

CHHapticPatternPlayer

A protocol that defines a standard pattern player capable of playing haptic patterns with fixed parameters.

Declaration

@protocol CHHapticPatternPlayer

Overview

Create instances of a pattern player through a CHHapticEngine object by calling a factory method such as createPlayerWithPattern:error:. When you ask a pattern player to play a haptic pattern, the player submits those commands to the haptic engine on your behalf.

Use the advanced pattern player, CHHapticAdvancedPatternPlayer, when your haptic pattern needs to change during playback, or when you'd like to sync your haptic with a custom audio track. The advanced player allows your app to dynamically change haptic characteristics such as intensity and sharpness through dynamic parameters and parameter curves, capabilities not found in the standard player.

Topics

Starting and Stopping Playback

- startAtTime:error:

Starts playing the pattern at the specified time.

Required.

- stopAtTime:error:

Stops playing the pattern at the specified time.

Required.

- cancelAndReturnError:

Stops the pattern player immediately and returns the specified error.

Required.

Sending Parameters to a Haptic

- sendParameters:atTime:error:

Sends an array of haptic parameters, starting at the specified time.

Required.

- scheduleParameterCurve:atTime:error:

Schedules a parameter curve to begin transitioning a parameter at a certain time.

Required.

Silencing Haptic Playback

isMuted

A Boolean that silences all haptic and audio output from the player when set to YES.

Required.

Relationships

Inherits From

See Also

Creating Haptic Pattern Players

- createPlayerWithPattern:error:

Creates a standard haptic pattern player from a haptic pattern.

CHHapticAdvancedPatternPlayer

A protocol that defines an advanced pattern player capable of looping, seeking, pausing, and resuming haptic playback.

- createAdvancedPlayerWithPattern:error:

Creates an advanced haptic pattern player from a haptic pattern.