net.sf.freecol.common.option
Class AudioMixerOption

java.lang.Object
  extended by net.sf.freecol.common.model.FreeColObject
      extended by net.sf.freecol.common.option.AbstractOption
          extended by net.sf.freecol.common.option.AudioMixerOption
All Implemented Interfaces:
Option

public class AudioMixerOption
extends AbstractOption

Option for selecting an audio mixer.


Nested Class Summary
static class AudioMixerOption.MixerWrapper
           
 
Field Summary
private static java.util.Comparator<AudioMixerOption.MixerWrapper> audioMixerComparator
           
private static java.util.Map<java.lang.String,AudioMixerOption.MixerWrapper> audioMixers
           
static java.lang.String AUTO
           
private static javax.sound.sampled.Mixer AUTODETECT_MIXER
           
private static AudioMixerOption.MixerWrapper DEFAULT
           
private static java.util.logging.Logger logger
           
private  AudioMixerOption.MixerWrapper value
           
 
Fields inherited from class net.sf.freecol.common.option.AbstractOption
isDefined, NO_ID, previewEnabled
 
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, PARTIAL_ATTRIBUTE
 
Constructor Summary
AudioMixerOption(java.lang.String id)
          Creates a new AudioMixerOption.
AudioMixerOption(java.lang.String id, OptionGroup optionGroup)
           
 
Method Summary
private  void findAudioMixers()
          Finds the audioMixers available.
 AudioMixerOption.MixerWrapper[] getOptions()
          Returns a list of the available audioMixers.
 AudioMixerOption.MixerWrapper getValue()
          Get the Value value.
static java.lang.String getXMLElementTagName()
          Gets the tag name of the root element representing this object.
protected  void readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
          Initialize this object from an XML-representation of this object.
 void setValue(AudioMixerOption.MixerWrapper newValue)
          Set the Value value.
protected  void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
          This method writes an XML-representation of this object to the given stream.
private static javax.sound.sampled.Mixer tryGetMixer()
           
 
Methods inherited from class net.sf.freecol.common.option.AbstractOption
getGroup, getName, getShortDescription, isPreviewEnabled, setGroup, setPreviewEnabled, toString
 
Methods inherited from class net.sf.freecol.common.model.FreeColObject
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAttribute, getAttribute, getAttribute, getAttribute, getId, getPropertyChangeListeners, getPropertyChangeListeners, hasAbility, hasAttribute, hasListeners, readAttributes, readChildren, readFromArrayElement, readFromArrayElement, readFromArrayElement, readFromListElement, readFromXML, readFromXMLElement, readFromXMLPartialImpl, removePropertyChangeListener, removePropertyChangeListener, setId, toArrayElement, toArrayElement, toListElement, toXML, toXML, toXML, toXMLElement, toXMLElement, toXMLElement, toXMLElement, toXMLElementPartial, toXMLPartialImpl, writeAttribute, writeAttributes, writeChildren, writeFreeColGameObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.freecol.common.option.Option
addPropertyChangeListener, getId, readFromXML, readFromXMLElement, removePropertyChangeListener, toXML, toXMLElement
 

Field Detail

logger

private static java.util.logging.Logger logger

audioMixers

private static final java.util.Map<java.lang.String,AudioMixerOption.MixerWrapper> audioMixers

AUTO

public static final java.lang.String AUTO

AUTODETECT_MIXER

private static final javax.sound.sampled.Mixer AUTODETECT_MIXER

DEFAULT

private static final AudioMixerOption.MixerWrapper DEFAULT

audioMixerComparator

private static java.util.Comparator<AudioMixerOption.MixerWrapper> audioMixerComparator

value

private AudioMixerOption.MixerWrapper value
Constructor Detail

AudioMixerOption

public AudioMixerOption(java.lang.String id)
Creates a new AudioMixerOption.

Parameters:
id - The identifier for this option. This is used when the object should be found in an OptionGroup.

AudioMixerOption

public AudioMixerOption(java.lang.String id,
                        OptionGroup optionGroup)
Method Detail

tryGetMixer

private static javax.sound.sampled.Mixer tryGetMixer()

getValue

public final AudioMixerOption.MixerWrapper getValue()
Get the Value value.

Returns:
a String value

setValue

public final void setValue(AudioMixerOption.MixerWrapper newValue)
Set the Value value.

Parameters:
newValue - The new Value value.

getOptions

public AudioMixerOption.MixerWrapper[] getOptions()
Returns a list of the available audioMixers.

Returns:
The available audioMixers in a human readable format.

findAudioMixers

private void findAudioMixers()
Finds the audioMixers available.


toXMLImpl

protected void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
                  throws javax.xml.stream.XMLStreamException
This method writes an XML-representation of this object to the given stream.

Specified by:
toXMLImpl in class FreeColObject
Parameters:
out - The target stream.
Throws:
javax.xml.stream.XMLStreamException - if there are any problems writing to the stream.

readFromXMLImpl

protected void readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
                        throws javax.xml.stream.XMLStreamException
Initialize this object from an XML-representation of this object.

Overrides:
readFromXMLImpl in class FreeColObject
Parameters:
in - The input stream with the XML.
Throws:
javax.xml.stream.XMLStreamException - if a problem was encountered during parsing.

getXMLElementTagName

public static java.lang.String getXMLElementTagName()
Gets the tag name of the root element representing this object.

Returns:
"audioMixerOption".