pub unsafe trait CHHapticAdvancedPatternPlayer: CHHapticPatternPlayer {
Show 13 methods
// Provided methods
unsafe fn pauseAtTime_error(
&self,
time: NSTimeInterval,
) -> Result<(), Retained<NSError>>
where Self: Sized + Message { ... }
unsafe fn resumeAtTime_error(
&self,
time: NSTimeInterval,
) -> Result<(), Retained<NSError>>
where Self: Sized + Message { ... }
unsafe fn seekToOffset_error(
&self,
offset_time: NSTimeInterval,
) -> Result<(), Retained<NSError>>
where Self: Sized + Message { ... }
unsafe fn loopEnabled(&self) -> bool
where Self: Sized + Message { ... }
unsafe fn setLoopEnabled(&self, loop_enabled: bool)
where Self: Sized + Message { ... }
unsafe fn loopEnd(&self) -> NSTimeInterval
where Self: Sized + Message { ... }
unsafe fn setLoopEnd(&self, loop_end: NSTimeInterval)
where Self: Sized + Message { ... }
unsafe fn playbackRate(&self) -> c_float
where Self: Sized + Message { ... }
unsafe fn setPlaybackRate(&self, playback_rate: c_float)
where Self: Sized + Message { ... }
unsafe fn isMuted(&self) -> bool
where Self: Sized + Message { ... }
unsafe fn setIsMuted(&self, is_muted: bool)
where Self: Sized + Message { ... }
unsafe fn completionHandler(
&self,
) -> CHHapticAdvancedPatternPlayerCompletionHandler
where Self: Sized + Message { ... }
unsafe fn setCompletionHandler(
&self,
completion_handler: CHHapticAdvancedPatternPlayerCompletionHandler,
)
where Self: Sized + Message { ... }
}CHHapticPatternPlayer only.Expand description
A protocol which defines operations for pausing, resuming, seeking, and sending parameters to a pattern player.
Instances of these objects are created via the factory methods such as CHHapticEngine(createAdvancedPlayerWithPattern:error).
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn pauseAtTime_error(
&self,
time: NSTimeInterval,
) -> Result<(), Retained<NSError>>
unsafe fn pauseAtTime_error( &self, time: NSTimeInterval, ) -> Result<(), Retained<NSError>>
Pause playback of the pattern at the specified time (see CHHapticEngine(currentTime)).
If ‘time’ is set to CHHapticTimeImmediate, the pattern will be paused immediately.
Sourceunsafe fn resumeAtTime_error(
&self,
time: NSTimeInterval,
) -> Result<(), Retained<NSError>>
unsafe fn resumeAtTime_error( &self, time: NSTimeInterval, ) -> Result<(), Retained<NSError>>
Resume playback on a previously-paused player at the specified time (see CHHapticEngine(currentTime)).
If ‘time’ is set to CHHapticTimeImmediate, the pattern is resumed as soon as possible.
Playback will resume at the time offset in the pattern at which it was paused.
Sourceunsafe fn seekToOffset_error(
&self,
offset_time: NSTimeInterval,
) -> Result<(), Retained<NSError>>
unsafe fn seekToOffset_error( &self, offset_time: NSTimeInterval, ) -> Result<(), Retained<NSError>>
Set the playback position on an active player to the specified offset time.
If ‘offsetTime’ is set to 0.0, the pattern will start from the beginning. If set to >= the duration of the pattern, playback will terminate as soon as possible unless the player is looped, in which case playback will start at the beginning of the loop.
Sourceunsafe fn loopEnabled(&self) -> bool
unsafe fn loopEnabled(&self) -> bool
When set to YES, the player will loop back to the beginning of the pattern whenever playback
reaches the loopEnd time.
Sourceunsafe fn setLoopEnabled(&self, loop_enabled: bool)
unsafe fn setLoopEnabled(&self, loop_enabled: bool)
Setter for loopEnabled.
Sourceunsafe fn loopEnd(&self) -> NSTimeInterval
unsafe fn loopEnd(&self) -> NSTimeInterval
The time in seconds at which the pattern will loop back if looping is enabled.
If set to 0.0, the loop length will be set to the end of the last event in the pattern.
Sourceunsafe fn setLoopEnd(&self, loop_end: NSTimeInterval)
unsafe fn setLoopEnd(&self, loop_end: NSTimeInterval)
Setter for loopEnd.
Sourceunsafe fn playbackRate(&self) -> c_float
unsafe fn playbackRate(&self) -> c_float
Allows a pattern to be played back at any multiple of its normal rate. The rate can be adjusted at any point before or during pattern playback.
This rate factor scales the relative times of all events and parameters as they are played, as well as the
durations of Continuous events and the loopEnd time. It does not affect the pitches of the events.
Any value greater than 0.0 is valid; all others are ignored.
Sourceunsafe fn setPlaybackRate(&self, playback_rate: c_float)
unsafe fn setPlaybackRate(&self, playback_rate: c_float)
Setter for playbackRate.
Sourceunsafe fn isMuted(&self) -> bool
unsafe fn isMuted(&self) -> bool
When set to YES, all audio and haptic output will be silenced.
Sourceunsafe fn completionHandler(
&self,
) -> CHHapticAdvancedPatternPlayerCompletionHandler
Available on crate feature block2 only.
unsafe fn completionHandler( &self, ) -> CHHapticAdvancedPatternPlayerCompletionHandler
block2 only.The block or enclosure that will be called when the player finishes.
§Safety
The returned block’s argument must be a valid pointer or null.
Sourceunsafe fn setCompletionHandler(
&self,
completion_handler: CHHapticAdvancedPatternPlayerCompletionHandler,
)
Available on crate feature block2 only.
unsafe fn setCompletionHandler( &self, completion_handler: CHHapticAdvancedPatternPlayerCompletionHandler, )
block2 only.