JSampler
v0.8a

org.jsampler
Class DefaultAudioDeviceModel

java.lang.Object
  extended by org.jsampler.DefaultAudioDeviceModel
All Implemented Interfaces:
AudioDeviceModel

public class DefaultAudioDeviceModel
extends java.lang.Object
implements AudioDeviceModel

This class provides default implementation of the AudioDeviceModel interface.


Constructor Summary
DefaultAudioDeviceModel(AudioOutputDevice audioDevice)
          Creates a new instance of DefaultAudioDeviceModel using the specified non-null audio device.
 
Method Summary
 void addAudioDeviceListener(AudioDeviceListener l)
          Registers the specified listener to be notified when the settings of the audio device are changed.
 int getDeviceId()
          Gets the numerical ID of this audio device.
 AudioOutputDevice getDeviceInfo()
          Gets the current settings of the audio device represented by this model.
 boolean isActive()
          Determines whether the audio device is active.
 void removeAudioDeviceListener(AudioDeviceListener l)
          Removes the specified listener.
 void setActive(boolean active)
          Sets whether the audio device is enabled or disabled.
 void setBackendActive(boolean active)
          Schedules a new task for enabling/disabling the audio device.
 void setBackendChannelCount(int channels)
          Schedules a new task for changing the channel number of the audio device.
 void setBackendChannelParameter(int channel, Parameter prm)
          Schedules a new task for altering a specific setting of the specified audio output channel.
 void setBackendDeviceParameter(Parameter prm)
          Schedules a new task for altering a specific setting of the audio output device.
 void setDeviceInfo(AudioOutputDevice device)
          Updates the settings of the audio device represented by this model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultAudioDeviceModel

public DefaultAudioDeviceModel(AudioOutputDevice audioDevice)
Creates a new instance of DefaultAudioDeviceModel using the specified non-null audio device.

Parameters:
audioDevice - An AudioOutputDevice instance providing the current settings of the audio device which will be represented by this model.
Throws:
java.lang.IllegalArgumentException - If audioDevice is null.
Method Detail

addAudioDeviceListener

public void addAudioDeviceListener(AudioDeviceListener l)
Registers the specified listener to be notified when the settings of the audio device are changed.

Specified by:
addAudioDeviceListener in interface AudioDeviceModel
Parameters:
l - The AudioDeviceListener to register.

removeAudioDeviceListener

public void removeAudioDeviceListener(AudioDeviceListener l)
Removes the specified listener.

Specified by:
removeAudioDeviceListener in interface AudioDeviceModel
Parameters:
l - The AudioDeviceListener to remove.

getDeviceId

public int getDeviceId()
Gets the numerical ID of this audio device.

Specified by:
getDeviceId in interface AudioDeviceModel
Returns:
The numerical ID of this audio device or -1 if the device number is not set.

getDeviceInfo

public AudioOutputDevice getDeviceInfo()
Gets the current settings of the audio device represented by this model.

Specified by:
getDeviceInfo in interface AudioDeviceModel
Returns:
AudioOutputDevice instance providing the current settings of the audio device represented by this model.

setDeviceInfo

public void setDeviceInfo(AudioOutputDevice device)
Updates the settings of the audio device represented by this model.

Specified by:
setDeviceInfo in interface AudioDeviceModel
Parameters:
device - The new audio device settings.

setActive

public void setActive(boolean active)
Sets whether the audio device is enabled or disabled.

Specified by:
setActive in interface AudioDeviceModel
Parameters:
active - If true the audio device is enabled, else the device is disabled.

isActive

public boolean isActive()
Determines whether the audio device is active.

Specified by:
isActive in interface AudioDeviceModel
Returns:
true if the device is enabled and false otherwise.

setBackendActive

public void setBackendActive(boolean active)
Schedules a new task for enabling/disabling the audio device.

Specified by:
setBackendActive in interface AudioDeviceModel
Parameters:
active - If true the audio device is enabled, else the device is disabled.

setBackendDeviceParameter

public void setBackendDeviceParameter(Parameter prm)
Schedules a new task for altering a specific setting of the audio output device.

Specified by:
setBackendDeviceParameter in interface AudioDeviceModel
Parameters:
prm - The parameter to be set.

setBackendChannelCount

public void setBackendChannelCount(int channels)
Schedules a new task for changing the channel number of the audio device.

Specified by:
setBackendChannelCount in interface AudioDeviceModel
Parameters:
channels - The new number of audio channels.

setBackendChannelParameter

public void setBackendChannelParameter(int channel,
                                       Parameter prm)
Schedules a new task for altering a specific setting of the specified audio output channel.

Specified by:
setBackendChannelParameter in interface AudioDeviceModel
Parameters:
channel - The channel number.
prm - The parameter to be set.

JSampler
v0.8a

Copyright © 2007 Grigor Iliev. All rights reserved.