The IMusicPlayerControl interface. More...
#include "murl_i_music_player_control.h"
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... | |
Public Member Functions inherited from Murl::IControlable | |
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... | |
Detailed Description
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.
Member Enumeration Documentation
◆ MusicPlayer
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:
|
◆ PlaybackState
Enumeration of the playback state.
Use GetPlaybackState() to get the current playback state.
◆ RepeatMode
Enumeration of the repeat mode.
Use GetRepeatMode() to get the current repeat mode.
◆ ShuffleMode
Enumeration of the shuffle mode.
Use GetShuffleMode() to get the current shuffle mode.
Member Function Documentation
◆ SelectMusicPlayer()
|
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.
- Parameters
-
musicPlayer The selected music player.
- Returns
- true if successful.
◆ GetSelectedMusicPlayer()
|
pure virtual |
Get the selected music player.
- Returns
- The selected music player.
◆ ShowMediaPicker()
|
pure virtual |
Show the media item picker.
The media item picker let a user choose media items from the device iPod library.
- Parameters
-
allowMultipleItems Specify multiple (true) or single (false) selection behavior. prompt A prompt for the user that appears above the navigation bar buttons.
- Returns
- true if successful.
◆ IsMediaPickerShowing()
|
pure virtual |
Check if the media item picker is showing.
- Returns
- true if the media item picker is showing.
◆ Play()
|
pure virtual |
Initiates playback of the current item.
- Returns
- true if successful.
◆ Pause()
|
pure virtual |
Pauses playback of the current item.
- Returns
- true if successful.
◆ Stop()
|
pure virtual |
Ends playback of the current item.
- Returns
- true if successful.
◆ SkipToNextItem()
|
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.
- Returns
- true if successful.
◆ SkipToBeginning()
|
pure virtual |
Restart playback at the beginning of the currently playing media item.
- Returns
- true if successful.
◆ SkipToPreviousItem()
|
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.
- Returns
- true if successful.
◆ BeginSeekingBackward()
|
pure virtual |
Begin seeking backward through the media content.
- Returns
- true if successful.
◆ BeginSeekingForward()
|
pure virtual |
Begin seeking forward through the media content.
- Returns
- true if successful.
◆ EndSeeking()
|
pure virtual |
End forward and backward seeking through the media content.
- Returns
- true if successful.
◆ HasPlaybackStateChanged()
|
pure virtual |
Check if the current playback state has changed.
- Parameters
-
inspector The change inspector.
- Returns
- true if the current playback state has changed.
◆ GetPlaybackState()
|
pure virtual |
Get the current playback state.
- Returns
- The current playback state.
◆ GetCurrentPlaybackTime()
|
pure virtual |
Get the current playback time.
- Returns
- The current playback time in seconds.
◆ HasCurrentItemChanged()
|
pure virtual |
Check if the current item has changed.
If the current item has changed one or more of the following properties changed:
- The title (see GetCurrentTitle())
- The album title (see GetCurrentAlbumTitle())
- The artist (see GetCurrentArtist())
- The duration (see GetCurrentDuration())
- Parameters
-
inspector The change inspector.
- Returns
- true if the current item has changed.
◆ GetCurrentTitle()
|
pure virtual |
Get the title of the current item.
- Returns
- The title of the current item.
◆ GetCurrentAlbumTitle()
|
pure virtual |
Get the album title of the current item.
- Returns
- The album title of the current item.
◆ GetCurrentArtist()
|
pure virtual |
Get the artist of the current item.
- Returns
- The artist of the current item.
◆ GetCurrentDuration()
|
pure virtual |
Get the duration of the current item.
- Returns
- The duration of the current item in seconds.
◆ SetRepeatMode()
|
pure virtual |
Set the current repeat mode.
- Parameters
-
repeatMode The current repeat mode.
- Returns
- true if successful.
◆ GetRepeatMode()
|
pure virtual |
Get the current repeat mode.
- Returns
- The current repeat mode.
◆ SetShuffleMode()
|
pure virtual |
Set the current shuffle mode.
- Parameters
-
shuffleMode The current shuffle mode.
- Returns
- true if successful.
◆ GetShuffleMode()
|
pure virtual |
Get the current shuffle mode.
- Returns
- The current shuffle mode.
The documentation for this interface was generated from the following file:
- murl_i_music_player_control.h