/// <summary> /// Play a canned haptic pattern. /// </summary> /// <param name="expr"></param> public override void Play(HapticExpression expr) { if (expr != HapticExpression.None) { NativeMethods.PlayTaptic((uint)expr); } }
/// <summary> /// Play a canned haptic pattern. /// </summary> /// <param name="expr"></param> public override void Play(HapticExpression expr) { if (expr == HapticExpression.Click) { controller?.StartFeedbackPatternVibe(MLInputControllerFeedbackPatternVibe.Click, MLInputControllerFeedbackIntensity.Medium); } else if (expr == HapticExpression.Light) { controller?.StartFeedbackPatternVibe(MLInputControllerFeedbackPatternVibe.Buzz, MLInputControllerFeedbackIntensity.Low); } else if (expr == HapticExpression.Medium) { controller?.StartFeedbackPatternVibe(MLInputControllerFeedbackPatternVibe.Buzz, MLInputControllerFeedbackIntensity.Medium); } else if (expr == HapticExpression.Heavy) { controller?.StartFeedbackPatternVibe(MLInputControllerFeedbackPatternVibe.Buzz, MLInputControllerFeedbackIntensity.High); } else if (expr == HapticExpression.Press) { controller?.StartFeedbackPatternVibe(MLInputControllerFeedbackPatternVibe.ForceDown, MLInputControllerFeedbackIntensity.Medium); } else if (expr == HapticExpression.Release) { controller?.StartFeedbackPatternVibe(MLInputControllerFeedbackPatternVibe.ForceUp, MLInputControllerFeedbackIntensity.Medium); } else if (expr == HapticExpression.SelectionChange) { controller?.StartFeedbackPatternVibe(MLInputControllerFeedbackPatternVibe.Tick, MLInputControllerFeedbackIntensity.Low); } else { base.Play(expr); } }
/// <summary> /// Retrieves an array of HapticPatternElements for a given HapticExpression instructs the /// device to play that pattern. /// </summary> /// <param name="device"> Device.</param> /// <param name="expression">Expression.</param> public static void Play(IHapticDevice device, HapticExpression expression) { if (device != null && expressions.ContainsKey(expression)) { device.Play(expressions[expression]); } }
/// <summary> /// Play a canned haptic pattern. /// </summary> /// <param name="expr"></param> public override void Play(HapticExpression expr) { if (controller != null) { if (expr == HapticExpression.Click) { controller.SendHapticFeedback(click); } else if (expr == HapticExpression.Press) { controller.SendHapticFeedback(press); } else if (expr == HapticExpression.Release) { controller.SendHapticFeedback(release); } else { base.Play(expr); } } }
/// <summary> /// Play a canned haptic pattern. /// </summary> /// <param name="expr"></param> public abstract void Play(HapticExpression expr);
/// <summary> /// Play a canned haptic pattern. /// </summary> /// <param name="expr"></param> public override void Play(HapticExpression expr) { HapticPatternElement.Play(this, expr); }
/// <summary> /// Performs no operation. /// </summary> public override void Play(HapticExpression expr) { }