org.lyra.Host
Class Playback

java.lang.Object
  extended by org.lyra.Host.Playback

public class Playback
extends java.lang.Object

This class provides a direct interface to the player capabilities of the Multimedia Player Daemon (MPD). For the most part, this is an interface to the Terminus.

Version:
1.0.5, %Revision, 174%, %LastChangedDate, 27/10/12 3:33PM%
Author:
Martin Foster
See Also:
Terminus

Field Summary
private static java.lang.String CLASS
           
private  Terminus Host
           
private  java.util.Map<java.lang.String,java.lang.String> Lang
           
private  Ledger Logger
           
 
Constructor Summary
Playback(Ledger logger, Terminus host, java.util.Map<java.lang.String,java.lang.String> lang)
          Primary constructor for the class.
 
Method Summary
 boolean playNext()
          Shifts the player to a song next in the current playlist.
 boolean playPause()
          Stops the plays but retains song position.
 boolean playPrevious()
          Shifts the player to a song previous in the current playlist.
 boolean playResume()
          Starts playback resuming at last position.
 boolean playSeek(int pos, int seconds)
          Seeks to the position in seconds of entry in position in the playlist.
 boolean playSeekByIdentifier(int ident, int seconds)
          Seeks to the position in seconds of entry in identifier in the playlist.
 boolean playStart()
          Starts song play back.
 boolean playStart(int pos)
          Starts song play back.
 boolean playStartByIdentifier(int ident)
          This starts the play back of a specific song within the current playlist based on the song identifier.
 boolean playStop()
          Stops the player and play back resetting the song position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Logger

private Ledger Logger

Host

private Terminus Host

Lang

private java.util.Map<java.lang.String,java.lang.String> Lang

CLASS

private static final java.lang.String CLASS
See Also:
Constant Field Values
Constructor Detail

Playback

public Playback(Ledger logger,
                Terminus host,
                java.util.Map<java.lang.String,java.lang.String> lang)
Primary constructor for the class. Will establish the base environment necessary to interact with the player side of the daemon.

Parameters:
logger - Ledger instance for logging of events.
host - Host instance for interaction with the daemon.
lang - Map of language elements
Method Detail

playPrevious

public boolean playPrevious()
Shifts the player to a song previous in the current playlist.

Returns:
Boolean on success of action.

playStop

public boolean playStop()
Stops the player and play back resetting the song position.

Returns:
Boolean on success of action.

playPause

public boolean playPause()
Stops the plays but retains song position.

Returns:
Boolean on success of action.

playResume

public boolean playResume()
Starts playback resuming at last position.

Returns:
Boolean on success of action.

playStart

public boolean playStart()
Starts song play back. This is based on a no element selected basis so it will simply assume the first element if it exists.

Returns:
Boolean on success of action.

playStart

public boolean playStart(int pos)
Starts song play back.

Parameters:
pos - Song position in the current playlist.
Returns:
Boolean on success of action.

playStartByIdentifier

public boolean playStartByIdentifier(int ident)
This starts the play back of a specific song within the current playlist based on the song identifier.

Parameters:
ident - Song Identifier
Returns:
Boolean on success of action.

playNext

public boolean playNext()
Shifts the player to a song next in the current playlist.

Returns:
Boolean on success of action.

playSeek

public boolean playSeek(int pos,
                        int seconds)
Seeks to the position in seconds of entry in position in the playlist.

Parameters:
pos - Position in the current playlist.
seconds - Seconds to set the position of playback to.
Returns:
Boolean on success of action.

playSeekByIdentifier

public boolean playSeekByIdentifier(int ident,
                                    int seconds)
Seeks to the position in seconds of entry in identifier in the playlist.

Parameters:
ident - Identifier number for song in the current playlist.
seconds - Seconds to set the position of playback to.
Returns:
Boolean on success of action.