YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.player.Player Interface Reference

A Player is able to play stop a couple of MediaObjects. More...

Inheritance diagram for de.yaacc.player.Player:
Inheritance graph
Collaboration diagram for de.yaacc.player.Player:
Collaboration graph

Public Member Functions

void next ()
 play the next item
 
void previous ()
 play the previous item
 
default void onItemEnded ()
 The current item has ended by itself (a timer, or the renderer reported it): go on as the play mode says, which unlike next() repeats the item with repeat one.
 
void pause ()
 Pause the current item.
 
void play ()
 start playing the current item
 
void stop ()
 stops playing.
 
void setItems (PlayableItem... items)
 Set a List of Items.
 
void addItems (List< PlayableItem > items)
 adds additional item to the end of the playlist
 
void clear ()
 Drops all Items.
 
void onDestroy ()
 Kill the player.
 
String getName ()
 Get the player name.
 
void setName (String name)
 Set the name of the player.
 
String getShortName ()
 Get the player short name.
 
void setShortName (String name)
 Set the short name of the player.
 
void exit ()
 Exit the player.
 
int getId ()
 Returns the id of the Player.
 
void addPropertyChangeListener (PropertyChangeListener listener)
 add a property change listener
 
void removePropertyChangeListener (PropertyChangeListener listener)
 remove a property change listener
 
String getPositionString ()
 returns the current item position in the playlist
 
String getCurrentItemTitle ()
 returns the title of the current item
 
int getCurrentItemIndex ()
 
boolean isPlaying ()
 
String getNextItemTitle ()
 returns the title of the next item
 
String getDuration ()
 returns the duration of the current item
 
long getCurrentPosition ()
 returns the current position of the current item in millis
 
String getElapsedTime ()
 returns the elapsed time of the current item
 
URI getAlbumArt ()
 
Bitmap getIcon ()
 
void setIcon (Bitmap icon)
 
boolean getMute ()
 
void setMute (boolean mute)
 
int getVolume ()
 
boolean hasActionGetVolume ()
 
boolean hasActionGetMute ()
 
void setVolume (int volume)
 
int getIconResourceId ()
 
String getDeviceId ()
 
PendingIntent getNotificationIntent ()
 Returns the intent which is to be started by pushing the notification entry.
 
void seekTo (long millisecondsFromStart)
 
List< PlayableItem > getItems ()
 
void fastForward (int i)
 fast forward seconds
 
void fastRewind (int i)
 fast rewind seconds
 
MediaSessionCompat getMediaSession ()
 Get the MediaSession for this player (for volume control integration)
 
boolean isPaused ()
 
boolean isStopped ()
 
PlayMode getPlayMode ()
 The repeat and shuffle mode of this player.
 
void setPlayMode (PlayMode mode)
 Changes the repeat and shuffle mode of this player; the current item goes on playing.
 
default int[] getPlayOrder ()
 The order in which the items of the playlist play (with shuffle the shuffled order, otherwise the list order), as the index into getItems() of the item at each position.
 
default boolean moveInPlayOrder (int fromPosition, int toPosition)
 Moves an item in the playlist as the screen shows it: with shuffle the item moves in the play order (the list is not touched), otherwise in the list.
 
default boolean removeItem (int itemIndex)
 Removes an item from the playlist (and from the play order).
 
default boolean isPlaylistPositionLocked (int position)
 

Public Attributes

String PROPERTY_PLAY_MODE = "playMode"
 Name of the property change fired (see addPropertyChangeListener) when the play mode changed; old and new value are PlayModes.
 
String PROPERTY_PLAYLIST = "playlist"
 Name of the property change fired when the playlist changed: items set, added, removed or moved, or the play order created again (a stop, a start).
 
String PROPERTY_STOPPED = "stopped"
 Name of the property change fired when the player has stopped: stop() is done, whoever called it - the end of the playlist without repeat, the stop button of the app, the media renderer's Stop.
 

Detailed Description

A Player is able to play stop a couple of MediaObjects.

Author
Tobias Schoene (openbit)

Member Function Documentation

◆ addItems()

void de.yaacc.player.Player.addItems ( List< PlayableItem > items)

adds additional item to the end of the playlist

Parameters
itemsthe items to be added

Implemented in de.yaacc.player.AbstractPlayer, de.yaacc.player.LocalImagePlayer, de.yaacc.player.LocalMediaSessionPlayer, and de.yaacc.player.OpenHomePlayer.

◆ addPropertyChangeListener()

void de.yaacc.player.Player.addPropertyChangeListener ( PropertyChangeListener listener)

add a property change listener

Parameters
listenerthe listener

Implemented in de.yaacc.player.AbstractPlayer, and de.yaacc.player.LocalImagePlayer.

◆ clear()

void de.yaacc.player.Player.clear ( )

◆ exit()

◆ fastForward()

void de.yaacc.player.Player.fastForward ( int i)

fast forward seconds

Parameters
iseconds

Implemented in de.yaacc.player.AbstractPlayer, de.yaacc.player.LocalImagePlayer, and de.yaacc.player.OpenHomePlayer.

◆ fastRewind()

void de.yaacc.player.Player.fastRewind ( int i)

fast rewind seconds

Parameters
iseconds

Implemented in de.yaacc.player.AbstractPlayer, de.yaacc.player.LocalImagePlayer, and de.yaacc.player.OpenHomePlayer.

◆ getAlbumArt()

URI de.yaacc.player.Player.getAlbumArt ( )

◆ getCurrentItemTitle()

String de.yaacc.player.Player.getCurrentItemTitle ( )

returns the title of the current item

Returns
the title

Implemented in de.yaacc.player.AbstractPlayer, and de.yaacc.player.LocalImagePlayer.

◆ getCurrentPosition()

long de.yaacc.player.Player.getCurrentPosition ( )

◆ getDuration()

String de.yaacc.player.Player.getDuration ( )

◆ getElapsedTime()

String de.yaacc.player.Player.getElapsedTime ( )

◆ getIcon()

Bitmap de.yaacc.player.Player.getIcon ( )

◆ getId()

int de.yaacc.player.Player.getId ( )

Returns the id of the Player.

Returns
the id

Implemented in de.yaacc.player.AbstractPlayer, and de.yaacc.player.LocalImagePlayer.

Referenced by de.yaacc.player.PlayerService.shutdown().

Here is the caller graph for this function:

◆ getMediaSession()

MediaSessionCompat de.yaacc.player.Player.getMediaSession ( )

Get the MediaSession for this player (for volume control integration)

Implemented in de.yaacc.player.AbstractPlayer, de.yaacc.player.LocalImagePlayer, and de.yaacc.player.LocalMediaSessionPlayer.

◆ getName()

String de.yaacc.player.Player.getName ( )

Get the player name.

Returns
the name

Implemented in de.yaacc.player.AbstractPlayer, and de.yaacc.player.LocalImagePlayer.

◆ getNextItemTitle()

String de.yaacc.player.Player.getNextItemTitle ( )

returns the title of the next item

Returns
the title

Implemented in de.yaacc.player.AbstractPlayer, de.yaacc.player.LocalImagePlayer, and de.yaacc.player.LocalMediaSessionPlayer.

◆ getNotificationIntent()

PendingIntent de.yaacc.player.Player.getNotificationIntent ( )

Returns the intent which is to be started by pushing the notification entry.

Returns
the peneding intent

Implemented in de.yaacc.player.AbstractPlayer, de.yaacc.player.AVTransportPlayer, de.yaacc.player.LocalImagePlayer, de.yaacc.player.LocalMediaSessionPlayer, de.yaacc.player.MultiContentPlayer, and de.yaacc.player.OpenHomePlayer.

◆ getPlayMode()

PlayMode de.yaacc.player.Player.getPlayMode ( )

The repeat and shuffle mode of this player.

It starts with the mode the settings "replay playlist" and "shuffle music" give a new player and then belongs to the player only: it is never written back to the settings and ends with the player.

Returns
the mode, never null

Implemented in de.yaacc.player.AbstractPlayer, and de.yaacc.player.LocalImagePlayer.

Referenced by de.yaacc.upnp.server.avtransport.AvTransport.attachPlayers().

Here is the caller graph for this function:

◆ getPlayOrder()

default int[] de.yaacc.player.Player.getPlayOrder ( )

The order in which the items of the playlist play (with shuffle the shuffled order, otherwise the list order), as the index into getItems() of the item at each position.

The playlist screen shows the items in this order.

Returns
a copy, one entry per item

Implemented in de.yaacc.player.AbstractPlayer.

◆ getPositionString()

String de.yaacc.player.Player.getPositionString ( )

returns the current item position in the playlist

Returns
the position string

Implemented in de.yaacc.player.AbstractPlayer, and de.yaacc.player.LocalImagePlayer.

◆ getShortName()

String de.yaacc.player.Player.getShortName ( )

Get the player short name.

Returns
the name

Implemented in de.yaacc.player.AbstractPlayer, and de.yaacc.player.LocalImagePlayer.

◆ isPlaylistPositionLocked()

default boolean de.yaacc.player.Player.isPlaylistPositionLocked ( int position)
Parameters
positiona position of getPlayOrder()
Returns
true if the item at the position cannot be edited: it plays (or is paused) or came before the one that plays

Implemented in de.yaacc.player.AbstractPlayer, and de.yaacc.player.OpenHomePlayer.

◆ moveInPlayOrder()

default boolean de.yaacc.player.Player.moveInPlayOrder ( int fromPosition,
int toPosition )

Moves an item in the playlist as the screen shows it: with shuffle the item moves in the play order (the list is not touched), otherwise in the list.

The positions are positions of getPlayOrder(). Fires PROPERTY_PLAYLIST.

Returns
false if nothing moved: the positions are invalid or locked

Implemented in de.yaacc.player.AbstractPlayer, and de.yaacc.player.OpenHomePlayer.

Referenced by de.yaacc.player.PlaylistItemAdapter.moveItem().

Here is the caller graph for this function:

◆ next()

void de.yaacc.player.Player.next ( )

◆ onDestroy()

void de.yaacc.player.Player.onDestroy ( )

◆ onItemEnded()

default void de.yaacc.player.Player.onItemEnded ( )

The current item has ended by itself (a timer, or the renderer reported it): go on as the play mode says, which unlike next() repeats the item with repeat one.

The default is next().

Implemented in de.yaacc.player.AbstractPlayer.

Here is the call graph for this function:

◆ pause()

void de.yaacc.player.Player.pause ( )

◆ play()

◆ previous()

◆ removeItem()

default boolean de.yaacc.player.Player.removeItem ( int itemIndex)

Removes an item from the playlist (and from the play order).

Parameters
itemIndexthe index into getItems()
Returns
false if nothing was removed: the index is invalid or the item is locked

Implemented in de.yaacc.player.AbstractPlayer, and de.yaacc.player.OpenHomePlayer.

◆ removePropertyChangeListener()

void de.yaacc.player.Player.removePropertyChangeListener ( PropertyChangeListener listener)

remove a property change listener

Parameters
listenerthe listener

Implemented in de.yaacc.player.AbstractPlayer, and de.yaacc.player.LocalImagePlayer.

◆ setItems()

void de.yaacc.player.Player.setItems ( PlayableItem... items)

◆ setName()

void de.yaacc.player.Player.setName ( String name)

Set the name of the player.

Parameters
namethe name

Implemented in de.yaacc.player.AbstractPlayer, and de.yaacc.player.LocalImagePlayer.

◆ setPlayMode()

void de.yaacc.player.Player.setPlayMode ( PlayMode mode)

Changes the repeat and shuffle mode of this player; the current item goes on playing.

Fires PROPERTY_PLAY_MODE if the mode differs.

Parameters
modethe new mode, null is ignored

Implemented in de.yaacc.player.AbstractPlayer, de.yaacc.player.LocalImagePlayer, and de.yaacc.player.OpenHomePlayer.

◆ setShortName()

void de.yaacc.player.Player.setShortName ( String name)

Set the short name of the player.

Parameters
namethe name

Implemented in de.yaacc.player.AbstractPlayer, and de.yaacc.player.LocalImagePlayer.

◆ stop()

void de.yaacc.player.Player.stop ( )

Member Data Documentation

◆ PROPERTY_PLAYLIST

String de.yaacc.player.Player.PROPERTY_PLAYLIST = "playlist"

Name of the property change fired when the playlist changed: items set, added, removed or moved, or the play order created again (a stop, a start).

Old and new value are null; read the playlist again.

◆ PROPERTY_STOPPED

String de.yaacc.player.Player.PROPERTY_STOPPED = "stopped"

Name of the property change fired when the player has stopped: stop() is done, whoever called it - the end of the playlist without repeat, the stop button of the app, the media renderer's Stop.

Not fired for a pause or for the end of an item that goes on with the next one. Old and new value are null. May be fired on any thread; a listener must return quickly and must not call back into the player.

Referenced by de.yaacc.player.LocalImagePlayer.stop().


The documentation for this interface was generated from the following file: