|
YAACC - UPNP Client and Server
|
Plays on an FCast receiver (task 4.3, design.md section 5). More...


Public Member Functions | |
| FCastPlayer (UpnpClient upnpClient, FCastReceiverDevice receiver, String name, String shortName) | |
| FCastSession | getSession () |
| The session, for the settings sheet and the tests. | |
| void | seekTo (long millisecondsFromStart) |
| void | setSpeed (double newSpeed) |
| The playback speed of the running item and of the following ones (the settings sheet, 0.25 to 4). | |
| long | getCurrentPosition () |
| returns the current position of the current item in millis | |
| String | getDuration () |
| returns the duration of the current item | |
| String | getElapsedTime () |
| returns the elapsed time of the current item | |
| int | getVolume () |
| void | setVolume (int volume) |
| boolean | getMute () |
| void | setMute (boolean mute) |
| boolean | hasActionGetVolume () |
| boolean | hasActionGetMute () |
| String | getDeviceId () |
| int | getIconResourceId () |
| PendingIntent | getNotificationIntent () |
| Returns the intent which is to be started by pushing the notification entry. | |
| URI | getAlbumArt () |
| Bitmap | getIcon () |
| The notification shows the art when it is in the cache; it is fetched once a minute at most per address when it is not. | |
| void | onDestroy () |
| Kill the player. | |
Public Member Functions inherited from de.yaacc.player.AbstractPlayer | |
| AbstractPlayer (UpnpClient upnpClient) | |
| MediaSessionCompat | getMediaSession () |
| Get the MediaSession for this player. | |
| void | onServiceConnected (ComponentName className, IBinder binder) |
| void | onServiceDisconnected (ComponentName className) |
| Context | getContext () |
| void | setIcon (Bitmap icon) |
| UpnpClient | getUpnpClient () |
| void | startService () |
| void | next () |
| play the next item | |
| 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 | previous () |
| play the previous item | |
| void | pause () |
| Pause the current item. | |
| void | play () |
| start playing the current item | |
| void | stop () |
| stops playing. | |
| 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. | |
| int[] | getPlayOrder () |
| boolean | isPlaylistPositionLocked (int position) |
| 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. | |
| boolean | removeItem (int itemIndex) |
| Removes an item from the playlist (and from the play order). | |
| boolean | removeItem (int itemIndex, boolean alsoPlayed) |
| Removes an item. | |
| int | getNextItemIndex () |
| int | getPreviousItemIndex () |
| void | clear () |
| Drops all Items. | |
| boolean | isPlaying () |
| boolean | isPaused () |
| boolean | isStopped () |
| void | setPlaying (boolean isPlaying) |
| List< PlayableItem > | getItems () |
| void | setItems (PlayableItem... playableItems) |
| Set a List of Items. | |
| void | addItems (List< PlayableItem > playableItems) |
| adds additional item to the end of the playlist | |
| void | insertItems (int index, List< PlayableItem > playableItems) |
| Puts items into the middle of the playlist (the OpenHome renderer's queue): the item that plays keeps playing, the play order places the new items (behind the current one with shuffle), an engine that holds the list too is told. | |
| void | playItemAt (int index) |
| Plays the item at the index (a playing, paused or stopped player starts it). | |
| String | getPositionString () |
| returns the current item position in the playlist | |
| int | getCurrentItemIndex () |
| String | getCurrentItemTitle () |
| returns the title of the current item | |
| String | getNextItemTitle () |
| returns the title of the next current item | |
| void | setShareLease (QueueShareWindow.Lease lease) |
| Makes this player hold the shares of a picked queue just in time: from now on loading an item binds the share of that item and of the next one and releases what the player left behind. | |
| long | getRemainingTime () |
| void | startTimer (final long duration) |
| Start a timer for the next item change. | |
| String | getName () |
| Get the player name. | |
| void | setName (String name) |
| Set the name of the player. | |
| boolean | isProcessingCommand () |
| void | setProcessingCommand (boolean isProcessingCommand) |
| 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 | getShortName () |
| Get the player short name. | |
| void | setShortName (String name) |
| Set the short name of the player. | |
| void | fastForward (int i) |
| fast forward seconds | |
| void | fastRewind (int i) |
| fast rewind seconds | |
Public Member Functions inherited from de.yaacc.player.Player | |
Protected Member Functions | |
| FCastSession | createSession (FCastSession.Listener listener, ScheduledExecutorService executor) |
| The session of this player; tests replace the way to the receiver. | |
| Object | loadItem (PlayableItem playableItem) |
| void | startItem (PlayableItem playableItem, Object loadedItem, int index) |
| void | stopItem (PlayableItem playableItem) |
| void | doPause () |
| void | doResume () |
| void | doPostLoadItem (PlayableItem playableItem) |
| void | updateTimer () |
| int | getNotificationId () |
| Returns the notification id of the player. | |
| void | showToast (final int textRes) |
| Shows a short text; tests replace it. | |
Protected Member Functions inherited from de.yaacc.player.AbstractPlayer | |
| void | configureMediaSession (MediaSessionCompat mediaSession) |
| Override this to configure MediaSession (e.g., set volume provider for remote playback). | |
| boolean | isShufflePlay () |
| is shuffle play enabled. | |
| PlayMode | readDefaultPlayMode () |
| The mode a new player starts with: the two settings "replay playlist" and "shuffle music". | |
| void | onPlayModeChanged (PlayMode oldMode, PlayMode newMode) |
The engine of a player applies the new play mode here (the order of the items is already adapted: see getPlayOrder()). | |
| void | onItemMoved (int fromIndex, int toIndex) |
The list order changed: the item at fromIndex moved to toIndex (shuffle is off). | |
| void | onItemRemoved (int index) |
The item at index was removed from the list and the play order. | |
| void | onPlayOrderMoved () |
The play order changed by a move (shuffle is on, the list is unchanged); read it with getPlayOrder(). | |
| void | resetPlayOrder (int firstIndex) |
| Creates the play order of the playlist again with the given item first (with shuffle a new random order, otherwise the list order). | |
| void | cancelTimer () |
| void | setPaused (boolean paused) |
| final void | adoptExternalPause () |
| Another controller than this app paused the playback (the media notification, the lock screen, a headset or the loss of the audio focus): the engine is paused already, only what the app knows about its player and shows is brought up to date. | |
| final void | adoptExternalResume () |
The playback that was paused goes on without a command of this app (see adoptExternalPause()). | |
| void | setCurrentIndex (int currentIndex) |
| final synchronized void | adoptDeviceState (List< PlayableItem > deviceItems, int index, boolean nowPlaying, boolean nowPaused) |
| For a player whose playlist and playback live on a device (OpenHome): takes over what the device reports. | |
| void | onItemsInserted (int index, List< PlayableItem > inserted) |
Items were put into the list at index. | |
| QueueShareWindow.Lease | getShareLease () |
| The lease of the shares of a picked queue, null for every other player. | |
| Object | loadItem (int toLoadIndex) |
| void | loadItem (int previousIndex, int nextIndex) |
| long | getSilenceDuration () |
| returns the duration between two items | |
| long | parseTimeStringToMillis (String timeString) |
| void | showNotificationInternal () |
| void | updatePlaybackStateInternal (int state) |
| void | updateMetadataInternal () |
| void | firePropertyChange (String property, Object oldValue, Object newValue) |
| void | executeCommand (TimerTask command, Date executionTime) |
Additional Inherited Members | |
Public Attributes inherited from de.yaacc.player.Player | |
| 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. | |
Static Public Attributes inherited from de.yaacc.player.AbstractPlayer | |
| static final String | PLAYER_ID = "PlayerId" |
| static final String | PROPERTY_ITEM = "item" |
| static final String | PROPERTY_PAUSED = "paused" |
| Fired when the player is paused or resumed (the "playing" property is fired when it starts or stops playing). | |
Package Functions inherited from de.yaacc.player.AbstractPlayer | |
Static Package Attributes inherited from de.yaacc.player.AbstractPlayer | |
Plays on an FCast receiver (task 4.3, design.md section 5).
The receiver fetches the URL of an item itself; this player sends one Play per item and drives the queue (next, previous, repeat, shuffle, play list) like the players of the other receivers. What the receiver reports (state, position, volume, the end of an item) comes from the FCastSession; the decisions are in FCastPlayerLogic.
Play carries no volume. FCastPlayerLogic. The ids: getId() (the notification id) is random, getDeviceId() is the receiver id fcast:host:port.
|
protected |
Reimplemented from de.yaacc.player.AbstractPlayer.
|
protected |
Reimplemented from de.yaacc.player.AbstractPlayer.
|
protected |
Reimplemented from de.yaacc.player.AbstractPlayer.
| URI de.yaacc.player.FCastPlayer.getAlbumArt | ( | ) |
Reimplemented from de.yaacc.player.AbstractPlayer.
| long de.yaacc.player.FCastPlayer.getCurrentPosition | ( | ) |
returns the current position of the current item in millis
Reimplemented from de.yaacc.player.AbstractPlayer.
Referenced by de.yaacc.player.FCastPlayer.getElapsedTime().


| String de.yaacc.player.FCastPlayer.getDeviceId | ( | ) |
Reimplemented from de.yaacc.player.AbstractPlayer.
| String de.yaacc.player.FCastPlayer.getDuration | ( | ) |
returns the duration of the current item
Reimplemented from de.yaacc.player.AbstractPlayer.

| String de.yaacc.player.FCastPlayer.getElapsedTime | ( | ) |
returns the elapsed time of the current item
Reimplemented from de.yaacc.player.AbstractPlayer.

| Bitmap de.yaacc.player.FCastPlayer.getIcon | ( | ) |
The notification shows the art when it is in the cache; it is fetched once a minute at most per address when it is not.
Reimplemented from de.yaacc.player.AbstractPlayer.

| int de.yaacc.player.FCastPlayer.getIconResourceId | ( | ) |
Reimplemented from de.yaacc.player.AbstractPlayer.
| boolean de.yaacc.player.FCastPlayer.getMute | ( | ) |
Reimplemented from de.yaacc.player.AbstractPlayer.
|
protected |
Returns the notification id of the player.
Reimplemented from de.yaacc.player.AbstractPlayer.
| PendingIntent de.yaacc.player.FCastPlayer.getNotificationIntent | ( | ) |
Returns the intent which is to be started by pushing the notification entry.
Reimplemented from de.yaacc.player.AbstractPlayer.

| int de.yaacc.player.FCastPlayer.getVolume | ( | ) |
Reimplemented from de.yaacc.player.AbstractPlayer.
| boolean de.yaacc.player.FCastPlayer.hasActionGetMute | ( | ) |
Reimplemented from de.yaacc.player.AbstractPlayer.
| boolean de.yaacc.player.FCastPlayer.hasActionGetVolume | ( | ) |
Reimplemented from de.yaacc.player.AbstractPlayer.
|
protected |
Reimplemented from de.yaacc.player.AbstractPlayer.
| void de.yaacc.player.FCastPlayer.onDestroy | ( | ) |
Kill the player.
Reimplemented from de.yaacc.player.AbstractPlayer.

| void de.yaacc.player.FCastPlayer.seekTo | ( | long | millisecondsFromStart | ) |
Reimplemented from de.yaacc.player.AbstractPlayer.
| void de.yaacc.player.FCastPlayer.setMute | ( | boolean | mute | ) |
Reimplemented from de.yaacc.player.AbstractPlayer.
| void de.yaacc.player.FCastPlayer.setVolume | ( | int | volume | ) |
Reimplemented from de.yaacc.player.AbstractPlayer.
|
protected |
Reimplemented from de.yaacc.player.AbstractPlayer.
|
protected |
Reimplemented from de.yaacc.player.AbstractPlayer.
|
protected |
Reimplemented from de.yaacc.player.AbstractPlayer.