![]() |
Murl Engine API
Version 2018.3
|
The IMusicPlayerControl interface. More...
#include <murl_i_music_player_control.h>
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.
Public Types | |
enum | MusicPlayer { PLAYER_NONE, PLAYER_APPLICATION, PLAYER_SYSTEM } |
Enumeration of the selected music player. More... | |
enum | PlaybackState { PLAYBACK_STOPPED, PLAYBACK_PLAYING, PLAYBACK_PAUSED, PLAYBACK_INTERRUPTED, PLAYBACK_SEEKING_FORWARD, PLAYBACK_SEEKING_BACKWARD } |
Enumeration of the playback state. More... | |
enum | RepeatMode { REPEAT_DEFAULT, REPEAT_NONE, REPEAT_ONE, REPEAT_ALL } |
Enumeration of the repeat mode. More... | |
enum | ShuffleMode { SHUFFLE_DEFAULT, SHUFFLE_OFF, SHUFFLE_SONGS, SHUFFLE_ALBUMS } |
Enumeration of the shuffle mode. More... | |
Public Member Functions | |
virtual Bool | SelectMusicPlayer (MusicPlayer musicPlayer)=0 |
Set the selected music player. More... | |
virtual MusicPlayer | GetSelectedMusicPlayer () const =0 |
Get the selected music player. More... | |
virtual Bool | ShowMediaPicker (Bool allowMultipleItems, const String &prompt)=0 |
Show the media item picker. More... | |
virtual Bool | IsMediaPickerShowing () const =0 |
Check if the media item picker is showing. More... | |
virtual Bool | Play ()=0 |
Initiates playback of the current item. More... | |
virtual Bool | Pause ()=0 |
Pauses playback of the current item. More... | |
virtual Bool | Stop ()=0 |
Ends playback of the current item. More... | |
virtual Bool | SkipToNextItem ()=0 |
Start playback of the next media item in the playback queue. More... | |
virtual Bool | SkipToBeginning ()=0 |
Restart playback at the beginning of the currently playing media item. More... | |
virtual Bool | SkipToPreviousItem ()=0 |
Start playback of the previous media item in the playback queue. More... | |
virtual Bool | BeginSeekingBackward ()=0 |
Begin seeking backward through the media content. More... | |
virtual Bool | BeginSeekingForward ()=0 |
Begin seeking forward through the media content. More... | |
virtual Bool | EndSeeking ()=0 |
End forward and backward seeking through the media content. More... | |
virtual Bool | HasPlaybackStateChanged (ChangeInspector &inspector) const =0 |
Check if the current playback state has changed. More... | |
virtual PlaybackState | GetPlaybackState () const =0 |
Get the current playback state. More... | |
virtual Double | GetCurrentPlaybackTime () const =0 |
Get the current playback time. More... | |
virtual Bool | HasCurrentItemChanged (ChangeInspector &inspector) const =0 |
Check if the current item has changed. More... | |
virtual String | GetCurrentTitle () const =0 |
Get the title of the current item. More... | |
virtual String | GetCurrentAlbumTitle () const =0 |
Get the album title of the current item. More... | |
virtual String | GetCurrentArtist () const =0 |
Get the artist of the current item. More... | |
virtual Double | GetCurrentDuration () const =0 |
Get the duration of the current item. More... | |
virtual Bool | SetRepeatMode (RepeatMode repeatMode)=0 |
Set the current repeat mode. More... | |
virtual RepeatMode | GetRepeatMode () const =0 |
Get the current repeat mode. More... | |
virtual Bool | SetShuffleMode (ShuffleMode shuffleMode)=0 |
Set the current shuffle mode. More... | |
virtual ShuffleMode | GetShuffleMode () const =0 |
Get the current shuffle mode. More... | |
![]() | |
virtual const String & | GetName () const =0 |
Get the controlable's name. More... | |
virtual void | FrameUpdate ()=0 |
Is executed in the platform thread context each frame tick. | |
virtual void | LogicUpdate ()=0 |
Is executed in the logic thread context each logic tick. | |
virtual void | ConfigChanged (const IAppConfiguration *appConfig)=0 |
Notification of changed configuration. More... | |
Enumeration of the selected music player.
Use SelectMusicPlayer() to select the current music player, see GetSelectedMusicPlayer() to get the current music player.
Enumerator | |
---|---|
PLAYER_NONE | No music player. |
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. |
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:
|
Enumeration of the playback state.
Use GetPlaybackState() to get the current playback state.
Enumeration of the repeat mode.
Use GetRepeatMode() to get the current repeat mode.
Enumeration of the shuffle mode.
Use GetShuffleMode() to get the current shuffle mode.
|
pure virtual |
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.
musicPlayer | The selected music player. |
|
pure virtual |
Get the selected music player.
|
pure virtual |
Show the media item picker.
The media item picker let a user choose media items from the device iPod library.
allowMultipleItems | Specify multiple (true) or single (false) selection behavior. |
prompt | A prompt for the user that appears above the navigation bar buttons. |
|
pure virtual |
Check if the media item picker is showing.
|
pure virtual |
Initiates playback of the current item.
|
pure virtual |
Pauses playback of the current item.
|
pure virtual |
Ends playback of the current item.
|
pure virtual |
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.
|
pure virtual |
Restart playback at the beginning of the currently playing media item.
|
pure virtual |
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.
|
pure virtual |
Begin seeking backward through the media content.
|
pure virtual |
Begin seeking forward through the media content.
|
pure virtual |
End forward and backward seeking through the media content.
|
pure virtual |
Check if the current playback state has changed.
inspector | The change inspector. |
|
pure virtual |
Get the current playback state.
|
pure virtual |
Get the current playback time.
|
pure virtual |
Check if the current item has changed.
If the current item has changed one or more of the following properties changed:
inspector | The change inspector. |
|
pure virtual |
Get the title of the current item.
|
pure virtual |
Get the album title of the current item.
|
pure virtual |
Get the artist of the current item.
|
pure virtual |
Get the duration of the current item.
|
pure virtual |
Set the current repeat mode.
repeatMode | The current repeat mode. |
|
pure virtual |
Get the current repeat mode.
|
pure virtual |
Set the current shuffle mode.
shuffleMode | The current shuffle mode. |
|
pure virtual |
Get the current shuffle mode.