jlscp
v0.8

org.linuxsampler.lscp
Class Client

java.lang.Object
  extended by org.linuxsampler.lscp.Client

public class Client
extends java.lang.Object

This class is the abstraction representing a client endpoint for communication with LinuxSampler instance. Since it implements all commands specified in the LSCP protocol v1.3, for more information look at the LSCP specification.

The following code establishes connection to LinuxSampler instance and gets the LinuxSampler version:

        try {
                Client client = new Client();
                client.connect();
                
                String version = client.getServerInfo().getVersion();
                System.out.println(version);
                
                client.disconnect();
        } catch(Exception x) { x.printStackTrace(); }
 

For more examples look at the examples directory located in the jlscp distribution.

All methods are thread safe.


Nested Class Summary
static class Client.ScanMode
           
 
Constructor Summary
Client()
          Creates a new instance of Client with default server address and port.
Client(boolean printOnlyMode)
          Creates a new instance of Client.
Client(java.lang.String address)
          Creates a new instance of Client with the specified address and default port.
Client(java.lang.String address, int port)
          Creates a new instance of Client with the specified address and port.
 
Method Summary
 void addAudioDeviceCountListener(ItemCountListener l)
          Registers the specified listener for receiving event messages.
 void addAudioDeviceInfoListener(ItemInfoListener l)
          Registers the specified listener for receiving event messages.
 void addBufferFillListener(BufferFillListener l)
          Registers the specified listener for receiving event messages.
 void addChannelCountListener(ChannelCountListener l)
          Registers the specified listener for receiving event messages.
 void addChannelInfoListener(ChannelInfoListener l)
          Registers the specified listener for receiving event messages.
 void addChannelMidiDataListener(ChannelMidiDataListener l)
          Registers the specified listener for receiving event messages.
 void addDbDirectory(java.lang.String dir)
          Adds the specified directory to the instruments database.
 void addDbInstrument(java.lang.String dbDir, java.lang.String filePath, int instrIndex)
          Adds the specified instrument to the specified instruments database directory.
 int addDbInstrument(java.lang.String dbDir, java.lang.String filePath, int instrIndex, boolean background)
          Adds the specified instrument to the specified instruments database directory.
 void addDbInstruments(Client.ScanMode mode, java.lang.String dbDir, java.lang.String fsDir)
          Adds the instruments in the specified file system directory to the specified instruments database directory.
 int addDbInstruments(Client.ScanMode mode, java.lang.String dbDir, java.lang.String fsDir, boolean background)
          Adds the instruments in the specified file system directory to the specified instruments database directory.
 int addDbInstruments(Client.ScanMode mode, java.lang.String dbDir, java.lang.String fsDir, boolean background, boolean insDir)
          Adds the instruments in the specified file system directory to the specified instruments database directory.
 void addDbInstruments(java.lang.String dbDir, java.lang.String filePath)
          Adds the instruments in the specified file to the specified instruments database directory.
 int addDbInstruments(java.lang.String dbDir, java.lang.String filePath, boolean background)
          Adds the instruments in the specified file to the specified instruments database directory.
 void addDeviceMidiDataListener(DeviceMidiDataListener l)
          Registers the specified listener for receiving event messages.
 void addFxSendCountListener(FxSendCountListener l)
          Registers the specified listener for receiving event messages.
 void addFxSendInfoListener(FxSendInfoListener l)
          Registers the specified listener for receiving event messages.
 void addGlobalInfoListener(GlobalInfoListener l)
          Registers the specified listener for receiving event messages.
 void addInstrumentsDbListener(InstrumentsDbListener l)
          Registers the specified listener for receiving event messages.
 void addMidiDeviceCountListener(ItemCountListener l)
          Registers the specified listener for receiving event messages.
 void addMidiDeviceInfoListener(ItemInfoListener l)
          Registers the specified listener for receiving event messages.
 void addMidiInstrumentCountListener(MidiInstrumentCountListener l)
          Registers the specified listener for receiving event messages.
 void addMidiInstrumentInfoListener(MidiInstrumentInfoListener l)
          Registers the specified listener for receiving event messages.
 int addMidiInstrumentMap(java.lang.String name)
          Adds a new MIDI instrument map.
 void addMidiInstrumentMapCountListener(ItemCountListener l)
          Registers the specified listener for receiving event messages.
 void addMidiInstrumentMapInfoListener(ItemInfoListener l)
          Registers the specified listener for receiving event messages.
 void addMiscellaneousListener(MiscellaneousListener l)
          Registers the specified listener for receiving event messages.
 int addSamplerChannel()
          Adds a new sampler channel.
 void addStreamCountListener(StreamCountListener l)
          Registers the specified listener for receiving event messages.
 void addTotalStreamCountListener(TotalStreamCountListener l)
          Registers the specified listener for receiving event messages.
 void addTotalVoiceCountListener(TotalVoiceCountListener l)
          Registers the specified listener for receiving event messages.
 void addVoiceCountListener(VoiceCountListener l)
          Registers the specified listener for receiving event messages.
 void connect()
          Connects to the LinuxSampler.
 void copyDbDirectories(java.lang.String[] dirs, java.lang.String dst)
          Copies the specified directories into the specified location.
 void copyDbDirectory(java.lang.String dir, java.lang.String dst)
          Copies the specified directory into the specified location.
 void copyDbInstrument(java.lang.String instr, java.lang.String dst)
          Copies the specified instrument into the specified location.
 void copyDbInstruments(java.lang.String[] instrs, java.lang.String dst)
          Copies the specified instruments into the specified location.
 int createAudioOutputDevice(java.lang.String aoDriver, Parameter... paramList)
          Creates a new audio output device for the desired audio output system.
 int createFxSend(int channel, int midiCtrl)
          Creates an additional effect send on the specified sampler channel.
 int createFxSend(int channel, int midiCtrl, java.lang.String name)
          Creates an additional effect send on the specified sampler channel.
 int createMidiInputDevice(java.lang.String miDriver, Parameter... paramList)
          Creates a new MIDI input device.
 void destroyAudioOutputDevice(int deviceId)
          Destroys already created audio output device.
 void destroyFxSend(int channel, int fxSend)
          Destroys the specified effect send on the specified sampler channel.
 void destroyMidiInputDevice(int deviceId)
          Destroys already created MIDI input device.
 void disconnect()
          Closes the connection to LinuxSampler.
 void editChannelInstrument(int samplerChn)
          Starts an instrument editor for editing the loaded instrument on the specified sampler channel.
 void enableAudioOutputDevice(int deviceId, boolean enable)
          Enables/disables the specified audio output device.
 void enableMidiInputDevice(int deviceId, boolean enable)
          Enables/disables the specified MIDI input device.
 DbDirectoryInfo[] findDbDirectories(java.lang.String dir, DbSearchQuery query)
          Finds all directories in the specified directory that corresponds to the specified search criterias.
 DbDirectoryInfo[] findDbDirectories(java.lang.String dir, DbSearchQuery query, boolean nonRecursive)
          Finds all directories in the specified directory that corresponds to the specified search criterias.
 DbInstrumentInfo[] findDbInstruments(java.lang.String dir, DbSearchQuery query)
          Finds all instruments in the specified directory that corresponds to the specified search criterias.
 DbInstrumentInfo[] findDbInstruments(java.lang.String dir, DbSearchQuery query, boolean nonRecursive)
          Finds all instruments in the specified directory that corresponds to the specified search criterias.
 java.lang.String[] findLostDbInstrumentFiles()
          Returns a list of all instrument files in the database that that don't exist in the filesystem.
 void formatInstrumentsDb()
          Removes all instruments and directories and re-creates the instruments database structure.
 AudioOutputChannel getAudioOutputChannelInfo(int deviceId, int audioChn)
          Gets information about an audio channel.
 Parameter getAudioOutputChannelParameterInfo(int devId, int chan, java.lang.String param)
          Gets detailed information about a specific audio output channel parameter.
 int getAudioOutputDeviceCount()
          Gets the current number of all created audio output devices.
 java.lang.Integer[] getAudioOutputDeviceIDs()
          Gets a list of numerical IDs of all created audio output devices.
 AudioOutputDevice getAudioOutputDeviceInfo(int deviceId)
          Gets the current settings of a specific, already created audio output device.
 AudioOutputDevice[] getAudioOutputDevices()
          Gets a list of all created audio output devices.
 int getAudioOutputDriverCount()
          Gets the number of all audio output drivers currently available for the LinuxSampler instance.
 AudioOutputDriver getAudioOutputDriverInfo(java.lang.String driverName, Parameter... depList)
          Gets detailed information about a specific audio output driver.
 Parameter getAudioOutputDriverParameterInfo(java.lang.String driver, java.lang.String param, Parameter... deplist)
          Gets detailed information about a specific audio output driver parameter.
 AudioOutputDriver[] getAudioOutputDrivers()
          Gets all audio output drivers currently available for the LinuxSampler instance.
 java.util.Vector<BufferFill> getChannelBufferFillBytes(int samplerChn)
          Gets the current fill state of all disk streams on the specified sampler channel in bytes.
 java.util.Vector<BufferFill> getChannelBufferFillPercentage(int samplerChn)
          Gets the current fill state of all disk streams on the specified sampler channel in percent.
 int getChannelStreamCount(int samplerChn)
          Gets the current number of active disk streams on the specified sampler channel.
 int getChannelVoiceCount(int samplerChn)
          Gets the current number of active voices on the specified sampler channel.
static java.lang.String getClientVersion()
          Specifies the jlscp version.
 DbDirectoryInfo[] getDbDirectories(java.lang.String dir)
          Gets the list of directories in the specified directory.
 int getDbDirectoryCount(java.lang.String dir)
          Gets the number of directories in the specified directory.
 int getDbDirectoryCount(java.lang.String dir, boolean recursive)
          Gets the number of directories in the specified directory.
 DbDirectoryInfo getDbDirectoryInfo(java.lang.String dir)
          Gets information about the specified directory.
 java.lang.String[] getDbDirectoryNames(java.lang.String dir)
          Gets the list of directories in the specified directory.
 int getDbInstrumentCount(java.lang.String dir)
          Gets the number of instruments in the specified directory.
 int getDbInstrumentCount(java.lang.String dir, boolean recursive)
          Gets the number of instruments in the specified directory.
 DbInstrumentInfo getDbInstrumentInfo(java.lang.String instr)
          Gets information about the specified instrument.
 java.lang.String[] getDbInstrumentNames(java.lang.String dir)
          Gets the list of instruments in the specified directory.
 DbInstrumentInfo[] getDbInstruments(java.lang.String dir)
          Gets the list of instruments in the specified directory.
 ScanJobInfo getDbInstrumentsJobInfo(int jobId)
          Gets status information about the specified job.
 int getEngineCount()
          Gets the number of all available engines.
 SamplerEngine[] getEngines()
          Gets a list of all available engines.
 boolean getExtendedCharacterEscaping()
          Determines whether strings sent to LinuxSampler should be more aggressively escaped.
 int getFileInstrumentCount(java.lang.String filename)
          Gets the number of instruments in the specified instrument file.
 Instrument getFileInstrumentInfo(java.lang.String filename, int instrIdx)
          Gets information about the instrument with index instrIdx in the specified instrument file.
 Instrument[] getFileInstruments(java.lang.String filename)
          Gets the list of instruments in the specified instrument file.
 java.lang.Integer[] getFxSendIDs(int channel)
          Gets a list of effect sends on the specified sampler channel.
 FxSend getFxSendInfo(int channel, int fxSend)
          Gets the current settings of the specified effect send entity.
 FxSend[] getFxSends(int channel)
          Gets a list of all created effect sends on the specified sampler channel.
 int getFxSoundCount(int channel)
          Gets the current number of effect sends on the specified sampler channel.
 int getGlobalStreamLimit()
          Gets the global sampler-wide limit of maximum disk streams.
 int getGlobalVoiceLimit()
          Gets the global sampler-wide limit of maximum voices.
protected static java.util.logging.Logger getLogger()
          Returns the logger for this library.
 int getMidiInputDeviceCount()
          Gets the current number of all created MIDI input devices.
 java.lang.Integer[] getMidiInputDeviceIDs()
          Gets a list of numerical IDs of all created MIDI input devices.
 MidiInputDevice getMidiInputDeviceInfo(int deviceId)
          Gets the current settings of a specific, already created MIDI input device.
 MidiInputDevice[] getMidiInputDevices()
          Gets a list of all created MIDI input devices.
 int getMidiInputDriverCount()
          Gets the current number of all MIDI input drivers.
 MidiInputDriver getMidiInputDriverInfo(java.lang.String driverName, Parameter... depList)
          Gets detailed information about a specific MIDI input driver.
 Parameter getMidiInputDriverParameterInfo(java.lang.String driver, java.lang.String param, Parameter... deplist)
          Gets detailed information about a specific MIDI input driver parameter.
 MidiInputDriver[] getMidiInputDrivers()
          Gets all MIDI input drivers currently available for the LinuxSampler instance.
 MidiPort getMidiInputPortInfo(int deviceId, int midiPort)
          Gets detailed information about a specific MIDI input port.
 Parameter getMidiInputPortParameterInfo(int deviceId, int port, java.lang.String param)
          Gets detailed information about a specific MIDI input port parameter.
 int getMidiInstrumentCount()
          Gets the current number of all MIDI instrument in all maps.
 int getMidiInstrumentCount(int mapId)
          Gets the current number of MIDI instrument in the specified map.
 int[][] getMidiInstrumentEntries(int mapId)
          Gets all MIDI instrument entries contained int the specified MIDI instrument map.
 MidiInstrumentInfo getMidiInstrumentInfo(int mapId, int bank, int program)
          Gets the current settings of the specified MIDI instrument.
 int getMidiInstrumentMapCount()
          Gets the current number of all MIDI instrument maps.
 java.lang.Integer[] getMidiInstrumentMapIDs()
          Gets a list of numerical IDs of all created MIDI instrument maps.
 MidiInstrumentMapInfo getMidiInstrumentMapInfo(int mapId)
          Gets the current settings of a specific, already created MIDI instrument map.
 MidiInstrumentMapInfo[] getMidiInstrumentMaps()
          Gets an information of all created MIDI instrument maps.
 MidiInstrumentInfo[] getMidiInstruments()
          Gets all MIDI instrument from all maps.
 MidiInstrumentInfo[] getMidiInstruments(int mapId)
          Gets all MIDI instruments contained int the specified MIDI instrument map.
 boolean getPrintOnlyMode()
          Determines whether the client is in print-only mode.
 int getSamplerChannelCount()
          Gets the current number of all created sampler channels.
 java.lang.Integer[] getSamplerChannelIDs()
          Gets a list with numerical IDs of all created sampler channels.
 SamplerChannel getSamplerChannelInfo(int samplerChn)
          Gets the current settings of the specified sampler channel.
 SamplerChannel[] getSamplerChannels()
          Gets a list of all created sampler channels.
 java.lang.String getServerAddress()
          Gets the Linux Sampler address.
 ServerInfo getServerInfo()
          Gets information about the LinuxSampler instance.
 int getServerPort()
          Gets the Linux Sampler port number.
 int getTotalStreamCount()
          Gets the current number of all active streams.
 int getTotalVoiceCount()
          Gets the current number of all active voices.
 int getTotalVoiceCountMax()
          Gets the maximum number of active voices.
 float getVolume()
          Gets the global volume of the sampler.
 boolean isConnected()
          Determines whether the client is connected.
 void loadInstrument(java.lang.String filename, int instrIdx, int samplerChn)
          Loads and assigns an instrument to a sampler channel.
 void loadInstrument(java.lang.String filename, int instrIdx, int samplerChn, boolean nonModal)
          Loads and assigns an instrument to a sampler channel.
 void loadSamplerEngine(java.lang.String engineName, int samplerChn)
          Loads a sampler engine to a specific sampler channel.
 void mapMidiInstrument(int mapId, MidiInstrumentEntry entry, MidiInstrumentInfo info)
          Creates or replaces a MIDI instrument map entry.
 void mapMidiInstrument(int mapId, MidiInstrumentEntry entry, MidiInstrumentInfo info, boolean nonModal)
          Creates or replaces a MIDI instrument map entry.
 void moveDbDirectories(java.lang.String[] dirs, java.lang.String dst)
          Moves the specified directories into the specified location.
 void moveDbDirectory(java.lang.String dir, java.lang.String dst)
          Moves the specified directory into the specified location.
 void moveDbInstrument(java.lang.String instr, java.lang.String dst)
          Moves the specified instrument into the specified location.
 void moveDbInstruments(java.lang.String[] instrs, java.lang.String dst)
          Moves the specified instruments into the specified location.
 void removeAllMidiInstrumentMaps()
          Removes the all MIDI instrument maps.
 void removeAudioDeviceCountListener(ItemCountListener l)
          Removes the specified listener.
 void removeAudioDeviceInfoListener(ItemInfoListener l)
          Removes the specified listener.
 void removeBufferFillListener(BufferFillListener l)
          Removes the specified listener.
 void removeChannelCountListener(ChannelCountListener l)
          Removes the specified listener.
 void removeChannelInfoListener(ChannelInfoListener l)
          Removes the specified listener.
 void removeChannelMidiDataListener(ChannelMidiDataListener l)
          Removes the specified listener.
 void removeDbDirectories(java.lang.String[] dirs, boolean force)
          Removes the specified directories from the instruments database.
 void removeDbDirectory(java.lang.String dir)
          Removes the specified directory from the instruments database.
 void removeDbDirectory(java.lang.String dir, boolean force)
          Removes the specified directory from the instruments database.
 void removeDbInstrument(java.lang.String instr)
          Removes the specified instrument from the instruments database.
 void removeDbInstruments(java.lang.String[] instrs)
          Removes the specified instruments from the instruments database.
 void removeDeviceMidiDataListener(DeviceMidiDataListener l)
          Removes the specified listener.
 void removeFxSendCountListener(FxSendCountListener l)
          Removes the specified listener.
 void removeFxSendInfoListener(FxSendInfoListener l)
          Removes the specified listener.
 void removeGlobalInfoListener(GlobalInfoListener l)
          Removes the specified listener.
 void removeInstrumentsDbListener(InstrumentsDbListener l)
          Removes the specified listener.
 void removeMidiDeviceCountListener(ItemCountListener l)
          Removes the specified listener.
 void removeMidiDeviceInfoListener(ItemInfoListener l)
          Removes the specified listener.
 void removeMidiInstrumentCountListener(MidiInstrumentCountListener l)
          Removes the specified listener.
 void removeMidiInstrumentInfoListener(MidiInstrumentInfoListener l)
          Removes the specified listener.
 void removeMidiInstrumentMap(int mapId)
          Removes the specified MIDI instrument map.
 void removeMidiInstrumentMapCountListener(ItemCountListener l)
          Removes the specified listener.
 void removeMidiInstrumentMapInfoListener(ItemInfoListener l)
          Removes the specified listener.
 void removeMiscellaneousListener(MiscellaneousListener l)
          Removes the specified listener.
 void removeSamplerChannel(int samplerChn)
          Removes the specified sampler channel.
 void removeStreamCountListener(StreamCountListener l)
          Removes the specified listener.
 void removeTotalStreamCountListener(TotalStreamCountListener l)
          Removes the specified listener.
 void removeTotalVoiceCountListener(TotalVoiceCountListener l)
          Removes the specified listener.
 void removeVoiceCountListener(VoiceCountListener l)
          Removes the specified listener.
 void renameDbDirectory(java.lang.String dir, java.lang.String name)
          Renames the specified directory.
 void renameDbInstrument(java.lang.String instr, java.lang.String name)
          Renames the specified instrument.
 void resetChannel(int samplerChn)
          Resets the specified sampler channel.
 void resetSampler()
          Resets the whole sampler.
 void sendChannelMidiData(int samplerChn, MidiDataEvent.Type type, int arg1, int arg2)
          Sends a MIDI event to this sampler channel.
 void setAudioOutputChannelCount(int deviceId, int channels)
          Changes the channel number of the speicifed audio output device.
 void setAudioOutputChannelParameter(int devId, int chn, Parameter prm)
          Alters a specific setting of an audio output channel.
 void setAudioOutputDeviceParameter(int deviceId, Parameter prm)
          Alters a specific setting of a created audio output device.
 void setChannelAudioOutputChannel(int samplerChn, int audioOut, int audioIn)
          Sets the audio output channel on the specified sampler channel.
 void setChannelAudioOutputDevice(int samplerChn, int devId)
          Sets the audio output device on the specified sampler channel.
 void setChannelMidiInputChannel(int samplerChn, int midiChn)
          Sets the MIDI input channel the specified sampler channel should listen to.
 void setChannelMidiInputDevice(int samplerChn, int devId)
          Sets the MIDI input device on the specified sampler channel.
 void setChannelMidiInputPort(int samplerChn, int port)
          Sets the MIDI input port on the specified sampler channel.
 void setChannelMidiInstrumentMap(int samplerChn, int mapId)
          Sets the MIDI instrument map to be used on the specified sampler channel.
 void setChannelMute(int samplerChn, boolean mute)
          Mute/unmute the specified sampler channel.
 void setChannelSolo(int samplerChn, boolean solo)
          Solo/unsolo the specified sampler channel.
 void setChannelVolume(int samplerChn, float volume)
          Sets the volume of the specified sampler channel.
 void setDbDirectoryDescription(java.lang.String dir, java.lang.String desc)
          Changes the description of the specified directory.
 void setDbInstrumentDescription(java.lang.String instr, java.lang.String desc)
          Changes the description of the specified instrument.
 void setDbInstrumentFilePath(java.lang.String oldPath, java.lang.String newPath)
          Substitutes all occurrences of the instrument file oldPath in the database, with newPath.
 void setExtendedCharacterEscaping(boolean b)
          Sets whether strings sent to LinuxSampler should be more aggressively escaped.
 void setFxSendAudioOutputChannel(int channel, int fxSend, int audioSrc, int audioDst)
          Sets the destination of an effect send's audio channel in the specified sampler channel.
 void setFxSendLevel(int channel, int fxSend, float volume)
          Sets the current send level of the specified effect send entity in the specified sampler channel.
 void setFxSendMidiController(int channel, int fxSend, int midiCtrl)
          Sets the MIDI controller, which will be able to modify the send level of the specified effect send in the specified sampler channel.
 void setFxSendName(int channel, int fxSend, java.lang.String name)
          Sets the name of the specified effect send.
 void setGlobalStreamLimit(int maxStreams)
          Sets the global sampler-wide limit for maximum disk streams.
 void setGlobalVoiceLimit(int maxVoices)
          Sets the global sampler-wide limit of maximum voices.
 void setMidiInputDeviceParameter(int deviceId, Parameter prm)
          Alters a specific setting of a created MIDI input device.
 void setMidiInputPortCount(int deviceId, int ports)
          Changes the port number of the speicified MIDI input device.
 void setMidiInputPortParameter(int deviceId, int port, Parameter prm)
          Alters a specific setting of a MIDI input port.
 void setMidiInstrumentMapName(int mapId, java.lang.String name)
          Sets the name of the specified MIDI instrument map.
 void setPrintOnlyMode(boolean b)
          Sets the print-only mode.
 void setPrintOnlyModeOutputStream(java.io.OutputStream out)
          Sets the output stream to be used in print-only mode.
 void setServerAddress(java.lang.String address)
          Sets the Linux Sampler address.
 void setServerPort(int port)
          Sets the Linux Sampler port number.
 void setSoTimeout(int timeout)
           
 void setVolume(float volume)
          Sets the global volume of the sampler.
 void unmapMidiInstrument(int mapId, MidiInstrumentEntry entry)
          Removes an entry MIDI instrument map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Client

public Client()
Creates a new instance of Client with default server address and port. The default server address and port are 127.0.0.1:8888.


Client

public Client(java.lang.String address)
Creates a new instance of Client with the specified address and default port. The default port is 8888.

Parameters:
address - The address of linux sampler server.

Client

public Client(java.lang.String address,
              int port)
Creates a new instance of Client with the specified address and port.

Parameters:
address - The address of the Linux Sampler.
port - The Linux Sampler port number.

Client

public Client(boolean printOnlyMode)
Creates a new instance of Client.

Parameters:
printOnlyMode - Determines whether the client will be in print-only mode.
Method Detail

setExtendedCharacterEscaping

public void setExtendedCharacterEscaping(boolean b)
Sets whether strings sent to LinuxSampler should be more aggressively escaped.


getExtendedCharacterEscaping

public boolean getExtendedCharacterEscaping()
Determines whether strings sent to LinuxSampler should be more aggressively escaped.


setSoTimeout

public void setSoTimeout(int timeout)
See Also:
Socket.setSoTimeout(int)

getPrintOnlyMode

public boolean getPrintOnlyMode()
Determines whether the client is in print-only mode. Print-only mode means that the client will just print all LSCP commands to the specified output stream or to the standard output stream (java.lang.System.out) if no output stream is specified, without taking any further actions. Thus, in print-only mode all returned values by Client's methods are meaningless and should be discarded.

Returns:
true if the client is in print-only mode, false otherwise.
See Also:
setPrintOnlyModeOutputStream(java.io.OutputStream)

setPrintOnlyMode

public void setPrintOnlyMode(boolean b)
Sets the print-only mode. Note that in print-only mode all returned values by Client's methods are meaningless and should be discarded. The default output stream in print-only mode is java.lang.System.out.

Parameters:
b - If true all LSCP commands will be sent to the specified output stream or to the standard output stream (java.lang.System.out) if no output stream is specified, and no further actions will be taken.
Throws:
java.lang.IllegalStateException - If the client is connected.
See Also:
setPrintOnlyModeOutputStream(java.io.OutputStream)

setPrintOnlyModeOutputStream

public void setPrintOnlyModeOutputStream(java.io.OutputStream out)
Sets the output stream to be used in print-only mode.

Parameters:
out - The output stream to be used in print-only mode.
Throws:
java.lang.IllegalStateException - If the client is not in print-only mode.
java.lang.IllegalArgumentException - if out is null.
See Also:
setPrintOnlyMode(boolean)

getClientVersion

public static java.lang.String getClientVersion()
Specifies the jlscp version.

Returns:
The jlscp version.

getServerAddress

public java.lang.String getServerAddress()
Gets the Linux Sampler address.

Returns:
The Linux Sampler address.

setServerAddress

public void setServerAddress(java.lang.String address)
Sets the Linux Sampler address.

Parameters:
address - The Linux Sampler address. If address is null sets to default address - 127.0.0.1.

getServerPort

public int getServerPort()
Gets the Linux Sampler port number.

Returns:
The Linux Sampler port number.

setServerPort

public void setServerPort(int port)
Sets the Linux Sampler port number.

Parameters:
port - The Linux Sampler port number.

connect

public void connect()
             throws LscpException
Connects to the LinuxSampler. If there is already established connection then the currently available connection is closed berfore connecting.

Throws:
LscpException - If timeout occurs or any other I/O exception.

disconnect

public void disconnect()
Closes the connection to LinuxSampler.


isConnected

public boolean isConnected()
Determines whether the client is connected.

Returns:
true if there is established connection, false otherwise.

addAudioDeviceCountListener

public void addAudioDeviceCountListener(ItemCountListener l)
Registers the specified listener for receiving event messages. Listeners can be registered regardless of the connection state.

Parameters:
l - The ItemCountListener to register.

removeAudioDeviceCountListener

public void removeAudioDeviceCountListener(ItemCountListener l)
Removes the specified listener. Listeners can be removed regardless of the connection state.

Parameters:
l - The ItemCountListener to remove.

addAudioDeviceInfoListener

public void addAudioDeviceInfoListener(ItemInfoListener l)
Registers the specified listener for receiving event messages. Listeners can be registered regardless of the connection state.

Parameters:
l - The ItemInfoListener to register.

removeAudioDeviceInfoListener

public void removeAudioDeviceInfoListener(ItemInfoListener l)
Removes the specified listener. Listeners can be removed regardless of the connection state.

Parameters:
l - The ItemInfoListener to remove.

addBufferFillListener

public void addBufferFillListener(BufferFillListener l)
Registers the specified listener for receiving event messages. Listeners can be removed regardless of the connection state.

Parameters:
l - The BufferFillListener to register.

removeBufferFillListener

public void removeBufferFillListener(BufferFillListener l)
Removes the specified listener. Listeners can be removed regardless of the connection state.

Parameters:
l - The BufferFillListener to remove.

addChannelCountListener

public void addChannelCountListener(ChannelCountListener l)
Registers the specified listener for receiving event messages. Listeners can be registered regardless of the connection state.

Parameters:
l - The ChannelCountListener to register.

removeChannelCountListener

public void removeChannelCountListener(ChannelCountListener l)
Removes the specified listener. Listeners can be removed regardless of the connection state.

Parameters:
l - The ChannelCountListener to remove.

addChannelInfoListener

public void addChannelInfoListener(ChannelInfoListener l)
Registers the specified listener for receiving event messages. Listeners can be registered regardless of the connection state.

Parameters:
l - The ChannelInfoListener to register.

removeChannelInfoListener

public void removeChannelInfoListener(ChannelInfoListener l)
Removes the specified listener. Listeners can be removed regardless of the connection state.

Parameters:
l - The ChannelInfoListener to remove.

addFxSendCountListener

public void addFxSendCountListener(FxSendCountListener l)
Registers the specified listener for receiving event messages. Listeners can be registered regardless of the connection state.

Parameters:
l - The FxSendCountListener to register.

removeFxSendCountListener

public void removeFxSendCountListener(FxSendCountListener l)
Removes the specified listener. Listeners can be removed regardless of the connection state.

Parameters:
l - The FxSendCountListener to remove.

addFxSendInfoListener

public void addFxSendInfoListener(FxSendInfoListener l)
Registers the specified listener for receiving event messages. Listeners can be registered regardless of the connection state.

Parameters:
l - The FxSendInfoListener to register.

removeFxSendInfoListener

public void removeFxSendInfoListener(FxSendInfoListener l)
Removes the specified listener. Listeners can be removed regardless of the connection state.

Parameters:
l - The FxSendInfoListener to remove.

addMidiDeviceCountListener

public void addMidiDeviceCountListener(ItemCountListener l)
Registers the specified listener for receiving event messages. Listeners can be registered regardless of the connection state.

Parameters:
l - The ItemCountListener to register.

removeMidiDeviceCountListener

public void removeMidiDeviceCountListener(ItemCountListener l)
Removes the specified listener. Listeners can be removed regardless of the connection state.

Parameters:
l - The ItemCountListener to remove.

addMidiDeviceInfoListener

public void addMidiDeviceInfoListener(ItemInfoListener l)
Registers the specified listener for receiving event messages. Listeners can be registered regardless of the connection state.

Parameters:
l - The ItemInfoListener to register.

removeMidiDeviceInfoListener

public void removeMidiDeviceInfoListener(ItemInfoListener l)
Removes the specified listener. Listeners can be removed regardless of the connection state.

Parameters:
l - The ItemInfoListener to remove.

addMiscellaneousListener

public void addMiscellaneousListener(MiscellaneousListener l)
Registers the specified listener for receiving event messages. Listeners can be registered regardless of the connection state.

Parameters:
l - The MiscellaneousListener to register.

removeMiscellaneousListener

public void removeMiscellaneousListener(MiscellaneousListener l)
Removes the specified listener. Listeners can be removed regardless of the connection state.

Parameters:
l - The MiscellaneousListener to remove.

addStreamCountListener

public void addStreamCountListener(StreamCountListener l)
Registers the specified listener for receiving event messages. Listeners can be registered regardless of the connection state.

Parameters:
l - The StreamCountListener to register.

removeStreamCountListener

public void removeStreamCountListener(StreamCountListener l)
Removes the specified listener. Listeners can be removed regardless of the connection state.

Parameters:
l - The StreamCountListener to remove.

addVoiceCountListener

public void addVoiceCountListener(VoiceCountListener l)
Registers the specified listener for receiving event messages. Listeners can be registered regardless of the connection state.

Parameters:
l - The VoiceCountListener to register.

removeVoiceCountListener

public void removeVoiceCountListener(VoiceCountListener l)
Removes the specified listener. Listeners can be removed regardless of the connection state.

Parameters:
l - The VoiceCountListener to remove.

addTotalStreamCountListener

public void addTotalStreamCountListener(TotalStreamCountListener l)
Registers the specified listener for receiving event messages. Listeners can be registered regardless of the connection state.

Parameters:
l - The TotalStreamCountListener to register.

removeTotalStreamCountListener

public void removeTotalStreamCountListener(TotalStreamCountListener l)
Removes the specified listener. Listeners can be removed regardless of the connection state.

Parameters:
l - The TotalStreamCountListener to remove.

addTotalVoiceCountListener

public void addTotalVoiceCountListener(TotalVoiceCountListener l)
Registers the specified listener for receiving event messages. Listeners can be registered regardless of the connection state.

Parameters:
l - The TotalVoiceCountListener to register.

removeTotalVoiceCountListener

public void removeTotalVoiceCountListener(TotalVoiceCountListener l)
Removes the specified listener. Listeners can be removed regardless of the connection state.

Parameters:
l - The TotalVoiceCountListener to remove.

addMidiInstrumentMapCountListener

public void addMidiInstrumentMapCountListener(ItemCountListener l)
Registers the specified listener for receiving event messages. Listeners can be registered regardless of the connection state.

Parameters:
l - The ItemCountListener to register.

removeMidiInstrumentMapCountListener

public void removeMidiInstrumentMapCountListener(ItemCountListener l)
Removes the specified listener. Listeners can be removed regardless of the connection state.

Parameters:
l - The ItemCountListener to remove.

addMidiInstrumentMapInfoListener

public void addMidiInstrumentMapInfoListener(ItemInfoListener l)
Registers the specified listener for receiving event messages. Listeners can be registered regardless of the connection state.

Parameters:
l - The ItemInfoListener to register.

removeMidiInstrumentMapInfoListener

public void removeMidiInstrumentMapInfoListener(ItemInfoListener l)
Removes the specified listener. Listeners can be removed regardless of the connection state.

Parameters:
l - The ItemInfoListener to remove.

addMidiInstrumentCountListener

public void addMidiInstrumentCountListener(MidiInstrumentCountListener l)
Registers the specified listener for receiving event messages. Listeners can be registered regardless of the connection state.

Parameters:
l - The MidiInstrumentCountListener to register.

removeMidiInstrumentCountListener

public void removeMidiInstrumentCountListener(MidiInstrumentCountListener l)
Removes the specified listener. Listeners can be removed regardless of the connection state.

Parameters:
l - The MidiInstrumentCountListener to remove.

addMidiInstrumentInfoListener

public void addMidiInstrumentInfoListener(MidiInstrumentInfoListener l)
Registers the specified listener for receiving event messages. Listeners can be registered regardless of the connection state.

Parameters:
l - The MidiInstrumentInfoListener to register.

removeMidiInstrumentInfoListener

public void removeMidiInstrumentInfoListener(MidiInstrumentInfoListener l)
Removes the specified listener. Listeners can be removed regardless of the connection state.

Parameters:
l - The MidiInstrumentInfoListener to remove.

addDeviceMidiDataListener

public void addDeviceMidiDataListener(DeviceMidiDataListener l)
Registers the specified listener for receiving event messages. Listeners can be registered regardless of the connection state.

Parameters:
l - The DeviceMidiDataListener to register.

removeDeviceMidiDataListener

public void removeDeviceMidiDataListener(DeviceMidiDataListener l)
Removes the specified listener. Listeners can be removed regardless of the connection state.

Parameters:
l - The DeviceMidiDataListener to remove.

addChannelMidiDataListener

public void addChannelMidiDataListener(ChannelMidiDataListener l)
Registers the specified listener for receiving event messages. Listeners can be registered regardless of the connection state.

Parameters:
l - The ChannelMidiDataListener to register.

removeChannelMidiDataListener

public void removeChannelMidiDataListener(ChannelMidiDataListener l)
Removes the specified listener. Listeners can be removed regardless of the connection state.

Parameters:
l - The ChannelMidiDataListener to remove.

addInstrumentsDbListener

public void addInstrumentsDbListener(InstrumentsDbListener l)
Registers the specified listener for receiving event messages. Listeners can be registered regardless of the connection state.

Parameters:
l - The InstrumentsDbListener to register.

removeInstrumentsDbListener

public void removeInstrumentsDbListener(InstrumentsDbListener l)
Removes the specified listener. Listeners can be removed regardless of the connection state.

Parameters:
l - The InstrumentsDbListener to remove.

addGlobalInfoListener

public void addGlobalInfoListener(GlobalInfoListener l)
Registers the specified listener for receiving event messages. Listeners can be registered regardless of the connection state.

Parameters:
l - The GlobalInfoListener to register.

removeGlobalInfoListener

public void removeGlobalInfoListener(GlobalInfoListener l)
Removes the specified listener. Listeners can be removed regardless of the connection state.

Parameters:
l - The GlobalInfoListener to remove.

getAudioOutputDriverCount

public int getAudioOutputDriverCount()
                              throws java.io.IOException,
                                     LscpException,
                                     LSException
Gets the number of all audio output drivers currently available for the LinuxSampler instance.

Returns:
The number of all audio output drivers currently available for the LinuxSampler instance.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getAudioOutputDrivers

public AudioOutputDriver[] getAudioOutputDrivers()
                                          throws java.io.IOException,
                                                 LscpException,
                                                 LSException
Gets all audio output drivers currently available for the LinuxSampler instance.

Returns:
AudioOutputDriver array containing all audio output drivers currently available for the LinuxSampler instance.
Throws:
java.io.IOException - If an I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getAudioOutputDriverInfo

public AudioOutputDriver getAudioOutputDriverInfo(java.lang.String driverName,
                                                  Parameter... depList)
                                           throws java.io.IOException,
                                                  LscpException,
                                                  LSException
Gets detailed information about a specific audio output driver.

Parameters:
driverName - The name of the audio output driver.
depList - An optional list of dependences parameters.
Returns:
An AudioOutputDriver object containing information about the specified audio output driver.
Throws:
java.io.IOException - If an I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If there is no driver with name driverName.
See Also:
getAudioOutputDriverNames()

getAudioOutputDriverParameterInfo

public Parameter getAudioOutputDriverParameterInfo(java.lang.String driver,
                                                   java.lang.String param,
                                                   Parameter... deplist)
                                            throws java.io.IOException,
                                                   LscpException,
                                                   LSException
Gets detailed information about a specific audio output driver parameter.

Parameters:
driver - The name of the audio output driver.
param - A specific parameter name for which information should be obtained.
deplist - An optional list of parameters on which the sought parameter param depends on. Parameter instances can be easily created using ParameterFactory factory.
Returns:
Parameter object containing information about the specified audio output driver parameter.
Throws:
java.io.IOException - If an I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If driver is not a valid driver name or param is not a valid parameter for the specified driver.
See Also:
getAudioOutputDrivers(), getAudioOutputDriverInfo(java.lang.String, org.linuxsampler.lscp.Parameter...), ParameterFactory

createAudioOutputDevice

public int createAudioOutputDevice(java.lang.String aoDriver,
                                   Parameter... paramList)
                            throws java.io.IOException,
                                   LSException,
                                   LscpException
Creates a new audio output device for the desired audio output system.

Parameters:
aoDriver - The desired audio output system.
paramList - An optional list of driver specific parameters. Parameter instances can be easily created using ParameterFactory factory.
Returns:
The numerical ID of the newly created device.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the creation of the new audio output device failed.
LscpException - If LSCP protocol corruption occurs.
See Also:
getAudioOutputDrivers(), getAudioOutputDriverInfo(java.lang.String, org.linuxsampler.lscp.Parameter...), ParameterFactory

destroyAudioOutputDevice

public void destroyAudioOutputDevice(int deviceId)
                              throws java.io.IOException,
                                     LSException,
                                     LscpException
Destroys already created audio output device.

Parameters:
deviceId - The ID of the audio output device to be destroyed.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the destroying of the audio output device failed.
LscpException - If LSCP protocol corruption occurs.
See Also:
getAudioOutputDevices()

enableAudioOutputDevice

public void enableAudioOutputDevice(int deviceId,
                                    boolean enable)
                             throws java.io.IOException,
                                    LSException,
                                    LscpException
Enables/disables the specified audio output device.

Parameters:
deviceId - The ID of the audio output device to be enabled/disabled.
enable - If true the audio output device is enabled, else the device is disabled.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If there is no audio output device with numerical ID deviceId.
LscpException - If LSCP protocol corruption occurs.

getAudioOutputDeviceCount

public int getAudioOutputDeviceCount()
                              throws java.io.IOException,
                                     LscpException,
                                     LSException
Gets the current number of all created audio output devices.

Returns:
The current number of all created audio output devices.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getAudioOutputDevices

public AudioOutputDevice[] getAudioOutputDevices()
                                          throws java.io.IOException,
                                                 LscpException,
                                                 LSException
Gets a list of all created audio output devices.

Returns:
An AudioOutputDevice array providing all created audio output devices.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getAudioOutputDeviceIDs

public java.lang.Integer[] getAudioOutputDeviceIDs()
                                            throws java.io.IOException,
                                                   LscpException,
                                                   LSException
Gets a list of numerical IDs of all created audio output devices.

Returns:
An Integer array providing the numerical IDs of all created audio output devices.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getAudioOutputDeviceInfo

public AudioOutputDevice getAudioOutputDeviceInfo(int deviceId)
                                           throws java.io.IOException,
                                                  LscpException,
                                                  LSException
Gets the current settings of a specific, already created audio output device.

Parameters:
deviceId - Specifies the numerical ID of the audio output device.
Returns:
An AudioOutputDevice instance containing information about the specified device.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If there is no audio output device with device id deviceId.
See Also:
getAudioOutputDevices()

setAudioOutputDeviceParameter

public void setAudioOutputDeviceParameter(int deviceId,
                                          Parameter prm)
                                   throws java.io.IOException,
                                          LscpException,
                                          LSException
Alters a specific setting of a created audio output device.

Parameters:
deviceId - The numerical ID of the audio output device.
prm - A Parameter instance containing the name of the parameter and the new value for this parameter.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If
  • There is no audio output device with numerical ID deviceId;
  • There is no device parameter with the specified name;
  • The device parameter is readonly;
  • The device parameter is from different type.
See Also:
getAudioOutputDevices(), getAudioOutputDeviceInfo(int)

setAudioOutputChannelCount

public void setAudioOutputChannelCount(int deviceId,
                                       int channels)
                                throws java.io.IOException,
                                       LscpException,
                                       LSException
Changes the channel number of the speicifed audio output device.

Parameters:
deviceId - The numerical ID of the audio output device.
channels - The new number of audio output channels.
Throws:
java.io.IOException - If an I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If there is no device with ID deviceId or if channels number is out of range.
See Also:
getAudioOutputChannelInfo(int, int)

getAudioOutputChannelInfo

public AudioOutputChannel getAudioOutputChannelInfo(int deviceId,
                                                    int audioChn)
                                             throws java.io.IOException,
                                                    LscpException,
                                                    LSException
Gets information about an audio channel.

Parameters:
deviceId - The numerical ID of the audio output device.
audioChn - The audio channel number.
Returns:
An AudioOutputChannel instance containing the information about the specified audio output channel.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If
  • There is no audio output device with numerical ID deviceId;
  • audioChn is not a valid channel number;
See Also:
getAudioOutputDevices(), getAudioOutputDeviceInfo(int)

getAudioOutputChannelParameterInfo

public Parameter getAudioOutputChannelParameterInfo(int devId,
                                                    int chan,
                                                    java.lang.String param)
                                             throws java.io.IOException,
                                                    LscpException,
                                                    LSException
Gets detailed information about a specific audio output channel parameter.

Parameters:
devId - The numerical ID of the audio output device.
chan - The audio channel number.
param - a specific channel parameter name for which information should be obtained.
Returns:
An Parameter instance containing information about the specified audio output channel parameter.
Throws:
java.io.IOException - If an I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If
  • devId is not a valid device ID;
  • chan is not a valid channel number;
  • There is no channel parameter with the specified name.
See Also:
getAudioOutputDevices(), getAudioOutputChannelInfo(int, int)

setAudioOutputChannelParameter

public void setAudioOutputChannelParameter(int devId,
                                           int chn,
                                           Parameter prm)
                                    throws java.io.IOException,
                                           LscpException,
                                           LSException
Alters a specific setting of an audio output channel.

Parameters:
devId - The numerical ID of the audio device.
chn - The audio channel number.
prm - A Parameter instance containing the name of the parameter and the new value for this parameter.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If
  • There is no audio output device with numerical ID devId;
  • chn is not a valid channel number;
  • There is no channel parameter with the specified name;
  • The channel parameter is readonly;
  • The channel parameter is from different type.
See Also:
getAudioOutputDevices(), getAudioOutputChannelInfo(int, int)

getMidiInputDriverCount

public int getMidiInputDriverCount()
                            throws java.io.IOException,
                                   LscpException,
                                   LSException
Gets the current number of all MIDI input drivers.

Returns:
The current number of all MIDI input drivers.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getMidiInputDrivers

public MidiInputDriver[] getMidiInputDrivers()
                                      throws java.io.IOException,
                                             LscpException,
                                             LSException
Gets all MIDI input drivers currently available for the LinuxSampler instance.

Returns:
MidiInputDriver array containing all MIDI input drivers currently available for the LinuxSampler instance.
Throws:
java.io.IOException - If an I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getMidiInputDriverInfo

public MidiInputDriver getMidiInputDriverInfo(java.lang.String driverName,
                                              Parameter... depList)
                                       throws java.io.IOException,
                                              LscpException,
                                              LSException
Gets detailed information about a specific MIDI input driver.

Parameters:
driverName - The name of the MIDI input driver.
depList - An optional list of dependences parameters.
Returns:
A MidiInputDriver object containing information about the specified MIDI input driver.
Throws:
java.io.IOException - If an I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If there is no driver with name driverName.
See Also:
getMidiInputDriverNames()

getMidiInputDriverParameterInfo

public Parameter getMidiInputDriverParameterInfo(java.lang.String driver,
                                                 java.lang.String param,
                                                 Parameter... deplist)
                                          throws java.io.IOException,
                                                 LscpException,
                                                 LSException
Gets detailed information about a specific MIDI input driver parameter.

Parameters:
driver - The name of the MIDI input driver.
param - a specific parameter name for which information should be obtained.
deplist - An optional list of parameters on which the sought parameter param depends on. Parameter instances can be easily created using ParameterFactory factory.
Returns:
A Parameter object containing information about the specified MIDI input driver parameter.
Throws:
java.io.IOException - If an I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If driver is not a valid driver name or param is not a valid parameter for the specified driver.
See Also:
getMidiInputDrivers(), getMidiInputDriverInfo(java.lang.String, org.linuxsampler.lscp.Parameter...), ParameterFactory

createMidiInputDevice

public int createMidiInputDevice(java.lang.String miDriver,
                                 Parameter... paramList)
                          throws java.io.IOException,
                                 LSException,
                                 LscpException
Creates a new MIDI input device.

Parameters:
miDriver - The desired MIDI input system.
paramList - An optional list of driver specific parameters. Parameter instances can be easily created using ParameterFactory factory.
Returns:
The numerical ID of the newly created device.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the creation of the new MIDI input device failed.
LscpException - If LSCP protocol corruption occurs.
See Also:
getMidiInputDrivers(), getMidiInputDriverInfo(java.lang.String, org.linuxsampler.lscp.Parameter...), ParameterFactory

destroyMidiInputDevice

public void destroyMidiInputDevice(int deviceId)
                            throws java.io.IOException,
                                   LSException,
                                   LscpException
Destroys already created MIDI input device.

Parameters:
deviceId - The numerical ID of the MIDI input device to be destroyed.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the destroying of the MIDI input device failed.
LscpException - If LSCP protocol corruption occurs.
See Also:
createMidiInputDevice(java.lang.String, org.linuxsampler.lscp.Parameter...), getMidiInputDevices()

enableMidiInputDevice

public void enableMidiInputDevice(int deviceId,
                                  boolean enable)
                           throws java.io.IOException,
                                  LSException,
                                  LscpException
Enables/disables the specified MIDI input device.

Parameters:
deviceId - The ID of the MIDI input device to be enabled/disabled.
enable - If true the MIDI input device is enabled, else the device is disabled.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If there is no MIDI input device with numerical ID deviceId.
LscpException - If LSCP protocol corruption occurs.

getMidiInputDeviceCount

public int getMidiInputDeviceCount()
                            throws java.io.IOException,
                                   LscpException,
                                   LSException
Gets the current number of all created MIDI input devices.

Returns:
The current number of all created MIDI input devices.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getMidiInputDevices

public MidiInputDevice[] getMidiInputDevices()
                                      throws java.io.IOException,
                                             LscpException,
                                             LSException
Gets a list of all created MIDI input devices.

Returns:
A MidiInputDevice array providing all created MIDI input devices.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.
See Also:
createMidiInputDevice(java.lang.String, org.linuxsampler.lscp.Parameter...), destroyMidiInputDevice(int)

getMidiInputDeviceIDs

public java.lang.Integer[] getMidiInputDeviceIDs()
                                          throws java.io.IOException,
                                                 LscpException,
                                                 LSException
Gets a list of numerical IDs of all created MIDI input devices.

Returns:
An Integer array providing the numerical IDs of all created MIDI input devices.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.
See Also:
createMidiInputDevice(java.lang.String, org.linuxsampler.lscp.Parameter...), destroyMidiInputDevice(int)

getMidiInputDeviceInfo

public MidiInputDevice getMidiInputDeviceInfo(int deviceId)
                                       throws java.io.IOException,
                                              LscpException,
                                              LSException
Gets the current settings of a specific, already created MIDI input device.

Parameters:
deviceId - Specifies the numerical ID of the MIDI input device.
Returns:
A MidiInputDevice instance containing information about the specified device.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If there is no MIDI input device with device id deviceId.
See Also:
getMidiInputDevices()

setMidiInputDeviceParameter

public void setMidiInputDeviceParameter(int deviceId,
                                        Parameter prm)
                                 throws java.io.IOException,
                                        LscpException,
                                        LSException
Alters a specific setting of a created MIDI input device.

Parameters:
deviceId - The numerical ID of the MIDI input device.
prm - A Parameter instance containing the name of the parameter and the new value for this parameter.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If
  • There is no MIDI input device with numerical ID deviceId;
  • There is no device parameter with the specified name;
  • The device parameter is readonly;
  • The device parameter is from different type.
See Also:
getMidiInputDevices(), getMidiInputDeviceInfo(int)

setMidiInputPortCount

public void setMidiInputPortCount(int deviceId,
                                  int ports)
                           throws java.io.IOException,
                                  LscpException,
                                  LSException
Changes the port number of the speicified MIDI input device.

Parameters:
deviceId - The numerical ID of the MIDI input device.
ports - The new number of MIDI input ports.
Throws:
java.io.IOException - If an I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If there is no device with ID deviceId or if ports number is out of range.
See Also:
getMidiInputPortInfo(int, int)

getMidiInputPortInfo

public MidiPort getMidiInputPortInfo(int deviceId,
                                     int midiPort)
                              throws java.io.IOException,
                                     LscpException,
                                     LSException
Gets detailed information about a specific MIDI input port.

Parameters:
deviceId - The numerical ID of the MIDI input device.
midiPort - The MIDI input port number.
Returns:
A MidiPort instance containing information about the specified MIDI input port.
Throws:
java.io.IOException - If an I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If there is no device with ID deviceId or if midiPort is not a valid MIDI port number.
See Also:
getMidiInputDevices()

getMidiInputPortParameterInfo

public Parameter getMidiInputPortParameterInfo(int deviceId,
                                               int port,
                                               java.lang.String param)
                                        throws java.io.IOException,
                                               LscpException,
                                               LSException
Gets detailed information about a specific MIDI input port parameter.

Parameters:
deviceId - The numerical ID of the MIDI input device.
port - The MIDI port number.
param - A specific parameter name for which information should be obtained.
Returns:
A Parameter instance containing information about the specified MIDI input port parameter.
Throws:
java.io.IOException - If an I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If
  • There is no MIDI input device with numerical ID deviceId;
  • port is not a valid MIDI port number;
  • param is not a valid parameter for the specified MIDI port.
See Also:
getMidiInputDevices(), getMidiInputPortInfo(int, int)

setMidiInputPortParameter

public void setMidiInputPortParameter(int deviceId,
                                      int port,
                                      Parameter prm)
                               throws java.io.IOException,
                                      LscpException,
                                      LSException
Alters a specific setting of a MIDI input port.

Parameters:
deviceId - The numerical ID of the MIDI device.
port - The MIDI port number.
prm - A Parameter instance containing the name of the parameter and the new value for this parameter.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If
  • There is no MIDI device with numerical ID deviceId;
  • port is not a valid MIDI port number;
  • prm is not a valid parameter;
  • The parameter is readonly;
  • The parameter is from different type.
See Also:
getMidiInputDevices(), getMidiInputPortInfo(int, int)

addMidiInstrumentMap

public int addMidiInstrumentMap(java.lang.String name)
                         throws java.io.IOException,
                                LSException,
                                LscpException
Adds a new MIDI instrument map.

Parameters:
name - The name of this MIDI instrument map.
Returns:
The number of the newly MIDI instrument map.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the creation of the new MIDI instrument map failed.
LscpException - If LSCP protocol corruption occurs.
See Also:
removeMidiInstrumentMap(int)

removeMidiInstrumentMap

public void removeMidiInstrumentMap(int mapId)
                             throws java.io.IOException,
                                    LscpException,
                                    LSException
Removes the specified MIDI instrument map.

Parameters:
mapId - The numerical ID of the MIDI instrument map to be removed.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the removing of the MIDI instrument map failed.
See Also:
addMidiInstrumentMap(java.lang.String), getMidiInstrumentMapIDs()

removeAllMidiInstrumentMaps

public void removeAllMidiInstrumentMaps()
                                 throws java.io.IOException,
                                        LscpException,
                                        LSException
Removes the all MIDI instrument maps.

Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the removing of the MIDI instrument maps failed.

getMidiInstrumentMapCount

public int getMidiInstrumentMapCount()
                              throws java.io.IOException,
                                     LscpException,
                                     LSException
Gets the current number of all MIDI instrument maps.

Returns:
The current number of all MIDI instrument maps.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getMidiInstrumentMapIDs

public java.lang.Integer[] getMidiInstrumentMapIDs()
                                            throws java.io.IOException,
                                                   LscpException,
                                                   LSException
Gets a list of numerical IDs of all created MIDI instrument maps.

Returns:
An Integer array providing the numerical IDs of all created MIDI instrument maps.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.
See Also:
addMidiInstrumentMap(java.lang.String), removeMidiInstrumentMap(int)

getMidiInstrumentMapInfo

public MidiInstrumentMapInfo getMidiInstrumentMapInfo(int mapId)
                                               throws java.io.IOException,
                                                      LscpException,
                                                      LSException
Gets the current settings of a specific, already created MIDI instrument map.

Parameters:
mapId - Specifies the numerical ID of the MIDI instrument map.
Returns:
A MidiInstrumentMapInfo instance containing information about the specified device.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If there is no MIDI instrument map with map id mapId.
See Also:
getMidiInstrumentMaps()

getMidiInstrumentMaps

public MidiInstrumentMapInfo[] getMidiInstrumentMaps()
                                              throws java.io.IOException,
                                                     LscpException,
                                                     LSException
Gets an information of all created MIDI instrument maps.

Returns:
A MidiInstrumentMap array providing information for all created MIDI instrument maps.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.
See Also:
addMidiInstrumentMap(java.lang.String), removeMidiInstrumentMap(int)

setMidiInstrumentMapName

public void setMidiInstrumentMapName(int mapId,
                                     java.lang.String name)
                              throws java.io.IOException,
                                     LscpException,
                                     LSException
Sets the name of the specified MIDI instrument map.

Parameters:
mapId - The numerical ID of the MIDI instrument map.
name - The new name for the specified MIDI instrument map.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If mapId is not a valid MIDI instrument map number or name is not a valid name;

mapMidiInstrument

public void mapMidiInstrument(int mapId,
                              MidiInstrumentEntry entry,
                              MidiInstrumentInfo info)
                       throws java.io.IOException,
                              LSException,
                              LscpException
Creates or replaces a MIDI instrument map entry.

Parameters:
mapId - The ID of the map, where this instrument should be mapped.
entry - Specifies the position of the MIDI instrument in the MIDI instrument map.
info - Provides the needed information of the MIDI instrument, which will be mapped to the specified MIDI instrument map.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the mapping failed.
LscpException - If LSCP protocol corruption occurs.
See Also:
unmapMidiInstrument(int, org.linuxsampler.lscp.MidiInstrumentEntry)

mapMidiInstrument

public void mapMidiInstrument(int mapId,
                              MidiInstrumentEntry entry,
                              MidiInstrumentInfo info,
                              boolean nonModal)
                       throws java.io.IOException,
                              LSException,
                              LscpException
Creates or replaces a MIDI instrument map entry.

Parameters:
mapId - The ID of the map, where this instrument should be mapped.
entry - Specifies the position of the MIDI instrument in the MIDI instrument map.
info - Provides the needed information of the MIDI instrument, which will be mapped to the specified MIDI instrument map.
nonModal - If true the function returns immediately and the mapping is established in the background.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the mapping failed.
LscpException - If LSCP protocol corruption occurs.
See Also:
unmapMidiInstrument(int, org.linuxsampler.lscp.MidiInstrumentEntry)

unmapMidiInstrument

public void unmapMidiInstrument(int mapId,
                                MidiInstrumentEntry entry)
                         throws java.io.IOException,
                                LSException,
                                LscpException
Removes an entry MIDI instrument map.

Parameters:
mapId - The ID of the map, from which the specified MIDI instrument should be removed.
entry - The entry to remove from the specified MIDI instrument map.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the unmapping failed.
LscpException - If LSCP protocol corruption occurs.
See Also:
mapMidiInstrument(int, org.linuxsampler.lscp.MidiInstrumentEntry, org.linuxsampler.lscp.MidiInstrumentInfo)

getMidiInstrumentCount

public int getMidiInstrumentCount()
                           throws java.io.IOException,
                                  LscpException,
                                  LSException
Gets the current number of all MIDI instrument in all maps.

Returns:
The current number of all MIDI instrument in all maps.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getMidiInstrumentCount

public int getMidiInstrumentCount(int mapId)
                           throws java.io.IOException,
                                  LscpException,
                                  LSException
Gets the current number of MIDI instrument in the specified map.

Parameters:
mapId - The ID of the map.
Returns:
The current number of MIDI instrument in the specified map.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getMidiInstruments

public MidiInstrumentInfo[] getMidiInstruments()
                                        throws java.io.IOException,
                                               LscpException,
                                               LSException
Gets all MIDI instrument from all maps.

Returns:
A MidiInstrumentInfo array providing all MIDI instruments from all MIDI instrument maps.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getMidiInstrumentEntries

public int[][] getMidiInstrumentEntries(int mapId)
                                 throws java.io.IOException,
                                        LscpException,
                                        LSException
Gets all MIDI instrument entries contained int the specified MIDI instrument map.

Parameters:
mapId - The ID of the map, which instruments should be obtained.
Returns:
An int array providing all MIDI instrument entries in the specified MIDI instrument map.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getMidiInstruments

public MidiInstrumentInfo[] getMidiInstruments(int mapId)
                                        throws java.io.IOException,
                                               LscpException,
                                               LSException
Gets all MIDI instruments contained int the specified MIDI instrument map.

Parameters:
mapId - The ID of the map, which instruments should be obtained.
Returns:
A MidiInstrumentInfo array providing all MIDI instruments in the specified MIDI instrument map.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getMidiInstrumentInfo

public MidiInstrumentInfo getMidiInstrumentInfo(int mapId,
                                                int bank,
                                                int program)
                                         throws java.io.IOException,
                                                LscpException,
                                                LSException
Gets the current settings of the specified MIDI instrument.

Parameters:
mapId - The ID of the map.
bank - The index of the MIDI bank.
program - The MIDI program number of the instrument.
Returns:
MidiInstrumentInfo instance containing the current settings of the specified MIDI instrument.
Throws:
java.io.IOException - If an I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the specified MIDI instrument is missing.

loadInstrument

public void loadInstrument(java.lang.String filename,
                           int instrIdx,
                           int samplerChn)
                    throws java.io.IOException,
                           LscpException,
                           LSException
Loads and assigns an instrument to a sampler channel. Notice that this function will return after the instrument is fully loaded and the channel is ready to be used.

Parameters:
filename - The name of the instrument file on the LinuxSampler instance's host system.
instrIdx - The index of the instrument in the instrument file.
samplerChn - The number of the sampler channel the instrument should be assigned to.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the loading of the instrument failed.
See Also:
loadInstrument(String, int, int, boolean), getSamplerChannels()

loadInstrument

public void loadInstrument(java.lang.String filename,
                           int instrIdx,
                           int samplerChn,
                           boolean nonModal)
                    throws java.io.IOException,
                           LscpException,
                           LSException
Loads and assigns an instrument to a sampler channel.

Parameters:
filename - The name of the instrument file on the LinuxSampler instance's host system.
instrIdx - The index of the instrument in the instrument file.
samplerChn - The number of the sampler channel the instrument should be assigned to.
nonModal - If false the function will return after the instrument has been fully loaded and the channel is ready to be used. If true the function returns immediately.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the loading of the instrument failed.
See Also:
loadInstrument(String, int, int), getSamplerChannels()

loadSamplerEngine

public void loadSamplerEngine(java.lang.String engineName,
                              int samplerChn)
                       throws java.io.IOException,
                              LscpException,
                              LSException
Loads a sampler engine to a specific sampler channel.

Parameters:
engineName - The name of the engine.
samplerChn - The number of the sampler channel the deployed engine should be assigned to.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the loading of the sampler engine failed.
See Also:
getEngines(), getSamplerChannels()

getSamplerChannelCount

public int getSamplerChannelCount()
                           throws java.io.IOException,
                                  LscpException,
                                  LSException
Gets the current number of all created sampler channels.

Returns:
The current number of all created sampler channels.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getSamplerChannels

public SamplerChannel[] getSamplerChannels()
                                    throws java.io.IOException,
                                           LscpException,
                                           LSException
Gets a list of all created sampler channels.

Returns:
A SamplerChannel array providing all created sampler channels.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.
See Also:
addSamplerChannel(), removeSamplerChannel(int)

getSamplerChannelIDs

public java.lang.Integer[] getSamplerChannelIDs()
                                         throws java.io.IOException,
                                                LscpException,
                                                LSException
Gets a list with numerical IDs of all created sampler channels.

Returns:
An Integer array providing the numerical IDs of all created sampler channels.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.
See Also:
addSamplerChannel(), removeSamplerChannel(int)

addSamplerChannel

public int addSamplerChannel()
                      throws java.io.IOException,
                             LSException,
                             LscpException
Adds a new sampler channel. This method will increment the sampler channel count by one and the new sampler channel will be appended to the end of the sampler channel list.

Returns:
The number of the newly created sampler channel.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the creation of the new sampler channel failed.
LscpException - If LSCP protocol corruption occurs.
See Also:
removeSamplerChannel(int)

removeSamplerChannel

public void removeSamplerChannel(int samplerChn)
                          throws java.io.IOException,
                                 LscpException,
                                 LSException
Removes the specified sampler channel.

Parameters:
samplerChn - The numerical ID of the sampler channel to be removed.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the removing of the sampler channel failed.
See Also:
addSamplerChannel(), getSamplerChannels()

getEngineCount

public int getEngineCount()
                   throws java.io.IOException,
                          LscpException,
                          LSException
Gets the number of all available engines.

Returns:
The number of all available engines.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getEngines

public SamplerEngine[] getEngines()
                           throws java.io.IOException,
                                  LscpException,
                                  LSException
Gets a list of all available engines.

Returns:
SamplerEngine array containing all available engines.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getSamplerChannelInfo

public SamplerChannel getSamplerChannelInfo(int samplerChn)
                                     throws java.io.IOException,
                                            LscpException,
                                            LSException
Gets the current settings of the specified sampler channel.

Parameters:
samplerChn - The sampler channel number.
Returns:
SamplerChannel instance containing the current settings of the specified sampler channel.
Throws:
java.io.IOException - If an I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If there is no sampler channel with samplerChn number.
See Also:
getSamplerChannels()

getChannelVoiceCount

public int getChannelVoiceCount(int samplerChn)
                         throws java.io.IOException,
                                LscpException,
                                LSException
Gets the current number of active voices on the specified sampler channel.

Parameters:
samplerChn - The sampler channel number.
Returns:
The current number of active voices on the specified sampler channel.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If there is no sampler channel with number samplerChn.
See Also:
getSamplerChannels()

getChannelStreamCount

public int getChannelStreamCount(int samplerChn)
                          throws java.io.IOException,
                                 LscpException,
                                 LSException
Gets the current number of active disk streams on the specified sampler channel.

Parameters:
samplerChn - The sampler channel number.
Returns:
The current number of active disk streams on the specified sampler channel or -1 if the engine doesn't support disk streaming.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If there is no sampler channel with number samplerChn.
See Also:
getSamplerChannels()

getChannelBufferFillBytes

public java.util.Vector<BufferFill> getChannelBufferFillBytes(int samplerChn)
                                                       throws java.io.IOException,
                                                              LscpException,
                                                              LSException
Gets the current fill state of all disk streams on the specified sampler channel in bytes.

Parameters:
samplerChn - The sampler channel number.
Returns:
The current fill state of all disk streams on the specified sampler channel or null if the engine which is deployed doesn't support disk streaming.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If there is no sampler channel with number samplerChn.
See Also:
getChannelBufferFillPercentage(int), getSamplerChannels()

getChannelBufferFillPercentage

public java.util.Vector<BufferFill> getChannelBufferFillPercentage(int samplerChn)
                                                            throws java.io.IOException,
                                                                   LscpException,
                                                                   LSException
Gets the current fill state of all disk streams on the specified sampler channel in percent.

Parameters:
samplerChn - The sampler channel number.
Returns:
The current fill state of all disk streams on the specified sampler channel or null if the engine which is deployed doesn't support disk streaming.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If there is no sampler channel with number samplerChn.
See Also:
getChannelBufferFillBytes(int), getSamplerChannels()

setChannelAudioOutputDevice

public void setChannelAudioOutputDevice(int samplerChn,
                                        int devId)
                                 throws java.io.IOException,
                                        LscpException,
                                        LSException
Sets the audio output device on the specified sampler channel.

Parameters:
samplerChn - The sampler channel number.
devId - The numerical ID of the audio output device.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If
  • samplerChn is not a valid channel number;
  • devId is not a valid audio output device ID;
See Also:
getSamplerChannels(), getAudioOutputDevices()

setChannelAudioOutputChannel

public void setChannelAudioOutputChannel(int samplerChn,
                                         int audioOut,
                                         int audioIn)
                                  throws java.io.IOException,
                                         LscpException,
                                         LSException
Sets the audio output channel on the specified sampler channel.

Parameters:
samplerChn - The sampler channel number.
audioOut - The sampler channel's audio output channel which should be rerouted.
audioIn - The audio channel of the selected audio output device where audioOut should be routed to.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If
  • samplerChn is not a valid channel number;
  • There is no engine assigned yet to the specified sampler channel.
  • There is no audio output device connected to the specified sampler channel.
See Also:
getSamplerChannels()

setChannelMidiInputDevice

public void setChannelMidiInputDevice(int samplerChn,
                                      int devId)
                               throws java.io.IOException,
                                      LscpException,
                                      LSException
Sets the MIDI input device on the specified sampler channel.

Parameters:
samplerChn - The sampler channel number.
devId - The numerical ID of the MIDI input device.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If
  • samplerChn is not a valid channel number;
  • devId is not a valid MIDI input device ID;
See Also:
getSamplerChannels(), getMidiInputDevices()

setChannelMidiInputPort

public void setChannelMidiInputPort(int samplerChn,
                                    int port)
                             throws java.io.IOException,
                                    LscpException,
                                    LSException
Sets the MIDI input port on the specified sampler channel.

Parameters:
samplerChn - The sampler channel number.
port - The MIDI input port number of the MIDI input device connected to the specified sampler channel.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If samplerChn is not a valid channel number.
See Also:
getSamplerChannels()

setChannelMidiInputChannel

public void setChannelMidiInputChannel(int samplerChn,
                                       int midiChn)
                                throws java.io.IOException,
                                       LscpException,
                                       LSException
Sets the MIDI input channel the specified sampler channel should listen to.

Parameters:
samplerChn - The sampler channel number.
midiChn - The number of the new MIDI input channel where samplerChn should listen to or -1 to listen on all 16 MIDI channels.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If samplerChn is not a valid channel number.
See Also:
getSamplerChannels()

setChannelMidiInstrumentMap

public void setChannelMidiInstrumentMap(int samplerChn,
                                        int mapId)
                                 throws java.io.IOException,
                                        LscpException,
                                        LSException
Sets the MIDI instrument map to be used on the specified sampler channel.

Parameters:
samplerChn - The sampler channel number.
mapId - Specifies the numerical ID of the MIDI instrument map to assign. To remove the current map binding use -1. To set the current map to be the default map use -2.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If
  • samplerChn is not a valid channel number;
  • mapId is not a valid MIDI instrument map ID;
See Also:
getSamplerChannels(), getMidiInstrumentMaps()

setChannelVolume

public void setChannelVolume(int samplerChn,
                             float volume)
                      throws java.io.IOException,
                             LscpException,
                             LSException
Sets the volume of the specified sampler channel.

Parameters:
samplerChn - The sampler channel number.
volume - The new volume value.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If samplerChn is not a valid channel number or if there is no engine assigned yet to the specified sampler channel.
See Also:
getSamplerChannels()

setChannelMute

public void setChannelMute(int samplerChn,
                           boolean mute)
                    throws java.io.IOException,
                           LscpException,
                           LSException
Mute/unmute the specified sampler channel.

Parameters:
samplerChn - The sampler channel number.
mute - If true the specified channel is muted, else the channel is unmuted.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If samplerChn is not a valid channel number or if there is no engine assigned yet to the specified sampler channel.
See Also:
getSamplerChannels()

setChannelSolo

public void setChannelSolo(int samplerChn,
                           boolean solo)
                    throws java.io.IOException,
                           LscpException,
                           LSException
Solo/unsolo the specified sampler channel.

Parameters:
samplerChn - The sampler channel number.
solo - true to solo the specified channel, false otherwise.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If samplerChn is not a valid channel number or if there is no engine assigned yet to the specified sampler channel.
See Also:
getSamplerChannels()

createFxSend

public int createFxSend(int channel,
                        int midiCtrl)
                 throws java.io.IOException,
                        LSException,
                        LscpException
Creates an additional effect send on the specified sampler channel.

Parameters:
channel - The sampler channel, on which a new effect send should be added.
midiCtrl - Defines the MIDI controller, which will be able alter the effect send level.
Returns:
The unique ID of the newly created effect send entity.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the creation of the effect send failed.
LscpException - If LSCP protocol corruption occurs.
See Also:
destroyFxSend(int, int)

createFxSend

public int createFxSend(int channel,
                        int midiCtrl,
                        java.lang.String name)
                 throws java.io.IOException,
                        LSException,
                        LscpException
Creates an additional effect send on the specified sampler channel.

Parameters:
channel - The sampler channel, on which the effect send should be created on.
midiCtrl - Defines the MIDI controller, which can alter the effect send level.
name - The name of the effect send entity. The name does not have to be unique.
Returns:
The unique ID of the newly created effect send entity.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the creation of the effect send failed.
LscpException - If LSCP protocol corruption occurs.
See Also:
destroyFxSend(int, int)

destroyFxSend

public void destroyFxSend(int channel,
                          int fxSend)
                   throws java.io.IOException,
                          LSException,
                          LscpException
Destroys the specified effect send on the specified sampler channel.

Parameters:
channel - The sampler channel, from which the specified effect send should be removed.
fxSend - The ID of the effect send that should be removed.
Throws:
LSException - If some other error occurs.
LscpException - If LSCP protocol corruption occurs.
java.io.IOException
See Also:
createFxSend(int, int)

getFxSoundCount

public int getFxSoundCount(int channel)
                    throws java.io.IOException,
                           LscpException,
                           LSException
Gets the current number of effect sends on the specified sampler channel.

Parameters:
channel - The ID of the sampler channel.
Returns:
The current number of effect sends on the specified sampler channels.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getFxSends

public FxSend[] getFxSends(int channel)
                    throws java.io.IOException,
                           LscpException,
                           LSException
Gets a list of all created effect sends on the specified sampler channel.

Parameters:
channel - The sampler channel number.
Returns:
A FxSend array providing all created effect sends on the specified sampler channel.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If channel is not a valid sampler channel ID.
See Also:
createFxSend(int, int), destroyFxSend(int, int)

getFxSendIDs

public java.lang.Integer[] getFxSendIDs(int channel)
                                 throws java.io.IOException,
                                        LscpException,
                                        LSException
Gets a list of effect sends on the specified sampler channel.

Parameters:
channel - The sampler channel number.
Returns:
An Integer array providing the numerical IDs of all effect sends on the specified sampler channel.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If channel is not a valid sampler channel ID.
See Also:
createFxSend(int, int), destroyFxSend(int, int)

getFxSendInfo

public FxSend getFxSendInfo(int channel,
                            int fxSend)
                     throws java.io.IOException,
                            LscpException,
                            LSException
Gets the current settings of the specified effect send entity.

Parameters:
channel - The sampler channel number.
fxSend - The numerical ID of the effect send entity.
Returns:
FxSend instance containing the current settings of the specified effect send entity.
Throws:
java.io.IOException - If an I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the sampler channel and/or the effect send number are invalid.

setFxSendName

public void setFxSendName(int channel,
                          int fxSend,
                          java.lang.String name)
                   throws java.io.IOException,
                          LscpException,
                          LSException
Sets the name of the specified effect send.

Parameters:
channel - The sampler channel number.
fxSend - The numerical ID of the effect send entity.
name - The new name for the specified effect send.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If channel is not a valid channel number or fxSend is not a valid effect send ID;

setFxSendAudioOutputChannel

public void setFxSendAudioOutputChannel(int channel,
                                        int fxSend,
                                        int audioSrc,
                                        int audioDst)
                                 throws java.io.IOException,
                                        LscpException,
                                        LSException
Sets the destination of an effect send's audio channel in the specified sampler channel.

Parameters:
channel - The sampler channel number.
fxSend - The numerical ID of the effect send entity to be rerouted.
audioSrc - The numerical ID of the effect send's audio output channel, which should be rerouted.
audioDst - The audio channel of the selected audio output device where audioSrc should be routed to.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If
  • channel is not a valid channel number;
  • fxSend is not a valid effect send ID;
  • There is no engine assigned yet to the specified sampler channel;
  • There is no audio output device connected to the specified sampler channel.

setFxSendMidiController

public void setFxSendMidiController(int channel,
                                    int fxSend,
                                    int midiCtrl)
                             throws java.io.IOException,
                                    LscpException,
                                    LSException
Sets the MIDI controller, which will be able to modify the send level of the specified effect send in the specified sampler channel.

Parameters:
channel - The sampler channel number.
fxSend - The numerical ID of the effect send entity.
midiCtrl - The MIDI controller which shall be able to modify the effect send's send level.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If
  • channel is not a valid channel number;
  • fxSend is not a valid effect send ID;
  • midiCtrl is not a valid controller;

setFxSendLevel

public void setFxSendLevel(int channel,
                           int fxSend,
                           float volume)
                    throws java.io.IOException,
                           LscpException,
                           LSException
Sets the current send level of the specified effect send entity in the specified sampler channel.

Parameters:
channel - The sampler channel number.
fxSend - The numerical ID of the effect send entity.
volume - The new volume value (a value smaller than 1.0 means attenuation, whereas a value greater than 1.0 means amplification).
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

editChannelInstrument

public void editChannelInstrument(int samplerChn)
                           throws java.io.IOException,
                                  LscpException,
                                  LSException
Starts an instrument editor for editing the loaded instrument on the specified sampler channel.

Parameters:
samplerChn - The sampler channel number.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If samplerChn is not a valid channel number or if there is no instrument loaded on the specified sampler channel.
See Also:
getSamplerChannels()

sendChannelMidiData

public void sendChannelMidiData(int samplerChn,
                                MidiDataEvent.Type type,
                                int arg1,
                                int arg2)
                         throws java.io.IOException,
                                LscpException,
                                LSException
Sends a MIDI event to this sampler channel.

Parameters:
samplerChn - The sampler channel number.
type - The type of MIDI message to send.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If samplerChn is not a valid channel number or if there is no instrument loaded on the specified sampler channel.
See Also:
getSamplerChannels()

resetChannel

public void resetChannel(int samplerChn)
                  throws java.io.IOException,
                         LscpException,
                         LSException
Resets the specified sampler channel.

Parameters:
samplerChn - The sampler channel number.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If samplerChn is not a valid channel number or if there is no engine assigned yet to the specified sampler channel.
See Also:
getSamplerChannels()

addDbDirectory

public void addDbDirectory(java.lang.String dir)
                    throws java.io.IOException,
                           LSException,
                           LscpException
Adds the specified directory to the instruments database.

Parameters:
dir - The absolute (escaped) path name of the directory to add.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the creation of the directory failed.
LscpException - If LSCP protocol corruption occurs.

removeDbDirectory

public void removeDbDirectory(java.lang.String dir)
                       throws java.io.IOException,
                              LscpException,
                              LSException
Removes the specified directory from the instruments database.

Parameters:
dir - The absolute (escaped) path name of the directory to remove.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the specified directory is not empty or if the removal of the directory failed.

removeDbDirectory

public void removeDbDirectory(java.lang.String dir,
                              boolean force)
                       throws java.io.IOException,
                              LscpException,
                              LSException
Removes the specified directory from the instruments database.

Parameters:
dir - The absolute path name of the directory to remove.
force - If true forces the removal of non-empty directory and all its content.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the removing of the directory failed.

removeDbDirectories

public void removeDbDirectories(java.lang.String[] dirs,
                                boolean force)
                         throws java.io.IOException,
                                LscpException,
                                LSException
Removes the specified directories from the instruments database.

Parameters:
dirs - The absolute (escaped) path names of the directories to remove.
force - If true forces the removal of non-empty directories.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the removing of the directores failed.

getDbDirectoryCount

public int getDbDirectoryCount(java.lang.String dir)
                        throws java.io.IOException,
                               LscpException,
                               LSException
Gets the number of directories in the specified directory.

Parameters:
dir - The absolute path name of the directory.
Returns:
The current number of directories in the specified directory.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getDbDirectoryCount

public int getDbDirectoryCount(java.lang.String dir,
                               boolean recursive)
                        throws java.io.IOException,
                               LscpException,
                               LSException
Gets the number of directories in the specified directory.

Parameters:
dir - The absolute path name of the directory.
recursive - If true, the number of all directories in the specified subtree will be returned.
Returns:
The current number of directories in the specified directory.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getDbDirectoryNames

public java.lang.String[] getDbDirectoryNames(java.lang.String dir)
                                       throws java.io.IOException,
                                              LscpException,
                                              LSException
Gets the list of directories in the specified directory.

Parameters:
dir - The absolute path name of the directory.
Returns:
A String array providing the names of all directories in the specified directory.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the specified path name is invalid.

getDbDirectoryInfo

public DbDirectoryInfo getDbDirectoryInfo(java.lang.String dir)
                                   throws java.io.IOException,
                                          LscpException,
                                          LSException
Gets information about the specified directory.

Parameters:
dir - The absolute path name of the directory.
Returns:
A DbDirectoryInfo instance providing information about the specified directory.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the specified directory is not found.

getDbDirectories

public DbDirectoryInfo[] getDbDirectories(java.lang.String dir)
                                   throws java.io.IOException,
                                          LscpException,
                                          LSException
Gets the list of directories in the specified directory.

Parameters:
dir - The absolute path name of the directory.
Returns:
A DbDirectoryInfo array providing information about all directories in the specified directory.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the specified path name is invalid.

renameDbDirectory

public void renameDbDirectory(java.lang.String dir,
                              java.lang.String name)
                       throws java.io.IOException,
                              LSException,
                              LscpException
Renames the specified directory.

Parameters:
dir - The absolute path name of the directory to rename.
name - The new name for the directory.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the renaming of the directory failed.
LscpException - If LSCP protocol corruption occurs.

moveDbDirectory

public void moveDbDirectory(java.lang.String dir,
                            java.lang.String dst)
                     throws java.io.IOException,
                            LSException,
                            LscpException
Moves the specified directory into the specified location.

Parameters:
dir - The absolute path name of the directory to move.
dst - The location where the directory will be moved to.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the operation failed.
LscpException - If LSCP protocol corruption occurs.

moveDbDirectories

public void moveDbDirectories(java.lang.String[] dirs,
                              java.lang.String dst)
                       throws java.io.IOException,
                              LSException,
                              LscpException
Moves the specified directories into the specified location.

Parameters:
dirs - The absolute path names of the directories to move.
dst - The location where the directories will be moved to.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the operation failed.
LscpException - If LSCP protocol corruption occurs.

copyDbDirectory

public void copyDbDirectory(java.lang.String dir,
                            java.lang.String dst)
                     throws java.io.IOException,
                            LSException,
                            LscpException
Copies the specified directory into the specified location.

Parameters:
dir - The absolute path name of the directory to copy.
dst - The location where the directory will be copied to.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the operation failed.
LscpException - If LSCP protocol corruption occurs.

copyDbDirectories

public void copyDbDirectories(java.lang.String[] dirs,
                              java.lang.String dst)
                       throws java.io.IOException,
                              LSException,
                              LscpException
Copies the specified directories into the specified location.

Parameters:
dirs - The absolute path names of the directories to copy.
dst - The location where the directories will be copied to.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the operation failed.
LscpException - If LSCP protocol corruption occurs.

setDbDirectoryDescription

public void setDbDirectoryDescription(java.lang.String dir,
                                      java.lang.String desc)
                               throws java.io.IOException,
                                      LSException,
                                      LscpException
Changes the description of the specified directory.

Parameters:
dir - The absolute path name of the directory.
desc - The new description for the directory.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If failed to change the description.
LscpException - If LSCP protocol corruption occurs.

addDbInstrument

public void addDbInstrument(java.lang.String dbDir,
                            java.lang.String filePath,
                            int instrIndex)
                     throws java.io.IOException,
                            LSException,
                            LscpException
Adds the specified instrument to the specified instruments database directory.

Parameters:
dbDir - The absolute path name of the database directory in which the specified instrument will be added.
filePath - The absolute path name of the instrument file.
instrIndex - The index of the instrument (in the given instrument file) to add.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the operation failed.
LscpException - If LSCP protocol corruption occurs.

addDbInstrument

public int addDbInstrument(java.lang.String dbDir,
                           java.lang.String filePath,
                           int instrIndex,
                           boolean background)
                    throws java.io.IOException,
                           LSException,
                           LscpException
Adds the specified instrument to the specified instruments database directory.

Parameters:
dbDir - The absolute path name of the database directory in which the specified instrument will be added.
filePath - The absolute path name of the instrument file.
instrIndex - The index of the instrument (in the given instrument file) to add.
background - If true, the scan will be done in background and this method may return before the job is finished.
Returns:
If background is true, the ID of the scan job.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the operation failed.
LscpException - If LSCP protocol corruption occurs.
See Also:
addInstrumentsDbListener(org.linuxsampler.lscp.event.InstrumentsDbListener)

addDbInstruments

public void addDbInstruments(java.lang.String dbDir,
                             java.lang.String filePath)
                      throws java.io.IOException,
                             LSException,
                             LscpException
Adds the instruments in the specified file to the specified instruments database directory.

Parameters:
dbDir - The absolute path name of the database directory in which the the supported instruments will be added.
filePath - The absolute path name of the file to scan for instruments.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the operation failed.
LscpException - If LSCP protocol corruption occurs.

addDbInstruments

public int addDbInstruments(java.lang.String dbDir,
                            java.lang.String filePath,
                            boolean background)
                     throws java.io.IOException,
                            LSException,
                            LscpException
Adds the instruments in the specified file to the specified instruments database directory.

Parameters:
dbDir - The absolute path name of the database directory in which the the supported instruments will be added.
filePath - The absolute path name of the file to scan for instruments.
background - If true, the scan will be done in background and this method may return before the job is finished.
Returns:
If background is true, the ID of the scan job.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the operation failed.
LscpException - If LSCP protocol corruption occurs.
See Also:
addInstrumentsDbListener(org.linuxsampler.lscp.event.InstrumentsDbListener)

addDbInstruments

public void addDbInstruments(Client.ScanMode mode,
                             java.lang.String dbDir,
                             java.lang.String fsDir)
                      throws java.io.IOException,
                             LSException,
                             LscpException
Adds the instruments in the specified file system directory to the specified instruments database directory.

Parameters:
mode - Determines the scanning mode. If RECURSIVE is specified, all supported instruments in the specified file system direcotry will be added to the specified instruments database directory, including the instruments in subdirectories of the supplied directory. If NON_RECURSIVE is specified, the instruments in the subdirectories will not be processed. If FLAT is specified, all supported instruments in the specified file system direcotry will be added, including the instruments in subdirectories of the supplied directory, but the respective subdirectory structure will not be recreated in the instruments database and all instruments will be added directly in the specified database directory.
dbDir - The absolute path name of the database directory in which the supported instruments will be added.
fsDir - The absolute path name of the file system directory.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the operation failed.
LscpException - If LSCP protocol corruption occurs.

addDbInstruments

public int addDbInstruments(Client.ScanMode mode,
                            java.lang.String dbDir,
                            java.lang.String fsDir,
                            boolean background)
                     throws java.io.IOException,
                            LSException,
                            LscpException
Adds the instruments in the specified file system directory to the specified instruments database directory.

Parameters:
mode - Determines the scanning mode. If RECURSIVE is specified, all supported instruments in the specified file system direcotry will be added to the specified instruments database directory, including the instruments in subdirectories of the supplied directory. If NON_RECURSIVE is specified, the instruments in the subdirectories will not be processed. If FLAT is specified, all supported instruments in the specified file system direcotry will be added, including the instruments in subdirectories of the supplied directory, but the respective subdirectory structure will not be recreated in the instruments database and all instruments will be added directly in the specified database directory.
dbDir - The absolute path name of the database directory in which the supported instruments will be added.
fsDir - The absolute path name of the file system directory.
background - If true, the scan will be done in background and this method may return before the job is finished.
Returns:
If background is true, the ID of the scan job.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the operation failed.
LscpException - If LSCP protocol corruption occurs.
See Also:
addInstrumentsDbListener(org.linuxsampler.lscp.event.InstrumentsDbListener)

addDbInstruments

public int addDbInstruments(Client.ScanMode mode,
                            java.lang.String dbDir,
                            java.lang.String fsDir,
                            boolean background,
                            boolean insDir)
                     throws java.io.IOException,
                            LSException,
                            LscpException
Adds the instruments in the specified file system directory to the specified instruments database directory.

Parameters:
mode - Determines the scanning mode. If RECURSIVE is specified, all supported instruments in the specified file system direcotry will be added to the specified instruments database directory, including the instruments in subdirectories of the supplied directory. If NON_RECURSIVE is specified, the instruments in the subdirectories will not be processed. If FLAT is specified, all supported instruments in the specified file system direcotry will be added, including the instruments in subdirectories of the supplied directory, but the respective subdirectory structure will not be recreated in the instruments database and all instruments will be added directly in the specified database directory.
dbDir - The absolute path name of the database directory in which the supported instruments will be added.
fsDir - The absolute path name of the file system directory.
background - If true, the scan will be done in background and this method may return before the job is finished.
insDir - If true a drieectory is created for each instrument file.
Returns:
If background is true, the ID of the scan job.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the operation failed.
LscpException - If LSCP protocol corruption occurs.
See Also:
addInstrumentsDbListener(org.linuxsampler.lscp.event.InstrumentsDbListener)

removeDbInstrument

public void removeDbInstrument(java.lang.String instr)
                        throws java.io.IOException,
                               LscpException,
                               LSException
Removes the specified instrument from the instruments database.

Parameters:
instr - The absolute path name of the instrument to remove.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the removing of the instrument failed.

removeDbInstruments

public void removeDbInstruments(java.lang.String[] instrs)
                         throws java.io.IOException,
                                LscpException,
                                LSException
Removes the specified instruments from the instruments database.

Parameters:
instrs - The absolute path names of the instruments to remove.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the removing of the instruments failed.

getDbInstrumentCount

public int getDbInstrumentCount(java.lang.String dir)
                         throws java.io.IOException,
                                LscpException,
                                LSException
Gets the number of instruments in the specified directory.

Parameters:
dir - The absolute path name of the directory.
Returns:
The current number of instruments in the specified directory.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getDbInstrumentCount

public int getDbInstrumentCount(java.lang.String dir,
                                boolean recursive)
                         throws java.io.IOException,
                                LscpException,
                                LSException
Gets the number of instruments in the specified directory.

Parameters:
dir - The absolute path name of the directory.
recursive - If true, the number of all instruments in the specified subtree will be returned.
Returns:
The current number of instruments in the specified directory.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getDbInstrumentNames

public java.lang.String[] getDbInstrumentNames(java.lang.String dir)
                                        throws java.io.IOException,
                                               LscpException,
                                               LSException
Gets the list of instruments in the specified directory.

Parameters:
dir - The absolute path name of the directory.
Returns:
A String array providing the names of all instruments in the specified directory.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the specified path name is invalid.

getDbInstrumentInfo

public DbInstrumentInfo getDbInstrumentInfo(java.lang.String instr)
                                     throws java.io.IOException,
                                            LscpException,
                                            LSException
Gets information about the specified instrument.

Parameters:
instr - The absolute path name of the instrument.
Returns:
A DbInstrumentInfo instance providing information about the specified instrument.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the specified instrument is not found.

getDbInstruments

public DbInstrumentInfo[] getDbInstruments(java.lang.String dir)
                                    throws java.io.IOException,
                                           LscpException,
                                           LSException
Gets the list of instruments in the specified directory.

Parameters:
dir - The absolute path name of the directory.
Returns:
A DbInstrumentInfo array providing information about all instruments in the specified directory.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the specified path name is invalid.

renameDbInstrument

public void renameDbInstrument(java.lang.String instr,
                               java.lang.String name)
                        throws java.io.IOException,
                               LSException,
                               LscpException
Renames the specified instrument.

Parameters:
instr - The absolute path name of the instrument to rename.
name - The new name for the instrument.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the renaming of the instrument failed.
LscpException - If LSCP protocol corruption occurs.

moveDbInstrument

public void moveDbInstrument(java.lang.String instr,
                             java.lang.String dst)
                      throws java.io.IOException,
                             LSException,
                             LscpException
Moves the specified instrument into the specified location.

Parameters:
instr - The absolute path name of the instrument to move.
dst - The directory where the specified instrument will be moved to.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the operation failed.
LscpException - If LSCP protocol corruption occurs.

moveDbInstruments

public void moveDbInstruments(java.lang.String[] instrs,
                              java.lang.String dst)
                       throws java.io.IOException,
                              LSException,
                              LscpException
Moves the specified instruments into the specified location.

Parameters:
instrs - The absolute path names of the instruments to move.
dst - The directory where the specified instruments will be moved to.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the operation failed.
LscpException - If LSCP protocol corruption occurs.

copyDbInstrument

public void copyDbInstrument(java.lang.String instr,
                             java.lang.String dst)
                      throws java.io.IOException,
                             LSException,
                             LscpException
Copies the specified instrument into the specified location.

Parameters:
instr - The absolute path name of the instrument to copy.
dst - The directory where the specified instrument will be copied to.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the operation failed.
LscpException - If LSCP protocol corruption occurs.

copyDbInstruments

public void copyDbInstruments(java.lang.String[] instrs,
                              java.lang.String dst)
                       throws java.io.IOException,
                              LSException,
                              LscpException
Copies the specified instruments into the specified location.

Parameters:
instrs - The absolute path name of the instruments to copy.
dst - The directory where the specified instruments will be copied to.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the operation failed.
LscpException - If LSCP protocol corruption occurs.

setDbInstrumentDescription

public void setDbInstrumentDescription(java.lang.String instr,
                                       java.lang.String desc)
                                throws java.io.IOException,
                                       LSException,
                                       LscpException
Changes the description of the specified instrument.

Parameters:
instr - The absolute path name of the instrument.
desc - The new description for the instrument.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If failed to change the description.
LscpException - If LSCP protocol corruption occurs.

setDbInstrumentFilePath

public void setDbInstrumentFilePath(java.lang.String oldPath,
                                    java.lang.String newPath)
                             throws java.io.IOException,
                                    LSException,
                                    LscpException
Substitutes all occurrences of the instrument file oldPath in the database, with newPath.

Parameters:
oldPath - The absolute path name of the instrument file to substitute.
newPath - The new absolute path name.
Throws:
java.io.IOException - If some I/O error occurs.
LSException - If the operation failed.
LscpException - If LSCP protocol corruption occurs.

findDbDirectories

public DbDirectoryInfo[] findDbDirectories(java.lang.String dir,
                                           DbSearchQuery query)
                                    throws java.io.IOException,
                                           LscpException,
                                           LSException
Finds all directories in the specified directory that corresponds to the specified search criterias.

Parameters:
dir - The absolute path name of the directory to search.
query - Provides the search criterias.
Returns:
A DbDirectoryInfo array providing information about all directories that are found in the specified directory.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the specified path name is invalid.

findDbDirectories

public DbDirectoryInfo[] findDbDirectories(java.lang.String dir,
                                           DbSearchQuery query,
                                           boolean nonRecursive)
                                    throws java.io.IOException,
                                           LscpException,
                                           LSException
Finds all directories in the specified directory that corresponds to the specified search criterias.

Parameters:
dir - The absolute path name of the directory to search.
query - Provides the search criterias.
nonRecursive - If true, the search will be non-recursive.
Returns:
A DbDirectoryInfo array providing information about all directories that are found in the specified directory.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the specified path name is invalid.

findDbInstruments

public DbInstrumentInfo[] findDbInstruments(java.lang.String dir,
                                            DbSearchQuery query)
                                     throws java.io.IOException,
                                            LscpException,
                                            LSException
Finds all instruments in the specified directory that corresponds to the specified search criterias.

Parameters:
dir - The absolute path name of the directory to search.
query - Provides the search criterias.
Returns:
A DbInstrumentInfo array providing information about all instruments that are found in the specified directory.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the specified path name is invalid.

findDbInstruments

public DbInstrumentInfo[] findDbInstruments(java.lang.String dir,
                                            DbSearchQuery query,
                                            boolean nonRecursive)
                                     throws java.io.IOException,
                                            LscpException,
                                            LSException
Finds all instruments in the specified directory that corresponds to the specified search criterias.

Parameters:
dir - The absolute path name of the directory to search.
query - Provides the search criterias.
nonRecursive - If true, the search will be non-recursive.
Returns:
A DbInstrumentInfo array providing information about all instruments that are found in the specified directory.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the specified path name is invalid.

findLostDbInstrumentFiles

public java.lang.String[] findLostDbInstrumentFiles()
                                             throws java.io.IOException,
                                                    LscpException,
                                                    LSException
Returns a list of all instrument files in the database that that don't exist in the filesystem.

Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If other error occurs.

getDbInstrumentsJobInfo

public ScanJobInfo getDbInstrumentsJobInfo(int jobId)
                                    throws java.io.IOException,
                                           LscpException,
                                           LSException
Gets status information about the specified job.

Parameters:
jobId - The ID of the job.
Returns:
A ScanJobInfo instance providing information about the specified job.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the specified job is not found.

formatInstrumentsDb

public void formatInstrumentsDb()
                         throws java.io.IOException,
                                LscpException,
                                LSException
Removes all instruments and directories and re-creates the instruments database structure.

Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the formatting of the instruments database failed.

resetSampler

public void resetSampler()
                  throws java.io.IOException,
                         LscpException
Resets the whole sampler.

Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.

getTotalStreamCount

public int getTotalStreamCount()
                        throws java.io.IOException,
                               LscpException,
                               LSException
Gets the current number of all active streams.

Returns:
The current number of all active streams.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getTotalVoiceCount

public int getTotalVoiceCount()
                       throws java.io.IOException,
                              LscpException,
                              LSException
Gets the current number of all active voices.

Returns:
The current number of all active voices.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getTotalVoiceCountMax

public int getTotalVoiceCountMax()
                          throws java.io.IOException,
                                 LscpException,
                                 LSException
Gets the maximum number of active voices.

Returns:
The maximum number of active voices.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getServerInfo

public ServerInfo getServerInfo()
                         throws java.io.IOException,
                                LscpException,
                                LSException
Gets information about the LinuxSampler instance.

Returns:
ServerInfo instance containing information about the LinuxSampler instance.
Throws:
java.io.IOException - If an I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

getVolume

public float getVolume()
                throws java.io.IOException,
                       LscpException,
                       LSException
Gets the global volume of the sampler.

Returns:
The global volume of the sampler.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

setVolume

public void setVolume(float volume)
               throws java.io.IOException,
                      LscpException,
                      LSException
Sets the global volume of the sampler.

Parameters:
volume - The new volume value.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.
See Also:
getVolume()

getGlobalVoiceLimit

public int getGlobalVoiceLimit()
                        throws java.io.IOException,
                               LscpException,
                               LSException
Gets the global sampler-wide limit of maximum voices.

Returns:
The global sampler-wide limit of maximum voices.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

setGlobalVoiceLimit

public void setGlobalVoiceLimit(int maxVoices)
                         throws java.io.IOException,
                                LscpException,
                                LSException
Sets the global sampler-wide limit of maximum voices.

Parameters:
maxVoices - The new global limit of maximum voices.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.
See Also:
getVolume()

getGlobalStreamLimit

public int getGlobalStreamLimit()
                         throws java.io.IOException,
                                LscpException,
                                LSException
Gets the global sampler-wide limit of maximum disk streams.

Returns:
The global sampler-wide limit of maximum disk streams.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.

setGlobalStreamLimit

public void setGlobalStreamLimit(int maxStreams)
                          throws java.io.IOException,
                                 LscpException,
                                 LSException
Sets the global sampler-wide limit for maximum disk streams.

Parameters:
maxVoices - The new global limit of maximum disk streams.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If some other error occurs.
See Also:
getVolume()

getFileInstrumentCount

public int getFileInstrumentCount(java.lang.String filename)
                           throws java.io.IOException,
                                  LscpException,
                                  LSException
Gets the number of instruments in the specified instrument file.

Parameters:
filename - The absolute path name of the instrument file.
Returns:
The number of instruments in the specified instrument file.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the file is not found, or other error occur.

getFileInstrumentInfo

public Instrument getFileInstrumentInfo(java.lang.String filename,
                                        int instrIdx)
                                 throws java.io.IOException,
                                        LscpException,
                                        LSException
Gets information about the instrument with index instrIdx in the specified instrument file.

Parameters:
filename - The absolute path name of the instrument file.
instrIdx - The index of the instrument in the specified instrument file.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If failed to retrieve information.

getFileInstruments

public Instrument[] getFileInstruments(java.lang.String filename)
                                throws java.io.IOException,
                                       LscpException,
                                       LSException
Gets the list of instruments in the specified instrument file.

Parameters:
filename - The absolute path name of the instrument file.
Returns:
An Instrument array providing information about all instruments in the specified instrument file.
Throws:
java.io.IOException - If some I/O error occurs.
LscpException - If LSCP protocol corruption occurs.
LSException - If the specified file name is invalid.

getLogger

protected static java.util.logging.Logger getLogger()
Returns the logger for this library.

Returns:
The logger for this library.

jlscp
v0.8

Copyright © 2009 Grigor Iliev. All rights reserved.