Package apple.mediaplayer
Class MPMusicPlayerController
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.mediaplayer.MPMusicPlayerController
-
- All Implemented Interfaces:
MPMediaPlayback,NSObject
- Direct Known Subclasses:
MPMusicPlayerApplicationController
public class MPMusicPlayerController extends NSObject implements MPMediaPlayback
MPMusicPlayerController allows playback of MPMediaItems through the Music application. See MPMediaPlayback.h for basic playback control.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceMPMusicPlayerController.Block_prepareToPlayWithCompletionHandler-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMPMusicPlayerController(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static booleanaccessInstanceVariablesDirectly()static MPMusicPlayerControlleralloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)voidappendQueueDescriptor(MPMusicPlayerQueueDescriptor descriptor)Adds the contents of the queue descriptor to the end of the queuestatic MPMusicPlayerControllerapplicationMusicPlayer()Playing items with applicationMusicPlayer does not affect Music's playback state.static MPMusicPlayerApplicationControllerapplicationQueuePlayer()Similar to applicationMusicPlayer, but allows direct manipulation of the queue.static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)voidbeginGeneratingPlaybackNotifications()These methods determine whether playback notifications will be generated.voidbeginSeekingBackward()voidbeginSeekingForward()The seeking rate will increase the longer scanning is active.static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)static NSArray<java.lang.String>classFallbacksForKeyedArchiver()static org.moe.natj.objc.ClassclassForKeyedUnarchiver()floatcurrentPlaybackRate()The current playback rate of the now playing item.doublecurrentPlaybackTime()The current playback time of the now playing item in seconds.static java.lang.StringdebugDescription_static()static java.lang.Stringdescription_static()voidendGeneratingPlaybackNotifications()voidendSeeking()static longhash_static()longindexOfNowPlayingItem()Returns the index of the now playing item in the current playback queue.MPMusicPlayerControllerinit()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)static MPMusicPlayerControlleriPodMusicPlayer()Deprecated.booleanisPreparedToPlay()Returns YES if prepared for playback.static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)static java.lang.Objectnew_objc()MPMediaItemnowPlayingItem()Returns the currently playing media item, or nil if none is playing.voidpause()Pauses playback if playing.voidplay()Plays items from the current queue, resuming paused playback if possible.longplaybackState()Returns the current playback state of the music playervoidprepareToPlay()Prepares the current queue for playback, interrupting any active (non-mixible) audio sessions.voidprepareToPlayWithCompletionHandler(MPMusicPlayerController.Block_prepareToPlayWithCompletionHandler completionHandler)The completion handler will be called when the first item from the queue is buffered and ready to play.voidprependQueueDescriptor(MPMusicPlayerQueueDescriptor descriptor)Inserts the contents of the queue descriptor after the now playing itemlongrepeatMode()Determines how music repeats after playback completes.static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)voidsetCurrentPlaybackRate(float value)The current playback rate of the now playing item.voidsetCurrentPlaybackTime(double value)The current playback time of the now playing item in seconds.voidsetNowPlayingItem(MPMediaItem value)Returns the currently playing media item, or nil if none is playing.voidsetQueueWithDescriptor(MPMusicPlayerQueueDescriptor descriptor)voidsetQueueWithItemCollection(MPMediaItemCollection itemCollection)voidsetQueueWithQuery(MPMediaQuery query)Call -play to begin playback after setting an item queue source.voidsetQueueWithStoreIDs(NSArray<java.lang.String> storeIDs)voidsetRepeatMode(long value)Determines how music repeats after playback completes.voidsetShuffleMode(long value)Determines how music is shuffled when playing.static voidsetVersion_static(long aVersion)voidsetVolume(float value)Deprecated.longshuffleMode()Determines how music is shuffled when playing.voidskipToBeginning()Restarts playback at the beginning of the currently playing media item.voidskipToNextItem()Skips to the next item in the queue.voidskipToPreviousItem()Skips to the previous item in the queue.voidstop()Ends playback.static org.moe.natj.objc.Classsuperclass_static()static MPMusicPlayerControllersystemMusicPlayer()Playing media items with the systemMusicPlayer will replace the user's current Music state.static longversion_static()floatvolume()Deprecated.-
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 MPMusicPlayerController alloc()
-
allocWithZone
public static java.lang.Object allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
applicationMusicPlayer
public static MPMusicPlayerController applicationMusicPlayer()
Playing items with applicationMusicPlayer does not affect Music's playback state.
-
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)
-
classFallbacksForKeyedArchiver
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
-
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()
-
iPodMusicPlayer
@Deprecated public static MPMusicPlayerController iPodMusicPlayer()
Deprecated.
-
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)
-
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()
-
resolveClassMethod
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
-
resolveInstanceMethod
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
-
setVersion_static
public static void setVersion_static(long aVersion)
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
systemMusicPlayer
public static MPMusicPlayerController systemMusicPlayer()
Playing media items with the systemMusicPlayer will replace the user's current Music state.
-
version_static
public static long version_static()
-
beginGeneratingPlaybackNotifications
public void beginGeneratingPlaybackNotifications()
These methods determine whether playback notifications will be generated. Calls to begin/endGeneratingPlaybackNotifications are nestable.
-
beginSeekingBackward
public void beginSeekingBackward()
- Specified by:
beginSeekingBackwardin interfaceMPMediaPlayback
-
beginSeekingForward
public void beginSeekingForward()
Description copied from interface:MPMediaPlaybackThe seeking rate will increase the longer scanning is active.- Specified by:
beginSeekingForwardin interfaceMPMediaPlayback
-
currentPlaybackRate
public float currentPlaybackRate()
Description copied from interface:MPMediaPlaybackThe current playback rate of the now playing item. Default is 1.0 (normal speed). Pausing will set the rate to 0.0. Setting the rate to non-zero implies playing.- Specified by:
currentPlaybackRatein interfaceMPMediaPlayback
-
currentPlaybackTime
public double currentPlaybackTime()
Description copied from interface:MPMediaPlaybackThe current playback time of the now playing item in seconds.- Specified by:
currentPlaybackTimein interfaceMPMediaPlayback
-
endGeneratingPlaybackNotifications
public void endGeneratingPlaybackNotifications()
-
endSeeking
public void endSeeking()
- Specified by:
endSeekingin interfaceMPMediaPlayback
-
indexOfNowPlayingItem
public long indexOfNowPlayingItem()
Returns the index of the now playing item in the current playback queue. May return NSNotFound if the index is not valid (e.g. an empty queue or an infinite playlist).
-
init
public MPMusicPlayerController init()
-
isPreparedToPlay
public boolean isPreparedToPlay()
Description copied from interface:MPMediaPlaybackReturns YES if prepared for playback.- Specified by:
isPreparedToPlayin interfaceMPMediaPlayback
-
nowPlayingItem
public MPMediaItem nowPlayingItem()
Returns the currently playing media item, or nil if none is playing. Setting the nowPlayingItem to an item in the current queue will begin playback at that item.
-
pause
public void pause()
Description copied from interface:MPMediaPlaybackPauses playback if playing.- Specified by:
pausein interfaceMPMediaPlayback
-
play
public void play()
Description copied from interface:MPMediaPlaybackPlays items from the current queue, resuming paused playback if possible.- Specified by:
playin interfaceMPMediaPlayback
-
playbackState
public long playbackState()
Returns the current playback state of the music player
-
prepareToPlay
public void prepareToPlay()
Description copied from interface:MPMediaPlaybackPrepares the current queue for playback, interrupting any active (non-mixible) audio sessions. Automatically invoked when -play is called if the player is not already prepared.- Specified by:
prepareToPlayin interfaceMPMediaPlayback
-
prepareToPlayWithCompletionHandler
public void prepareToPlayWithCompletionHandler(MPMusicPlayerController.Block_prepareToPlayWithCompletionHandler completionHandler)
The completion handler will be called when the first item from the queue is buffered and ready to play. If a first item has been specified using MPMusicPlayerQueueDescriptor, the error will be non-nil if the specified item cannot be prepared for playback. If a first item is not specified, the error will be non-nil if an item cannot be prepared for playback. Errors will be in MPErrorDomain.
-
repeatMode
public long repeatMode()
Determines how music repeats after playback completes. Defaults to MPMusicRepeatModeDefault.
-
setCurrentPlaybackRate
public void setCurrentPlaybackRate(float value)
Description copied from interface:MPMediaPlaybackThe current playback rate of the now playing item. Default is 1.0 (normal speed). Pausing will set the rate to 0.0. Setting the rate to non-zero implies playing.- Specified by:
setCurrentPlaybackRatein interfaceMPMediaPlayback
-
setCurrentPlaybackTime
public void setCurrentPlaybackTime(double value)
Description copied from interface:MPMediaPlaybackThe current playback time of the now playing item in seconds.- Specified by:
setCurrentPlaybackTimein interfaceMPMediaPlayback
-
setNowPlayingItem
public void setNowPlayingItem(MPMediaItem value)
Returns the currently playing media item, or nil if none is playing. Setting the nowPlayingItem to an item in the current queue will begin playback at that item.
-
setQueueWithDescriptor
public void setQueueWithDescriptor(MPMusicPlayerQueueDescriptor descriptor)
-
setQueueWithItemCollection
public void setQueueWithItemCollection(MPMediaItemCollection itemCollection)
-
setQueueWithQuery
public void setQueueWithQuery(MPMediaQuery query)
Call -play to begin playback after setting an item queue source. Setting a query will implicitly use MPMediaGroupingTitle.
-
setQueueWithStoreIDs
public void setQueueWithStoreIDs(NSArray<java.lang.String> storeIDs)
-
setRepeatMode
public void setRepeatMode(long value)
Determines how music repeats after playback completes. Defaults to MPMusicRepeatModeDefault.
-
setShuffleMode
public void setShuffleMode(long value)
Determines how music is shuffled when playing. Defaults to MPMusicShuffleModeDefault.
-
setVolume
@Deprecated public void setVolume(float value)
Deprecated.The current volume of playing music, in the range of 0.0 to 1.0. This property is deprecated -- use MPVolumeView for volume control instead.
-
shuffleMode
public long shuffleMode()
Determines how music is shuffled when playing. Defaults to MPMusicShuffleModeDefault.
-
skipToBeginning
public void skipToBeginning()
Restarts playback at the beginning of the currently playing media item.
-
skipToNextItem
public void skipToNextItem()
Skips to the next item in the queue. If already at the last item, this resets the queue to the first item in a paused playback state.
-
skipToPreviousItem
public void skipToPreviousItem()
Skips to the previous item in the queue. If already at the first item, this will end playback.
-
stop
public void stop()
Description copied from interface:MPMediaPlaybackEnds playback. Calling -play again will start from the beginnning of the queue.- Specified by:
stopin interfaceMPMediaPlayback
-
volume
@Deprecated public float volume()
Deprecated.The current volume of playing music, in the range of 0.0 to 1.0. This property is deprecated -- use MPVolumeView for volume control instead.
-
appendQueueDescriptor
public void appendQueueDescriptor(MPMusicPlayerQueueDescriptor descriptor)
Adds the contents of the queue descriptor to the end of the queue
-
applicationQueuePlayer
public static MPMusicPlayerApplicationController applicationQueuePlayer()
Similar to applicationMusicPlayer, but allows direct manipulation of the queue.
-
prependQueueDescriptor
public void prependQueueDescriptor(MPMusicPlayerQueueDescriptor descriptor)
Inserts the contents of the queue descriptor after the now playing item
-
-