jlscp
v0.8

org.linuxsampler.lscp
Class AbstractDevice

java.lang.Object
  extended by org.linuxsampler.lscp.AbstractDevice
All Implemented Interfaces:
Device
Direct Known Subclasses:
AudioOutputDevice, MidiInputDevice

public abstract class AbstractDevice
extends java.lang.Object
implements Device

This class provides default implementation of the Device interface.


Constructor Summary
AbstractDevice()
          Creates new instance of AbstractDevice
 
Method Summary
 void addParameter(Parameter prm)
          Adds additional parameter to this device.
 Parameter<java.lang.Boolean> getActiveParameter()
          Gets the ACTIVE parameter.
 Parameter[] getAdditionalParameters()
          Gets Parameter array with the additional parameters of this device.
 int getDeviceId()
          Gets the numerical ID of this device.
 java.lang.String getDriverName()
          Gets the driver name used by this device.
 boolean hasAdditionalParameters()
          Determines whether this device has additional parameters.
 boolean isActive()
          Determines whether this device is active.
 void setActive(boolean active)
          Sets whether this audio output device is active or not.
 void setDeviceId(int id)
          Sets the numerical ID of this device.
 void setDriverName(java.lang.String driver)
          Sets the driver name of this device.
 java.lang.String toString()
          Returns the numerical ID of the device.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractDevice

public AbstractDevice()
Creates new instance of AbstractDevice

Method Detail

getDeviceId

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

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

setDeviceId

public void setDeviceId(int id)
Sets the numerical ID of this device.

Parameters:
id - The new numerical ID of this device.

getDriverName

public java.lang.String getDriverName()
Gets the driver name used by this device.

Specified by:
getDriverName in interface Device
Returns:
The driver name used by this device.

setDriverName

public void setDriverName(java.lang.String driver)
Sets the driver name of this device.

Parameters:
driver - The new name for this device.

isActive

public boolean isActive()
Determines whether this device is active.

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

setActive

public void setActive(boolean active)
Sets whether this audio output device is active or not.

Parameters:
active - false if the device is inactive and doesn't output any sound, true otherwise.

getActiveParameter

public Parameter<java.lang.Boolean> getActiveParameter()
Gets the ACTIVE parameter.

Specified by:
getActiveParameter in interface Device
Returns:
A Parameter instance representing the active state of the device.

addParameter

public void addParameter(Parameter prm)
Adds additional parameter to this device.

Parameters:
prm - The additional parameter to be added.

getAdditionalParameters

public Parameter[] getAdditionalParameters()
Gets Parameter array with the additional parameters of this device.

Specified by:
getAdditionalParameters in interface Device
Returns:
Parameter array with the additional parameters of this device.

hasAdditionalParameters

public boolean hasAdditionalParameters()
Determines whether this device has additional parameters.

Specified by:
hasAdditionalParameters in interface Device
Returns:
true if this device has additional parameters, false otherwise.

toString

public java.lang.String toString()
Returns the numerical ID of the device.

Overrides:
toString in class java.lang.Object
Returns:
The numerical ID of the device.

jlscp
v0.8

Copyright © 2009 Grigor Iliev. All rights reserved.