CHHapticAdvancedPatternPlayer

Trait CHHapticAdvancedPatternPlayer 

Source
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 { ... }
}
Available on crate feature 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§

Source

unsafe fn pauseAtTime_error( &self, time: NSTimeInterval, ) -> Result<(), Retained<NSError>>
where Self: Sized + Message,

Pause playback of the pattern at the specified time (see CHHapticEngine(currentTime)).

If ‘time’ is set to CHHapticTimeImmediate, the pattern will be paused immediately.

Source

unsafe fn resumeAtTime_error( &self, time: NSTimeInterval, ) -> Result<(), Retained<NSError>>
where Self: Sized + Message,

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.

Source

unsafe fn seekToOffset_error( &self, offset_time: NSTimeInterval, ) -> Result<(), Retained<NSError>>
where Self: Sized + Message,

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.

Source

unsafe fn loopEnabled(&self) -> bool
where Self: Sized + Message,

When set to YES, the player will loop back to the beginning of the pattern whenever playback reaches the loopEnd time.

Source

unsafe fn setLoopEnabled(&self, loop_enabled: bool)
where Self: Sized + Message,

Setter for loopEnabled.

Source

unsafe fn loopEnd(&self) -> NSTimeInterval
where Self: Sized + Message,

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.

Source

unsafe fn setLoopEnd(&self, loop_end: NSTimeInterval)
where Self: Sized + Message,

Setter for loopEnd.

Source

unsafe fn playbackRate(&self) -> c_float
where Self: Sized + Message,

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.

Source

unsafe fn setPlaybackRate(&self, playback_rate: c_float)
where Self: Sized + Message,

Setter for playbackRate.

Source

unsafe fn isMuted(&self) -> bool
where Self: Sized + Message,

When set to YES, all audio and haptic output will be silenced.

Source

unsafe fn setIsMuted(&self, is_muted: bool)
where Self: Sized + Message,

Setter for isMuted.

Source

unsafe fn completionHandler( &self, ) -> CHHapticAdvancedPatternPlayerCompletionHandler
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn setCompletionHandler( &self, completion_handler: CHHapticAdvancedPatternPlayerCompletionHandler, )
where Self: Sized + Message,

Available on crate feature block2 only.

Setter for completionHandler.

§Safety

completion_handler must be a valid pointer.

Trait Implementations§

Source§

impl ProtocolType for dyn CHHapticAdvancedPatternPlayer

Source§

const NAME: &'static str = "CHHapticAdvancedPatternPlayer"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn CHHapticAdvancedPatternPlayer

Implementations on Foreign Types§

Source§

impl<T> CHHapticAdvancedPatternPlayer for ProtocolObject<T>

Implementors§