![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
The IMusicPlayerControl interface.
The music player's audio session category can be setup by the IEngineConfiguration::SetAudioSessionCategory() during IApp::Configure().
If the configured category is IEnums::AUDIO_SESSION_CATEGORY_DEFAULT the category IEnums::AUDIO_SESSION_CATEGORY_MIX_AMBIENT is used when selecting a music player.
The music player control is currently supported on iOS only.
Enumeration of the selected music player. Use SelectMusicPlayer() to select the current music player, see GetSelectedMusicPlayer() to get the current music player.
Murl.IMusicPlayerControl.PLAYER_NONE | No music player. |
Murl.IMusicPlayerControl.PLAYER_APPLICATION | The application music player plays music locally within your app. It does not affect the iPod state. When your app moves to the background, the music player stops if it was playing. |
Murl.IMusicPlayerControl.PLAYER_SYSTEM | The system (iPod) music player employs the iPod app on your behalf. Music that is playing continues to play when your app moves to the background. On instantiation, it takes on the current iPod app state and controls that state. Specifically, the shared state includes the following: - Repeat mode (see GetRepeatMode()) - Shuffle mode (see GetShuffleMode()) - Current now-playing item (see HasCurrentItemChanged()) - Playback state (see GetPlaybackState()) |
Enumeration of the playback state. Use GetPlaybackState() to get the current playback state.
Murl.IMusicPlayerControl.PLAYBACK_STOPPED | The music player is stopped. |
Murl.IMusicPlayerControl.PLAYBACK_PLAYING | The music player is playing. |
Murl.IMusicPlayerControl.PLAYBACK_PAUSED | The music player is paused. |
Murl.IMusicPlayerControl.PLAYBACK_INTERRUPTED | The music player has been interrupted, such as by an incoming phone call. |
Murl.IMusicPlayerControl.PLAYBACK_SEEKING_FORWARD | The music player is seeking forward. |
Murl.IMusicPlayerControl.PLAYBACK_SEEKING_BACKWARD | The music player is seeking backward. |
Enumeration of the repeat mode. Use GetRepeatMode() to get the current repeat mode.
Murl.IMusicPlayerControl.REPEAT_DEFAULT | The user’s preferred repeat mode. |
Murl.IMusicPlayerControl.REPEAT_NONE | The music player will not repeat the current song or playlist. |
Murl.IMusicPlayerControl.REPEAT_ONE | The music player will repeat the current song. |
Murl.IMusicPlayerControl.REPEAT_ALL | The music player will repeat the current playlist. |
Enumeration of the shuffle mode. Use GetShuffleMode() to get the current shuffle mode.
Murl.IMusicPlayerControl.SHUFFLE_DEFAULT | The user’s preferred shuffle mode. |
Murl.IMusicPlayerControl.SHUFFLE_OFF | The playlist is not shuffled. |
Murl.IMusicPlayerControl.SHUFFLE_SONGS | The playlist is shuffled by song. |
Murl.IMusicPlayerControl.SHUFFLE_ALBUMS | The playlist is shuffled by album. |
Set the selected music player. Changing between application and system player during runtime is not properly supported by iOS, once a player is selected it should not change until the app is restarted.
Boolean SelectMusicPlayer(Murl.IMusicPlayerControl.MusicPlayer musicPlayer)
musicPlayer | The selected music player. |
Get the selected music player.
Murl.IMusicPlayerControl.MusicPlayer GetSelectedMusicPlayer()
Show the media item picker. The media item picker let a user choose media items from the device iPod library.
Boolean ShowMediaPicker(Boolean allowMultipleItems, String prompt)
allowMultipleItems | Specify multiple (true) or single (false) selection behavior. |
prompt | A prompt for the user that appears above the navigation bar buttons. |
Check if the media item picker is showing.
Boolean IsMediaPickerShowing()
Initiates playback of the current item.
Boolean Play()
Pauses playback of the current item.
Boolean Pause()
Ends playback of the current item.
Boolean Stop()
Start playback of the next media item in the playback queue. If the music player is not playing the next media item is designated as the next to be played.
Boolean SkipToNextItem()
Restart playback at the beginning of the currently playing media item.
Boolean SkipToBeginning()
Start playback of the previous media item in the playback queue. If the music player is not playing the previous media item is designated as the next to be played.
Boolean SkipToPreviousItem()
Begin seeking backward through the media content.
Boolean BeginSeekingBackward()
Begin seeking forward through the media content.
Boolean BeginSeekingForward()
End forward and backward seeking through the media content.
Boolean EndSeeking()
Check if the current playback state has changed.
Boolean, Murl.ChangeInspector HasPlaybackStateChanged(Murl.ChangeInspector inspector)
inspector | The change inspector. |
Get the current playback state.
Murl.IMusicPlayerControl.PlaybackState GetPlaybackState()
Get the current playback time.
Number GetCurrentPlaybackTime()
Check if the current item has changed. If the current item has changed one or more of the following properties changed:
Boolean, Murl.ChangeInspector HasCurrentItemChanged(Murl.ChangeInspector inspector)
inspector | The change inspector. |
Get the title of the current item.
String GetCurrentTitle()
Get the album title of the current item.
String GetCurrentAlbumTitle()
Get the artist of the current item.
String GetCurrentArtist()
Get the duration of the current item.
Number GetCurrentDuration()
Set the current repeat mode.
Boolean SetRepeatMode(Murl.IMusicPlayerControl.RepeatMode repeatMode)
repeatMode | The current repeat mode. |
Get the current repeat mode.
Murl.IMusicPlayerControl.RepeatMode GetRepeatMode()
Set the current shuffle mode.
Boolean SetShuffleMode(Murl.IMusicPlayerControl.ShuffleMode shuffleMode)
shuffleMode | The current shuffle mode. |
Get the current shuffle mode.
Murl.IMusicPlayerControl.ShuffleMode GetShuffleMode()