JSampler
v0.8a

org.jsampler
Class JSPrefs

java.lang.Object
  extended by java.beans.PropertyChangeSupport
      extended by org.jsampler.JSPrefs
All Implemented Interfaces:
java.io.Serializable

public class JSPrefs
extends java.beans.PropertyChangeSupport

See Also:
Serialized Form

Field Summary
static java.lang.String DEFAULT_AUDIO_DRIVER
          Property representing the default audio output driver to be used when creating new audio output device.
static java.lang.String DEFAULT_AUDIO_OUTPUT
          Property representing the default audio output to be used when new sampler channel is created.
static java.lang.String DEFAULT_CHANNEL_VOLUME
          Property representing the default channel volume when new sampler channel is created.
static java.lang.String DEFAULT_ENGINE
          Property representing the default engine to be used when new sampler channel is created.
static java.lang.String DEFAULT_MIDI_DRIVER
          Property representing the default MIDI input driver to be used when creating new MIDI input device.
static java.lang.String DEFAULT_MIDI_INPUT
          Property representing the default MIDI input to be used when new sampler channel is created.
static java.lang.String DEFAULT_MIDI_INSTRUMENT_MAP
          Property representing the default MIDI instrument map to be used when new sampler channel is created.
static java.lang.String USE_CHANNEL_DEFAULTS
          Property which specifies whether to apply default actions to newly created sampler channels.
static java.lang.String VOL_MEASUREMENT_UNIT_DECIBEL
          Property which specifies whether the volume values should be shown in decibels.
 
Constructor Summary
JSPrefs(java.lang.String pathName)
          Creates a new instance of JSPrefs.
 
Method Summary
 boolean getBoolProperty(java.lang.String name)
          Gets a boolean property.
 boolean getBoolProperty(java.lang.String name, boolean defaultValue)
          Gets a boolean property.
 boolean getDefaultBoolValue(java.lang.String name)
          Gets the default value for the specified property.
 int getDefaultIntValue(java.lang.String name)
          Gets the default value for the specified property.
 java.lang.String[] getDefaultStringListValue(java.lang.String name)
          Gets the default value for the specified property.
 java.lang.String getDefaultStringValue(java.lang.String name)
          Gets the default value for the specified property.
 int getIntProperty(java.lang.String name)
          Gets an integer property.
 int getIntProperty(java.lang.String name, int defaultValue)
          Gets an integer property.
 java.lang.String[] getStringListProperty(java.lang.String name)
          Gets a string list property.
 java.lang.String[] getStringListProperty(java.lang.String name, java.lang.String[] defaultValue)
          Gets a string list property.
 java.lang.String getStringProperty(java.lang.String name)
          Gets a string property.
 java.lang.String getStringProperty(java.lang.String name, java.lang.String defaultValue)
          Gets a string property.
 void setBoolProperty(java.lang.String name, boolean b)
          Sets a boolean property.
 void setIntProperty(java.lang.String name, int i)
          Sets an integer property.
 void setStringListProperty(java.lang.String name, java.lang.String[] list)
          Sets a string list property.
 void setStringProperty(java.lang.String name, java.lang.String s)
          Sets a string property.
 
Methods inherited from class java.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, hasListeners, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USE_CHANNEL_DEFAULTS

public static final java.lang.String USE_CHANNEL_DEFAULTS
Property which specifies whether to apply default actions to newly created sampler channels.

See Also:
Constant Field Values

DEFAULT_ENGINE

public static final java.lang.String DEFAULT_ENGINE
Property representing the default engine to be used when new sampler channel is created. The action is taken only if USE_CHANNEL_DEFAULTS is true.

See Also:
Constant Field Values

DEFAULT_MIDI_INPUT

public static final java.lang.String DEFAULT_MIDI_INPUT
Property representing the default MIDI input to be used when new sampler channel is created. The action is taken only if USE_CHANNEL_DEFAULTS is true.

See Also:
Constant Field Values

DEFAULT_AUDIO_OUTPUT

public static final java.lang.String DEFAULT_AUDIO_OUTPUT
Property representing the default audio output to be used when new sampler channel is created. The action is taken only if USE_CHANNEL_DEFAULTS is true.

See Also:
Constant Field Values

DEFAULT_MIDI_INSTRUMENT_MAP

public static final java.lang.String DEFAULT_MIDI_INSTRUMENT_MAP
Property representing the default MIDI instrument map to be used when new sampler channel is created. The action is taken only if USE_CHANNEL_DEFAULTS is true.

See Also:
Constant Field Values

DEFAULT_CHANNEL_VOLUME

public static final java.lang.String DEFAULT_CHANNEL_VOLUME
Property representing the default channel volume when new sampler channel is created. The action is taken only if USE_CHANNEL_DEFAULTS is true.

See Also:
Constant Field Values

DEFAULT_MIDI_DRIVER

public static final java.lang.String DEFAULT_MIDI_DRIVER
Property representing the default MIDI input driver to be used when creating new MIDI input device.

See Also:
Constant Field Values

DEFAULT_AUDIO_DRIVER

public static final java.lang.String DEFAULT_AUDIO_DRIVER
Property representing the default audio output driver to be used when creating new audio output device.

See Also:
Constant Field Values

VOL_MEASUREMENT_UNIT_DECIBEL

public static final java.lang.String VOL_MEASUREMENT_UNIT_DECIBEL
Property which specifies whether the volume values should be shown in decibels.

See Also:
Constant Field Values
Constructor Detail

JSPrefs

public JSPrefs(java.lang.String pathName)
Creates a new instance of JSPrefs.

Parameters:
pathName - The path name of the preferences node.
Method Detail

getStringProperty

public java.lang.String getStringProperty(java.lang.String name)
Gets a string property.

Parameters:
name - The name of the property.
Returns:
The value of the specified property. If the property is not set, the return value is null.
See Also:
getDefaultStringValue(java.lang.String)

getStringProperty

public java.lang.String getStringProperty(java.lang.String name,
                                          java.lang.String defaultValue)
Gets a string property.

Parameters:
name - The name of the property.
defaultValue - The value to return if the property is not set.
Returns:
The value of the specified property.

setStringProperty

public void setStringProperty(java.lang.String name,
                              java.lang.String s)
Sets a string property.

Parameters:
name - The name of the property.
s - The new value for the specified property.

getDefaultStringValue

public java.lang.String getDefaultStringValue(java.lang.String name)
Gets the default value for the specified property. The default value is used when the property is not set. Override this method to provide custom default values for specific properties.

Parameters:
name - The name of the property whose default value should be obtained.
Returns:
null
See Also:
getStringProperty(String name)

getStringListProperty

public java.lang.String[] getStringListProperty(java.lang.String name)
Gets a string list property.

Parameters:
name - The name of the property.
Returns:
The value of the specified property. If the property is not set, the return value is an empty array.
See Also:
getDefaultStringListValue(java.lang.String)

getStringListProperty

public java.lang.String[] getStringListProperty(java.lang.String name,
                                                java.lang.String[] defaultValue)
Gets a string list property.

Parameters:
name - The name of the property.
defaultValue - The value to return if the property is not set.
Returns:
The value of the specified property.

setStringListProperty

public void setStringListProperty(java.lang.String name,
                                  java.lang.String[] list)
Sets a string list property. Note that the string elements may not contain new lines.

Parameters:
name - The name of the property.
list - The new value for the specified property.

getDefaultStringListValue

public java.lang.String[] getDefaultStringListValue(java.lang.String name)
Gets the default value for the specified property. The default value is used when the property is not set. Override this method to provide custom default values for specific properties.

Parameters:
name - The name of the property whose default value should be obtained.
Returns:
An empty array.
See Also:
getStringListProperty(String name)

getIntProperty

public int getIntProperty(java.lang.String name)
Gets an integer property.

Parameters:
name - The name of the property.
Returns:
The value of the specified property.
See Also:
getDefaultIntValue(java.lang.String)

getIntProperty

public int getIntProperty(java.lang.String name,
                          int defaultValue)
Gets an integer property.

Parameters:
name - The name of the property.
defaultValue - The value to return if the property is not set.
Returns:
The value of the specified property.

getDefaultIntValue

public int getDefaultIntValue(java.lang.String name)
Gets the default value for the specified property. The default value is used when the property is not set. Override this method to provide custom default values for specific properties.

Parameters:
name - The name of the property whose default value should be obtained.
Returns:
0
See Also:
getIntProperty(String name)

setIntProperty

public void setIntProperty(java.lang.String name,
                           int i)
Sets an integer property.

Parameters:
name - The name of the property.
i - The new value for the specified property.

getBoolProperty

public boolean getBoolProperty(java.lang.String name)
Gets a boolean property.

Parameters:
name - The name of the property.
Returns:
The value of the specified property.
See Also:
getDefaultBoolValue(java.lang.String)

getBoolProperty

public boolean getBoolProperty(java.lang.String name,
                               boolean defaultValue)
Gets a boolean property.

Parameters:
name - The name of the property.
defaultValue - The value to return if the property is not set.
Returns:
The value of the specified property.

setBoolProperty

public void setBoolProperty(java.lang.String name,
                            boolean b)
Sets a boolean property.

Parameters:
name - The name of the property.
b - The new value for the specified property.

getDefaultBoolValue

public boolean getDefaultBoolValue(java.lang.String name)
Gets the default value for the specified property. The default value is used when the property is not set. Override this method to provide custom default values for specific properties.

Parameters:
name - The name of the property whose default value should be obtained.
See Also:
getBoolProperty(String name)

JSampler
v0.8a

Copyright © 2007 Grigor Iliev. All rights reserved.