--- jlscp/trunk/src/org/linuxsampler/lscp/AbstractDevice.java 2005/10/02 14:40:52 783 +++ jlscp/trunk/src/org/linuxsampler/lscp/AbstractDevice.java 2005/10/10 14:55:44 784 @@ -30,17 +30,32 @@ * @author Grigor Iliev */ public abstract class AbstractDevice implements Device { + private int id = -1; private String driver = null; private boolean active = false; private final Vector prmList = new Vector(); - + /** Creates new instance of AbstractDevice */ public AbstractDevice() { } /** + * Gets the numerical ID of this device. + * @return The numerical ID of this device or -1 if the device number is not set. + */ + public int + getDeviceID() { return id; } + + /** + * Sets the numerical ID of this device. + * @param id The new numerical ID of this device. + */ + public void + setDeviceID(int id) { this.id = id; } + + /** * Gets the driver name used by this device. * @return The driver name used by this device. */ @@ -90,4 +105,11 @@ */ public boolean hasAdditionalParameters() { return !prmList.isEmpty(); } + + /** + * Returns the numerical ID of the device. + * @return The numerical ID of the device. + */ + public String + toString() { return String.valueOf(getDeviceID()); } }