--- jsampler/trunk/src/org/jsampler/Instrument.java 2006/08/07 18:34:40 912 +++ jsampler/trunk/src/org/jsampler/Instrument.java 2007/04/02 21:18:31 1143 @@ -1,7 +1,7 @@ /* * JSampler - a java front-end for LinuxSampler * - * Copyright (C) 2005, 2006 Grigor Kirilov Iliev + * Copyright (C) 2005-2007 Grigor Iliev * * This file is part of JSampler. * @@ -22,11 +22,6 @@ package org.jsampler; -import java.util.Vector; - -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap; @@ -38,68 +33,16 @@ * * @author Grigor Iliev */ -public class Instrument { - private String name = "Untitled"; - private String description = ""; +public class Instrument extends Resource { private String path = null; private int instrumentIndex = 0; - - private final Vector listeners = new Vector(); - + private String engine = "GIG"; /** Creates a new instance of Instrument. */ public Instrument() { } /** - * Registers the specified listener to be notified when the instrument settings are changed. - * @param l The OrchestraListener to register. - */ - public void - addChangeListener(ChangeListener l) { listeners.add(l); } - - /** - * Removes the specified listener. - * @param l The OrchestraListener to remove. - */ - public void - removeChangeListener(ChangeListener l) { listeners.remove(l); } - - /** - * Gets the name of this instrument. - * @return The name of this instrument. - */ - public String - getName() { return name; } - - /** - * Sets the name of this instrument. - * @param name The new name of this instrument. - */ - public void - setName(String name) { - this.name = name; - fireChangeEvent(); - } - - /** - * Gets a brief description about this instrument. - * @return A brief description about this instrument. - */ - public String - getDescription() { return description; } - - /** - * Sets a description about this instrument. - * @param desc A brief description about this instrument. - */ - public void - setDescription(String desc) { - description = desc; - fireChangeEvent(); - } - - /** * Returns the absolute pathname of the instrument location. * @return The absolute pathname of the instrument location. */ @@ -134,6 +77,19 @@ } /** + * Gets the engine to be used for loading this instrument. + * @return The engine to be used for loading this instrument. + */ + public String + getEngine() { return engine; } + + /** + * Sets the engine to be used for loading this instrument. + */ + public void + setEngine(String engine) { this.engine = engine; } + + /** * Returns the name of this instrument. * @return The name of this instrument. */ @@ -200,13 +156,6 @@ return s.startsWith("[Instrument Definition]\n"); } - /** Notifies listeners that the instrument settings has changed. */ - private void - fireChangeEvent() { - ChangeEvent e = new ChangeEvent(this); - for(ChangeListener l : listeners) l.stateChanged(e); - } - /** * Reads and sets the instrument properties by the supplied node. * @param node The node providing the instrument properties.