jlscp
v0.8

org.linuxsampler.lscp
Class MidiInstrumentInfo

java.lang.Object
  extended by org.linuxsampler.lscp.AbstractInstrument
      extended by org.linuxsampler.lscp.MidiInstrumentInfo
All Implemented Interfaces:
Instrument, Parseable

public class MidiInstrumentInfo
extends AbstractInstrument
implements Parseable

Provides information about a MIDI instrument.


Nested Class Summary
static class MidiInstrumentInfo.LoadMode
           
 
Constructor Summary
MidiInstrumentInfo()
          Creates a new instance of MidiInstrumentInfo
MidiInstrumentInfo(int mapId, MidiInstrumentEntry entry)
          Creates a new instance of MidiInstrumentInfo.
MidiInstrumentInfo(int mapId, MidiInstrumentEntry entry, java.lang.String[] resultSet)
          Creates a new instance of MidiInstrumentInfo and parses the provided information about this instrument.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Determines whether the specified object is of type MidiInstrumentInfo and has equal map ID, MIDI bank and MIDI program.
 java.lang.String getEngine()
          Gets the name of the sampler engine to be used to load the instrument.
 MidiInstrumentEntry getEntry()
          Gets the position of the MIDI instrument in a MIDI instrument map.
 java.lang.String getInstrumentName()
          Gets the name of the loaded instrument as reflected by its file.
 MidiInstrumentInfo.LoadMode getLoadMode()
          Gets the load mode of this MIDI instrument.
 int getMapId()
          Gets the ID of the map containing this instrument.
 int getMidiBank()
          Gets the index of the MIDI bank, containing this instrument.
 int getMidiProgram()
          Gets the MIDI program number of this instrument.
 double getVolume()
          Returns the volume, specified for this instrument, where a value < 1.0 means attenuation and a value > 1.0 means amplification.
 boolean parse(java.lang.String s)
          Parses a line of text.
 void setEngine(java.lang.String engine)
          Sets the name of the sampler engine to be used to load the instrument.
 void setLoadMode(MidiInstrumentInfo.LoadMode loadMode)
          Sets the load mode of this MIDI instrument.
 void setVolume(double volume)
          Sets the volume level for this instrument, where a value < 1.0 means attenuation and a value > 1.0 means amplification.
 
Methods inherited from class org.linuxsampler.lscp.AbstractInstrument
getDescription, getFilePath, getFormatFamily, getFormatVersion, getInstrumentIndex, getKeyMapping, getKeyswitchMapping, getName, setFilePath, setInstrumentIndex, setName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MidiInstrumentInfo

public MidiInstrumentInfo()
Creates a new instance of MidiInstrumentInfo


MidiInstrumentInfo

public MidiInstrumentInfo(int mapId,
                          MidiInstrumentEntry entry)
Creates a new instance of MidiInstrumentInfo.

Parameters:
mapId - The ID of the map containing this instrument.
entry - The instrument position in the map.

MidiInstrumentInfo

public MidiInstrumentInfo(int mapId,
                          MidiInstrumentEntry entry,
                          java.lang.String[] resultSet)
                   throws LscpException
Creates a new instance of MidiInstrumentInfo and parses the provided information about this instrument.

Parameters:
mapId - The ID of the map containing this instrument.
entry - Provides the position of the MIDI instrument in the MIDI instrument map.
resultSet - An array with information categories about a MIDI instrument.
Throws:
LscpException - If the parse fails.
Method Detail

getEntry

public MidiInstrumentEntry getEntry()
Gets the position of the MIDI instrument in a MIDI instrument map.

Returns:
The position of the MIDI instrument in a MIDI instrument map.

getMapId

public int getMapId()
Gets the ID of the map containing this instrument.

Returns:
The ID of the map containing this instrument.

getMidiBank

public int getMidiBank()
Gets the index of the MIDI bank, containing this instrument.

Returns:
The index of the MIDI bank, containing this instrument.

getMidiProgram

public int getMidiProgram()
Gets the MIDI program number of this instrument.

Returns:
The MIDI program number of this instrument.

getEngine

public java.lang.String getEngine()
Gets the name of the sampler engine to be used to load the instrument.

Specified by:
getEngine in interface Instrument
Returns:
The name of the sampler engine to be used to load the instrument.

setEngine

public void setEngine(java.lang.String engine)
Sets the name of the sampler engine to be used to load the instrument.

Parameters:
engine - The name of the sampler engine to be used to load the instrument.

getInstrumentName

public java.lang.String getInstrumentName()
Gets the name of the loaded instrument as reflected by its file.

Returns:
The name of the loaded instrument as reflected by its file.

getVolume

public double getVolume()
Returns the volume, specified for this instrument, where a value < 1.0 means attenuation and a value > 1.0 means amplification.


setVolume

public void setVolume(double volume)
Sets the volume level for this instrument, where a value < 1.0 means attenuation and a value > 1.0 means amplification.


getLoadMode

public MidiInstrumentInfo.LoadMode getLoadMode()
Gets the load mode of this MIDI instrument.

Returns:
The load mode of this MIDI instrument.

setLoadMode

public void setLoadMode(MidiInstrumentInfo.LoadMode loadMode)
Sets the load mode of this MIDI instrument.

Parameters:
loadMode - Specifies the load mode for this MIDI instrument.

parse

public boolean parse(java.lang.String s)
              throws LscpException
Parses a line of text.

Specified by:
parse in interface Parseable
Overrides:
parse in class AbstractInstrument
Parameters:
s - The string to be parsed.
Returns:
true if the line has been processed, false otherwise.
Throws:
LscpException - If some error occurs.

equals

public boolean equals(java.lang.Object obj)
Determines whether the specified object is of type MidiInstrumentInfo and has equal map ID, MIDI bank and MIDI program.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The reference object with which to compare.
Returns:
true if the specified object is of type MidiInstrumentInfo and has equal map ID, MIDI bank and MIDI program.

jlscp
v0.8

Copyright © 2009 Grigor Iliev. All rights reserved.