org.lyra.Host
Class Options

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

public class Options
extends java.lang.Object

This class provides a direct interface to the options available for the Music Player Daemon (MPD). For the most part, this is an abstraction 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
Options(Ledger logger, Terminus host, java.util.Map<java.lang.String,java.lang.String> lang)
          Primary constructor for the class.
 
Method Summary
 void fireUpdate()
          Passes on the direction to the Music Player Daemon host that a database update has been requested.
 boolean setConsume(boolean state)
          Sets consume state to STATE, STATE should be true or false.
 boolean setCrossfade(int crossfade)
          Sets crossfading between songs.
 boolean setMode(java.lang.String mode)
          Sets the replay gain mode.
 boolean setRandom(boolean state)
          Sets random state to STATE, STATE should be true or false
 boolean setRepeat(boolean state)
          Sets repeat state to STATE, STATE should be true or false.
 boolean setSingle(boolean state)
          Sets single state to STATE, STATE should be true or false.
 boolean setVolume(int volume)
          Sets volume to VOL, the range of volume is 0-100.
 
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

Options

public Options(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 Music Player Daemon (MPD) options.

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

setConsume

public boolean setConsume(boolean state)
Sets consume state to STATE, STATE should be true or false. When consume is activated, each song played is removed from playlist.

Parameters:
state - Boolean to determine state.
Returns:
Boolean on success of action.

setRandom

public boolean setRandom(boolean state)
Sets random state to STATE, STATE should be true or false

Parameters:
state - Boolean to determine state.
Returns:
Boolean on success of action.

setRepeat

public boolean setRepeat(boolean state)
Sets repeat state to STATE, STATE should be true or false.

Parameters:
state - Boolean to determine state.
Returns:
Boolean on success of action.

setSingle

public boolean setSingle(boolean state)
Sets single state to STATE, STATE should be true or false. When single is activated, playback is stopped after current song, or song is repeated if the repeat mode is enabled.

Parameters:
state - Boolean to determine state.
Returns:
Boolean on success of action.

setCrossfade

public boolean setCrossfade(int crossfade)
Sets crossfading between songs.

Parameters:
crossfade - Number of seconds containing crossfade value.
Returns:
Boolean on success of action.

setVolume

public boolean setVolume(int volume)
Sets volume to VOL, the range of volume is 0-100.

Parameters:
volume - Range between 0-100 indicating volume.
Returns:
Boolean on success of action.

setMode

public boolean setMode(java.lang.String mode)
Sets the replay gain mode. One of off, track, album. Changing the mode during playback may take several seconds, because the new settings does not affect the buffered data.

Parameters:
mode - String value of off, track or album.
Returns:
Boolean on success of action.

fireUpdate

public void fireUpdate()
Passes on the direction to the Music Player Daemon host that a database update has been requested. This will in turn order to host to rescan for new or changed songs.