|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.lyra.Host.Status
public class Status
Deals with the basic status handling of the Music Player Daemon protocol and its interaction with the rest of the system.
Field Summary | |
---|---|
private static java.lang.String |
CLASS
|
private java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
Current
|
private java.util.List<java.lang.String> |
Disabled
|
private java.util.List<java.lang.String> |
Enabled
|
private Terminus |
Host
|
private Ledger |
Logger
|
private java.util.List<java.lang.String> |
Playlist
|
private java.util.Map<java.lang.String,java.lang.String> |
State
|
private java.util.Map<java.lang.String,java.lang.String> |
Stats
|
Constructor Summary | |
---|---|
Status(Ledger logger,
Terminus host)
Primary constructor for this class. |
Method Summary | |
---|---|
static boolean |
fetchState(int state)
Returns the state of an element by first taking the numeric value and providing the user with a proper boolean. |
static boolean |
fetchState(java.lang.String state)
Returns the state of an element by first taking the string value and providing the user with a proper boolean. |
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
getCurrent()
Returns the generated playlist from the Music Player Daemon host typically used for synchronisation of database elements. |
java.util.List<java.lang.String> |
getDisabled()
Get a listing of all disabled commands. |
java.util.Set<java.lang.String> |
getDisabledAsSet()
Get a listing of all disabled commands. |
java.util.List<java.lang.String> |
getEnabled()
List containing all commands available for use. |
java.util.Set<java.lang.String> |
getEnabledAsSet()
List containing all commands available for use. |
java.util.List<java.lang.String> |
getPlaylist()
Returns a list of all stored playlists in the host. |
java.util.Map<java.lang.String,java.lang.String> |
getState()
Returns the state element that has been generated by this class. |
java.util.Map<java.lang.String,java.lang.String> |
getStatistics()
Returns the statistics element that has been generated by this class. |
protected void |
updateByEvent(UpdateEvent update)
An update variant that will extract information as necessary based on an event that has been generated. |
protected void |
updateCurrent()
Playlist contain a lot of information that can be retained. |
protected void |
updateDisabled()
Accesses the Music Player Daemon and gets a list of all commands which are not enabled for use on the host. |
protected void |
updateEnabled()
Accesses the Music Player Daemon and gets a list of all commands which are enabled for use on the host. |
void |
updateHost(Terminus host)
This provides the ability to change the Terminus connection which has been initially setup. |
protected void |
updatePlaylist()
Provides an update mechanism for stored playlists on the hosts enabling a user to get select them for playback and so forth. |
protected void |
updateState()
Sends the appropriate command and parses the return value in order to extract status information from the Music Player Daemon. |
protected void |
updateStatistics()
Statistics can provide a great deal of information about the Music Player Daemon and provide a stating point to discover if the database needs updating or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.Map<java.lang.String,java.lang.String> State
private java.util.Map<java.lang.String,java.lang.String> Stats
private java.util.List<java.util.Map<java.lang.String,java.lang.String>> Current
private java.util.List<java.lang.String> Playlist
private java.util.List<java.lang.String> Enabled
private java.util.List<java.lang.String> Disabled
private Ledger Logger
private Terminus Host
private static final java.lang.String CLASS
Constructor Detail |
---|
public Status(Ledger logger, Terminus host)
logger
- Ledger instance for logging and debugging purposes.host
- Terminus instance for direct interaction with the Host.Method Detail |
---|
public void updateHost(Terminus host)
host
- Terminus instance for direct interaction with the Host.protected void updateByEvent(UpdateEvent update)
update
- UpdateEvent instance carrying all information on what to update.protected void updateState()
public java.util.Map<java.lang.String,java.lang.String> getState()
This information changes with player state and version. So it becomes necessary to check for the existence of tags prior to using them.
protected void updateStatistics()
public java.util.Map<java.lang.String,java.lang.String> getStatistics()
protected void updateEnabled()
public java.util.List<java.lang.String> getEnabled()
public java.util.Set<java.lang.String> getEnabledAsSet()
protected void updateDisabled()
public java.util.List<java.lang.String> getDisabled()
public java.util.Set<java.lang.String> getDisabledAsSet()
protected void updateCurrent()
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> getCurrent()
protected void updatePlaylist()
public java.util.List<java.lang.String> getPlaylist()
public static boolean fetchState(java.lang.String state)
state
- String indicating state of an element.
public static boolean fetchState(int state)
state
- Integer indicating state of an element.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |