CHHapticPatternPlayer

Trait CHHapticPatternPlayer 

Source
pub unsafe trait CHHapticPatternPlayer: NSObjectProtocol {
    // Provided methods
    unsafe fn startAtTime_error(
        &self,
        time: NSTimeInterval,
    ) -> Result<(), Retained<NSError>>
       where Self: Sized + Message { ... }
    unsafe fn stopAtTime_error(
        &self,
        time: NSTimeInterval,
    ) -> Result<(), Retained<NSError>>
       where Self: Sized + Message { ... }
    unsafe fn sendParameters_atTime_error(
        &self,
        parameters: &NSArray<CHHapticDynamicParameter>,
        time: NSTimeInterval,
    ) -> Result<(), Retained<NSError>>
       where Self: Sized + Message { ... }
    unsafe fn scheduleParameterCurve_atTime_error(
        &self,
        parameter_curve: &CHHapticParameterCurve,
        time: NSTimeInterval,
    ) -> Result<(), Retained<NSError>>
       where Self: Sized + Message { ... }
    unsafe fn cancelAndReturnError(&self) -> Result<(), Retained<NSError>>
       where Self: Sized + Message { ... }
    unsafe fn isMuted(&self) -> bool
       where Self: Sized + Message { ... }
    unsafe fn setIsMuted(&self, is_muted: bool)
       where Self: Sized + Message { ... }
}
Available on crate feature CHHapticPatternPlayer only.
Expand description

A protocol which defines operations for starting, stopping, and sending parameters to a pattern player.

Instances of these objects are created via the factory methods such as CHHapticEngine(createPlayerWithPattern:error).

See also Apple’s documentation

Provided Methods§

Source

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

Start playing the pattern at the specified time (see CHHapticEngine(currentTime)). If ‘time’ is set to CHHapticTimeImmediate, the pattern is started as soon as possible.

Source

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

Stop playing the pattern at the specified time (see CHHapticEngine(currentTime)). If ‘time’ is set to CHHapticTimeImmediate, the pattern is stopped as soon as possible.

Source

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

Available on crate feature CHHapticParameter only.

Send an array of CHHapticDynamicParameters, starting at the specified time (see CHHapticEngine(currentTime)). If ‘time’ is set to CHHapticTimeImmediate, the parameters are sent as soon as possible.

Source

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

Available on crate feature CHHapticParameter only.

Schedule a CHHapticParameterCurve, starting at the specified time (see CHHapticEngine(currentTime)). If ‘time’ is set to CHHapticTimeImmediate, the parameter curve is scheduled as soon as possible.

This method overrides the relativeTime property of the passed-in CHHapticParameterCurve, setting it to this method’s ‘time’ argument. All the curve’s control point times will then be calculated relative to that time.

Source

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

Removes all pending commands and stops the player as soon as possible.

Source

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

When set to YES, the player’s audio and haptic output will be silenced.

Source

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

Setter for isMuted.

Trait Implementations§

Source§

impl ProtocolType for dyn CHHapticPatternPlayer

Source§

const NAME: &'static str = "CHHapticPatternPlayer"

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 CHHapticPatternPlayer

Implementations on Foreign Types§

Source§

impl<T> CHHapticPatternPlayer for ProtocolObject<T>

Implementors§