Package apple.corehaptics
Class CHHapticEngine
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.corehaptics.CHHapticEngine
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceCHHapticEngine.Block_notifyWhenPlayersFinishedstatic interfaceCHHapticEngine.Block_resetHandler_retstatic interfaceCHHapticEngine.Block_setResetHandlerstatic interfaceCHHapticEngine.Block_setStoppedHandlerstatic interfaceCHHapticEngine.Block_startWithCompletionHandlerstatic interfaceCHHapticEngine.Block_stoppedHandler_retstatic interfaceCHHapticEngine.Block_stopWithCompletionHandler-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCHHapticEngine(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanaccessInstanceVariablesDirectly()static CHHapticEnginealloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)static CHHapticDeviceCapabilitycapabilitiesForHardware()capabilitiesForHardware Get the protocol that describes haptic and audio capabilities on this device.static NSArray<java.lang.String>classFallbacksForKeyedArchiver()static org.moe.natj.objc.ClassclassForKeyedUnarchiver()CHHapticAdvancedPatternPlayercreateAdvancedPlayerWithPatternError(CHHapticPattern pattern, org.moe.natj.general.ptr.Ptr<NSError> outError)createAdvancedPlayerWithPattern:error Factory method for creating a CHHapticAdvancedPatternPlayer from a CHHapticPattern.CHHapticPatternPlayercreatePlayerWithPatternError(CHHapticPattern pattern, org.moe.natj.general.ptr.Ptr<NSError> outError)createPlayerWithPattern:error Factory method for creating a CHHapticPatternPlayer from a CHHapticPattern.doublecurrentTime()[@property] currentTime The absolute time from which all current and future event times may be calculated.static java.lang.StringdebugDescription_static()static java.lang.Stringdescription_static()static longhash_static()CHHapticEngineinit()CHHapticEngineinitAndReturnError(org.moe.natj.general.ptr.Ptr<NSError> error)initAndReturnError: Create an instance of the CHHapticEngine.CHHapticEngineinitWithAudioSessionError(AVAudioSession audioSession, org.moe.natj.general.ptr.Ptr<NSError> error)initWithAudioSession:error Create an instance of an CHHapticEngine and associate it with an audio session.static NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)booleanisAutoShutdownEnabled()[@property] autoShutdownEnabled When auto shutdown is enabled, the haptic engine can start and stop the hardware dynamically, to conserve power.booleanisMutedForAudio()[@property] isMutedForAudio When set to YES, the CHHapticEngine mutes audio playback from its players.booleanisMutedForHaptics()[@property] isMutedForHaptics When set to YES, the CHHapticEngine mutes haptic playback from its players.static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)static java.lang.Objectnew_objc()voidnotifyWhenPlayersFinished(CHHapticEngine.Block_notifyWhenPlayersFinished finishedHandler)notifyWhenPlayersFinished: Tell the engine to asynchronously call the passed-in handler when all active pattern players associated with this engine have stopped.booleanplayPatternFromDataError(NSData data, org.moe.natj.general.ptr.Ptr<NSError> outError)playPatternFromData:error Simple one-shot call to play a pattern specified by NSData.booleanplayPatternFromURLError(NSURL fileURL, org.moe.natj.general.ptr.Ptr<NSError> outError)playPatternFromURL:error Simple one-shot call to play a pattern specified by a URL.booleanplaysHapticsOnly()[@property] playsHapticsOnly If set to YES, the CHHapticEngine will ignore all events of type CHHapticEventTypeAudio and play only haptic events.longregisterAudioResourceOptionsError(NSURL resourceURL, NSDictionary<?,?> options, org.moe.natj.general.ptr.Ptr<NSError> outError)registerAudioResource:options:error Register an external audio file for use as a custom waveform.CHHapticEngine.Block_resetHandler_retresetHandler()[@property] resetHandler This block will called asynchronously if the haptic engine has to reset itself after a server failure.static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)voidsetAutoShutdownEnabled(boolean value)[@property] autoShutdownEnabled When auto shutdown is enabled, the haptic engine can start and stop the hardware dynamically, to conserve power.voidsetIsMutedForAudio(boolean value)[@property] isMutedForAudio When set to YES, the CHHapticEngine mutes audio playback from its players.voidsetIsMutedForHaptics(boolean value)[@property] isMutedForHaptics When set to YES, the CHHapticEngine mutes haptic playback from its players.voidsetPlaysHapticsOnly(boolean value)[@property] playsHapticsOnly If set to YES, the CHHapticEngine will ignore all events of type CHHapticEventTypeAudio and play only haptic events.voidsetResetHandler(CHHapticEngine.Block_setResetHandler value)[@property] resetHandler This block will called asynchronously if the haptic engine has to reset itself after a server failure.voidsetStoppedHandler(CHHapticEngine.Block_setStoppedHandler value)[@property] stoppedHandler The engine will call this block when it has stopped due to external causes (such as an audio session interruption or the app going into the background).static voidsetVersion_static(long aVersion)booleanstartAndReturnError(org.moe.natj.general.ptr.Ptr<NSError> outError)startAndReturnError: Start the engine and block until the engine has started.voidstartWithCompletionHandler(CHHapticEngine.Block_startWithCompletionHandler completionHandler)startWithCompletionHandler: Asynchronously start the engine.CHHapticEngine.Block_stoppedHandler_retstoppedHandler()[@property] stoppedHandler The engine will call this block when it has stopped due to external causes (such as an audio session interruption or the app going into the background).voidstopWithCompletionHandler(CHHapticEngine.Block_stopWithCompletionHandler completionHandler)stopWithCompletionHandler: Asynchronously stop the engine.static org.moe.natj.objc.Classsuperclass_static()booleanunregisterAudioResourceError(long resourceID, org.moe.natj.general.ptr.Ptr<NSError> outError)unregisterAudioResource:error Unregister and remove a previously-registered audio resource.static longversion_static()-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
alloc
public static CHHapticEngine alloc()
-
allocWithZone
public static java.lang.Object allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)
-
capabilitiesForHardware
public static CHHapticDeviceCapability capabilitiesForHardware()
capabilitiesForHardware Get the protocol that describes haptic and audio capabilities on this device. Detailed description on the capability protocol is in CHHapticDeviceCapability.h.
-
classFallbacksForKeyedArchiver
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
-
createAdvancedPlayerWithPatternError
public CHHapticAdvancedPatternPlayer createAdvancedPlayerWithPatternError(CHHapticPattern pattern, org.moe.natj.general.ptr.Ptr<NSError> outError)
createAdvancedPlayerWithPattern:error Factory method for creating a CHHapticAdvancedPatternPlayer from a CHHapticPattern.- Parameters:
pattern- The pattern to be played.
-
createPlayerWithPatternError
public CHHapticPatternPlayer createPlayerWithPatternError(CHHapticPattern pattern, org.moe.natj.general.ptr.Ptr<NSError> outError)
createPlayerWithPattern:error Factory method for creating a CHHapticPatternPlayer from a CHHapticPattern.- Parameters:
pattern- The pattern to be played.
-
currentTime
public double currentTime()
[@property] currentTime The absolute time from which all current and future event times may be calculated. The units are seconds.
-
debugDescription_static
public static java.lang.String debugDescription_static()
-
description_static
public static java.lang.String description_static()
-
hash_static
public static long hash_static()
-
init
public CHHapticEngine init()
-
initAndReturnError
public CHHapticEngine initAndReturnError(org.moe.natj.general.ptr.Ptr<NSError> error)
initAndReturnError: Create an instance of the CHHapticEngine. More than one instance may exist within a process. Each will function independently of the others. CHHapticEngines created using this method will be associated with the device's internal haptics hardware system, if one exists. For systems without internal haptics, this method will fail with the error `CHHapticErrorCodeNotSupported`. To access engine instances associated with external game controllers, see the GameController framework documentation for the `hapticEngines` property on the GCController class.
-
initWithAudioSessionError
public CHHapticEngine initWithAudioSessionError(AVAudioSession audioSession, org.moe.natj.general.ptr.Ptr<NSError> error)
initWithAudioSession:error Create an instance of an CHHapticEngine and associate it with an audio session. If 'audioSession' is nil, the engine will create its own. More than one instance may exist within a process. Each will function independently of the others, but all CHHapticEngines which share an audio session will have identical audio behavior with regard to interruptions, etc. CHHapticEngines created using this method will be associated with the device's internal haptics hardware system, if one exists. For systems without internal haptics, this method will fail with the error `CHHapticErrorCodeNotSupported`. To access engine instances associated with external game controllers, see the GameController framework documentation for the `hapticEngines` property on the GCController class.
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
instanceMethodSignatureForSelector
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
-
instancesRespondToSelector
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
-
isAutoShutdownEnabled
public boolean isAutoShutdownEnabled()
[@property] autoShutdownEnabled When auto shutdown is enabled, the haptic engine can start and stop the hardware dynamically, to conserve power. To conserve power, it is advised that the client stop the haptic engine when not in use. But when auto shutdown is enabled, the haptic engine will stop the hardware if it was running idle for a certain duration, and restart it later when required. Note that, because this operation is dynamic, it may affect the start times of the pattern players (e.g. `CHHapticPatternplayer`), if the engine has to resume from its shutdown state. This feature is disabled by default, but the client can enable it if needed.
-
isMutedForAudio
public boolean isMutedForAudio()
[@property] isMutedForAudio When set to YES, the CHHapticEngine mutes audio playback from its players. Default is NO.
-
isMutedForHaptics
public boolean isMutedForHaptics()
[@property] isMutedForHaptics When set to YES, the CHHapticEngine mutes haptic playback from its players. Default is NO.
-
isSubclassOfClass
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
-
keyPathsForValuesAffectingValueForKey
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
-
new_objc
public static java.lang.Object new_objc()
-
notifyWhenPlayersFinished
public void notifyWhenPlayersFinished(CHHapticEngine.Block_notifyWhenPlayersFinished finishedHandler)
notifyWhenPlayersFinished: Tell the engine to asynchronously call the passed-in handler when all active pattern players associated with this engine have stopped. If additional players are started after this call is made, they will delay the callback. If no players are active or the engine is stopped, the callback will happen immediately.- Parameters:
finishedHandler- The block that will be called asynchronously. The return value of this block determines the action the engine will take when the block finishes (see `CHHapticEngineFinishedHandler`).
-
playPatternFromDataError
public boolean playPatternFromDataError(NSData data, org.moe.natj.general.ptr.Ptr<NSError> outError)
playPatternFromData:error Simple one-shot call to play a pattern specified by NSData. The engine should be started prior to calling this method if low latency is desired. If this is not done, this method will start it, which can cause a significant delay.- Parameters:
data- The NSData containing a haptic/audio pattern dictionary.outError- If the operation fails, this will be set to a valid NSError describing the error.
-
playPatternFromURLError
public boolean playPatternFromURLError(NSURL fileURL, org.moe.natj.general.ptr.Ptr<NSError> outError)
playPatternFromURL:error Simple one-shot call to play a pattern specified by a URL. The engine should be started prior to calling this method if low latency is desired. If this is not done, this method will start it, which can cause a significant delay.- Parameters:
fileURL- The URL of the file containing a haptic/audio pattern dictionary.outError- If the operation fails, this will be set to a valid NSError describing the error.
-
playsHapticsOnly
public boolean playsHapticsOnly()
[@property] playsHapticsOnly If set to YES, the CHHapticEngine will ignore all events of type CHHapticEventTypeAudio and play only haptic events. This behavior change will only take effect after the engine is stopped and restarted. The default is NO.
-
registerAudioResourceOptionsError
public long registerAudioResourceOptionsError(NSURL resourceURL, NSDictionary<?,?> options, org.moe.natj.general.ptr.Ptr<NSError> outError)
registerAudioResource:options:error Register an external audio file for use as a custom waveform.- Parameters:
resourceURL- A URL referencing the location of the audio file to be registered.options- A dictionary containing key/value pairs describing how this resource should be played.outError- If register operation fails, this will be set to a valid NSError describing the error.
-
resetHandler
public CHHapticEngine.Block_resetHandler_ret resetHandler()
[@property] resetHandler This block will called asynchronously if the haptic engine has to reset itself after a server failure. In response to this handler being called, the client must release all haptic pattern players and recreate them. All CHHapticPattern objects and CHHapticEngine properties will have been preserved. In general, callbacks arrive on a non-main thread and it is the client's responsibility to handle it in a thread-safe manner.
-
resolveClassMethod
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
-
resolveInstanceMethod
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
-
setAutoShutdownEnabled
public void setAutoShutdownEnabled(boolean value)
[@property] autoShutdownEnabled When auto shutdown is enabled, the haptic engine can start and stop the hardware dynamically, to conserve power. To conserve power, it is advised that the client stop the haptic engine when not in use. But when auto shutdown is enabled, the haptic engine will stop the hardware if it was running idle for a certain duration, and restart it later when required. Note that, because this operation is dynamic, it may affect the start times of the pattern players (e.g. `CHHapticPatternplayer`), if the engine has to resume from its shutdown state. This feature is disabled by default, but the client can enable it if needed.
-
setIsMutedForAudio
public void setIsMutedForAudio(boolean value)
[@property] isMutedForAudio When set to YES, the CHHapticEngine mutes audio playback from its players. Default is NO.
-
setIsMutedForHaptics
public void setIsMutedForHaptics(boolean value)
[@property] isMutedForHaptics When set to YES, the CHHapticEngine mutes haptic playback from its players. Default is NO.
-
setPlaysHapticsOnly
public void setPlaysHapticsOnly(boolean value)
[@property] playsHapticsOnly If set to YES, the CHHapticEngine will ignore all events of type CHHapticEventTypeAudio and play only haptic events. This behavior change will only take effect after the engine is stopped and restarted. The default is NO.
-
setResetHandler
public void setResetHandler(CHHapticEngine.Block_setResetHandler value)
[@property] resetHandler This block will called asynchronously if the haptic engine has to reset itself after a server failure. In response to this handler being called, the client must release all haptic pattern players and recreate them. All CHHapticPattern objects and CHHapticEngine properties will have been preserved. In general, callbacks arrive on a non-main thread and it is the client's responsibility to handle it in a thread-safe manner.
-
setStoppedHandler
public void setStoppedHandler(CHHapticEngine.Block_setStoppedHandler value)
[@property] stoppedHandler The engine will call this block when it has stopped due to external causes (such as an audio session interruption or the app going into the background). It will NOT be called if the client calls stopWithCompletionHandler:. In general, callbacks arrive on a non-main thread and it is the client's responsibility to handle it in a thread-safe manner.
-
setVersion_static
public static void setVersion_static(long aVersion)
-
startAndReturnError
public boolean startAndReturnError(org.moe.natj.general.ptr.Ptr<NSError> outError)
startAndReturnError: Start the engine and block until the engine has started. This method will return NO upon failure, and outError will be set to a valid NSError describing the error.
-
startWithCompletionHandler
public void startWithCompletionHandler(CHHapticEngine.Block_startWithCompletionHandler completionHandler)
startWithCompletionHandler: Asynchronously start the engine. The handler will be called when the operation completes. The handler is guaranteed to be called on either success or failure.
-
stopWithCompletionHandler
public void stopWithCompletionHandler(CHHapticEngine.Block_stopWithCompletionHandler completionHandler)
stopWithCompletionHandler: Asynchronously stop the engine. The handler will be called when the operation completes. The handler is guaranteed to be called on either success or failure.
-
stoppedHandler
public CHHapticEngine.Block_stoppedHandler_ret stoppedHandler()
[@property] stoppedHandler The engine will call this block when it has stopped due to external causes (such as an audio session interruption or the app going into the background). It will NOT be called if the client calls stopWithCompletionHandler:. In general, callbacks arrive on a non-main thread and it is the client's responsibility to handle it in a thread-safe manner.
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
unregisterAudioResourceError
public boolean unregisterAudioResourceError(long resourceID, org.moe.natj.general.ptr.Ptr<NSError> outError)unregisterAudioResource:error Unregister and remove a previously-registered audio resource.- Parameters:
resourceID- The resource ID that was returned when the resource was registered.outError- If the unregister operation fails, this will be set to a valid NSError describing the error.
-
version_static
public static long version_static()
-
-