JSampler
v0.8a

org.jsampler
Interface SamplerModel

All Known Implementing Classes:
DefaultSamplerModel

public interface SamplerModel

A data model representing a sampler. Note that the setter methods does not alter any settings on the backend side unless otherwise specified.


Method Summary
 void addAudioDevice(AudioOutputDevice device)
          Adds the specified audio device.
 void addAudioDeviceListListener(ListListener<AudioDeviceModel> listener)
          Registers the specified listener for receiving event messages.
 void addBackendChannel()
          Adds a new sampler channel on the backend side.
 void addBackendMidiDevice(java.lang.String driver, Parameter... parameters)
          Schedules a new task for adding new MIDI device.
 void addBackendMidiInstrumentMap(java.lang.String name)
          Schedules a new task for creating a new MIDI instrument map on the backend side.
 void addChannel(SamplerChannel channel)
          Adds the specified sampler channel.
 void addMidiDevice(MidiInputDevice device)
          Adds the specified MIDI device.
 void addMidiDeviceListListener(MidiDeviceListListener listener)
          Registers the specified listener for receiving event messages.
 void addMidiInstrumentMap(MidiInstrumentMap map)
          Adds the specified MIDI instrument map.
 void addMidiInstrumentMapListListener(ListListener<MidiInstrumentMap> listener)
          Registers the specified listener for receiving event messages.
 void addSamplerChannelListListener(SamplerChannelListListener listener)
          Registers the specified listener for receiving event messages.
 void addSamplerListener(SamplerListener l)
          Registers the specified listener for receiving event messages.
 void editBackendInstrument(int channelId)
          Schedules a new task for starting an instrument editor for editing the loaded instrument on the specified sampler channel.
 AudioDeviceModel getAudioDevice(int index)
          Gets the model of the audio device at the specified position.
 AudioDeviceModel getAudioDeviceById(int deviceId)
          Gets the model of the audio device with ID deviceId.
 int getAudioDeviceCount()
          Gets the current number of audio devices.
 AudioDeviceModel[] getAudioDevices()
          Gets the current list of audio device models.
 AudioOutputDriver[] getAudioOutputDrivers()
          Gets all audio output drivers currently available for the LinuxSampler instance.
 SamplerChannelModel getChannel(int index)
          Gets the model of the sampler channel in the specified position.
 SamplerChannelModel getChannelById(int channelId)
          Gets the model of the sampler channel with ID channelId.
 int getChannelCount()
          Gets the current number of sampler channels.
 SamplerChannelModel[] getChannels()
          Gets the current list of sampler channel models.
 MidiInstrumentMap getDefaultMidiInstrumentMap()
          Gets the default MIDI instrument map.
 SamplerEngine[] getEngines()
          Gets a list of all available engines.
 MidiDeviceModel getMidiDevice(int index)
          Gets the model of the MIDI device at the specified position.
 MidiDeviceModel getMidiDeviceById(int deviceId)
          Gets the model of the MIDI device with ID deviceId.
 int getMidiDeviceCount()
          Gets the current number of MIDI input devices.
 MidiDeviceModel[] getMidiDevices()
          Gets the current list of MIDI device models.
 MidiInputDriver[] getMidiInputDrivers()
          Gets all MIDI input drivers currently available for the LinuxSampler instance.
 MidiInstrumentMap getMidiInstrumentMap(int index)
          Gets the MIDI instrument map at the specified position.
 MidiInstrumentMap getMidiInstrumentMapById(int mapId)
          Gets the MIDI instrument map with ID mapId.
 int getMidiInstrumentMapCount()
          Gets the current number of MIDI instrument maps.
 int getMidiInstrumentMapIndex(MidiInstrumentMap map)
          Gets the position of the specified MIDI instrument map in the list.
 MidiInstrumentMap[] getMidiInstrumentMaps()
          Gets the current list of MIDI instrument maps.
 int getMutedBySoloChannelCount()
          Gets the number of channels muted because of the presence of a solo channel.
 int getMutedChannelCount()
          Gets the number of muted channels in the current list of sampler channels.
 ServerInfo getServerInfo()
          Gets information about the LinuxSampler instance the front-end is connected to.
 int getSoloChannelCount()
          Gets the number of solo channels in the current list of sampler channels.
 int getTotalStreamCount()
          Gets the total number of active streams.
 int getTotalVoiceCount()
          Gets the total number of active voices.
 int getTotalVoiceCountMax()
          Gets the maximum number of active voices.
 float getVolume()
          Gets the golobal volume of the sampler.
 boolean hasSoloChannel()
          Determines whether there is at least one solo channel in the current list of sampler channels.
 boolean isModified()
          Determines whether the sampler configuration is modified.
 void mapBackendMidiInstrument(int mapId, int bank, int program, MidiInstrumentInfo instrInfo)
          Schedules a new task for mapping a MIDI instrument on the backend side.
 void removeAllMidiInstrumentMaps()
          Removes all MIDI instrument maps.
 boolean removeAudioDeviceById(int deviceId)
          Removes the specified audio device.
 void removeAudioDeviceListListener(ListListener<AudioDeviceModel> listener)
          Removes the specified listener.
 void removeBackendAudioDevice(int deviceId)
          Removes (on the backend side) the specified audio device.
 void removeBackendChannel(int channelId)
          Schedules a new task for removing the specified sampler channel on the backend side.
 void removeBackendMidiDevice(int deviceId)
          Schedules a new task for removing the specified MIDI device.
 void removeBackendMidiInstrumentMap(int mapId)
          Schedules a new task for removing the specified MIDI instrument map on the backend side.
 boolean removeChannelById(int channelId)
          Removes the specified sampler channel.
 boolean removeMidiDeviceById(int deviceId)
          Removes the specified MIDI device.
 void removeMidiDeviceListListener(MidiDeviceListListener listener)
          Removes the specified listener.
 boolean removeMidiInstrumentMapById(int mapId)
          Removes the specified MIDI instrument map.
 void removeMidiInstrumentMapListListener(ListListener<MidiInstrumentMap> listener)
          Removes the specified listener.
 void removeSamplerChannelListListener(SamplerChannelListListener listener)
          Removes the specified listener.
 void removeSamplerListener(SamplerListener l)
          Removes the specified listener.
 void resetBackend()
          Schedules a new task for resetting the sampler.
 void setBackendMidiInstrumentMapName(int mapId, java.lang.String name)
          Schedules a new task for changing the name of the specified MIDI instrument map on the backend side.
 void setBackendVolume(float volume)
          Sets the global volume on the backend side.
 void setModified(boolean b)
          Sets whether the sampler configuration is modified.
 void setVolume(float volume)
          Sets the global volume.
 void unmapBackendMidiInstrument(int mapId, int bank, int program)
          Schedules a new task for removing a MIDI instrument on the backend side.
 void updateActiveStreamsInfo(int count)
          Updates the current number of active disk streams in the sampler.
 void updateActiveVoiceInfo(int count, int countMax)
          Updates the current and the maximum number of active voices in the sampler.
 void updateChannel(SamplerChannel channel)
          Updates the settings of the specified channel.
 

Method Detail

addSamplerListener

void addSamplerListener(SamplerListener l)
Registers the specified listener for receiving event messages.

Parameters:
l - The SamplerListener to register.

removeSamplerListener

void removeSamplerListener(SamplerListener l)
Removes the specified listener.

Parameters:
l - The SamplerListener to remove.

addAudioDeviceListListener

void addAudioDeviceListListener(ListListener<AudioDeviceModel> listener)
Registers the specified listener for receiving event messages.

Parameters:
listener - The ListListener to register.

removeAudioDeviceListListener

void removeAudioDeviceListListener(ListListener<AudioDeviceModel> listener)
Removes the specified listener.

Parameters:
listener - The ListListener to remove.

addMidiDeviceListListener

void addMidiDeviceListListener(MidiDeviceListListener listener)
Registers the specified listener for receiving event messages.

Parameters:
listener - The MidiDeviceListListener to register.

removeMidiDeviceListListener

void removeMidiDeviceListListener(MidiDeviceListListener listener)
Removes the specified listener.

Parameters:
listener - The MidiDeviceListListener to remove.

addMidiInstrumentMapListListener

void addMidiInstrumentMapListListener(ListListener<MidiInstrumentMap> listener)
Registers the specified listener for receiving event messages.

Parameters:
listener - The ListListener to register.

removeMidiInstrumentMapListListener

void removeMidiInstrumentMapListListener(ListListener<MidiInstrumentMap> listener)
Removes the specified listener.

Parameters:
listener - The ListListener to remove.

addSamplerChannelListListener

void addSamplerChannelListListener(SamplerChannelListListener listener)
Registers the specified listener for receiving event messages.

Parameters:
listener - The SamplerChannelListListener to register.

removeSamplerChannelListListener

void removeSamplerChannelListListener(SamplerChannelListListener listener)
Removes the specified listener.

Parameters:
listener - The SamplerChannelListListener to remove.

getServerInfo

ServerInfo getServerInfo()
Gets information about the LinuxSampler instance the front-end is connected to.

Returns:
ServerInfo instance containing information about the LinuxSampler instance the front-end is connected to.

getAudioOutputDrivers

AudioOutputDriver[] getAudioOutputDrivers()
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.

getAudioDevice

AudioDeviceModel getAudioDevice(int index)
Gets the model of the audio device at the specified position.

Parameters:
index - The position of the audio device to return.
Returns:
The model of the audio device at the specified position.
See Also:
getAudioDeviceCount()

getAudioDeviceById

AudioDeviceModel getAudioDeviceById(int deviceId)
Gets the model of the audio device with ID deviceId.

Parameters:
deviceId - The ID of the audio device whose model should be obtained.
Returns:
The model of the specified audio device or null if there is no audio device with ID deviceId.

getAudioDeviceCount

int getAudioDeviceCount()
Gets the current number of audio devices.

Returns:
The current number of audio devices.

getAudioDevices

AudioDeviceModel[] getAudioDevices()
Gets the current list of audio device models.

Returns:
The current list of audio device models.

addAudioDevice

void addAudioDevice(AudioOutputDevice device)
Adds the specified audio device.

Parameters:
device - The audio device to be added.

removeAudioDeviceById

boolean removeAudioDeviceById(int deviceId)
Removes the specified audio device.

Parameters:
deviceId - The ID of the audio device to be removed.
Returns:
true if the audio device is removed successfully, false if the device list does not contain audio device with ID deviceId.

removeBackendAudioDevice

void removeBackendAudioDevice(int deviceId)
Removes (on the backend side) the specified audio device.

Parameters:
deviceId - The ID of the audio device to be removed.

getMidiInputDrivers

MidiInputDriver[] getMidiInputDrivers()
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.

getMidiDevice

MidiDeviceModel getMidiDevice(int index)
Gets the model of the MIDI device at the specified position.

Parameters:
index - The position of the MIDI device to return.
Returns:
The model of the MIDI device at the specified position.

getMidiDeviceById

MidiDeviceModel getMidiDeviceById(int deviceId)
Gets the model of the MIDI device with ID deviceId.

Parameters:
deviceId - The ID of the MIDI device whose model should be obtained.
Returns:
The model of the specified MIDI device or null if there is no MIDI device with ID deviceId.

getMidiDeviceCount

int getMidiDeviceCount()
Gets the current number of MIDI input devices.

Returns:
The current number of MIDI input devices.

getMidiDevices

MidiDeviceModel[] getMidiDevices()
Gets the current list of MIDI device models.

Returns:
The current list of MIDI device models.

addMidiDevice

void addMidiDevice(MidiInputDevice device)
Adds the specified MIDI device.

Parameters:
device - The MIDI device to be added.

addBackendMidiDevice

void addBackendMidiDevice(java.lang.String driver,
                          Parameter... parameters)
Schedules a new task for adding new MIDI device.

Parameters:
driver - The desired MIDI input system.
parameters - An optional list of driver specific parameters.

removeMidiDeviceById

boolean removeMidiDeviceById(int deviceId)
Removes the specified MIDI device.

Parameters:
deviceId - The ID of the MIDI device to be removed.
Returns:
true if the MIDI device is removed successfully, false if the device list does not contain MIDI device with ID deviceId.

removeBackendMidiDevice

void removeBackendMidiDevice(int deviceId)
Schedules a new task for removing the specified MIDI device.

Parameters:
deviceId - The ID of the MIDI input device to be destroyed.

getMidiInstrumentMapById

MidiInstrumentMap getMidiInstrumentMapById(int mapId)
Gets the MIDI instrument map with ID mapId.

Parameters:
mapId - The ID of the MIDI instrument map to obtain.
Returns:
The MIDI instrument map with the specified ID or null if there is no MIDI instrument map with ID mapId.

getMidiInstrumentMap

MidiInstrumentMap getMidiInstrumentMap(int index)
Gets the MIDI instrument map at the specified position.

Parameters:
index - The position of the MIDI instrument map to return.
Returns:
The MIDI instrument map at the specified position.

getMidiInstrumentMapCount

int getMidiInstrumentMapCount()
Gets the current number of MIDI instrument maps.

Returns:
The current number of MIDI instrument maps.

getMidiInstrumentMaps

MidiInstrumentMap[] getMidiInstrumentMaps()
Gets the current list of MIDI instrument maps.

Returns:
The current list of MIDI instrument maps.

getMidiInstrumentMapIndex

int getMidiInstrumentMapIndex(MidiInstrumentMap map)
Gets the position of the specified MIDI instrument map in the list.

Parameters:
map - The map whose index should be returned.
Returns:
The position of the specified map in the list, or -1 if map is null or the map list does not contain the specified map.

addMidiInstrumentMap

void addMidiInstrumentMap(MidiInstrumentMap map)
Adds the specified MIDI instrument map.

Parameters:
map - The MIDI instrument map to be added.

addBackendMidiInstrumentMap

void addBackendMidiInstrumentMap(java.lang.String name)
Schedules a new task for creating a new MIDI instrument map on the backend side.

Parameters:
name - The name of the MIDI instrument map.
Throws:
java.lang.IllegalArgumentException - If name is null.

removeMidiInstrumentMapById

boolean removeMidiInstrumentMapById(int mapId)
Removes the specified MIDI instrument map.

Parameters:
mapId - The ID of the MIDI instrument map to be removed.
Returns:
true if the MIDI instrument map is removed successfully, false if the MIDI instrument map's list does not contain MIDI instrument map with ID mapId.

removeAllMidiInstrumentMaps

void removeAllMidiInstrumentMaps()
Removes all MIDI instrument maps.


removeBackendMidiInstrumentMap

void removeBackendMidiInstrumentMap(int mapId)
Schedules a new task for removing the specified MIDI instrument map on the backend side.

Parameters:
mapId - The numerical ID of the MIDI instrument map to remove.
Throws:
java.lang.IllegalArgumentException - If mapId is negative.

setBackendMidiInstrumentMapName

void setBackendMidiInstrumentMapName(int mapId,
                                     java.lang.String name)
Schedules a new task for changing the name of the specified MIDI instrument map on the backend side.

Parameters:
mapId - The numerical ID of the MIDI instrument map.
name - The new name for the specified MIDI instrument map.

getDefaultMidiInstrumentMap

MidiInstrumentMap getDefaultMidiInstrumentMap()
Gets the default MIDI instrument map.

Returns:
The default MIDI instrument map or null if there are no maps created.

mapBackendMidiInstrument

void mapBackendMidiInstrument(int mapId,
                              int bank,
                              int program,
                              MidiInstrumentInfo instrInfo)
Schedules a new task for mapping a MIDI instrument on the backend side.

Parameters:
mapId - The id of the MIDI instrument map.
bank - The index of the MIDI bank, which shall contain the instrument.
program - The MIDI program number of the new instrument.
instrInfo - Provides the MIDI instrument settings.

unmapBackendMidiInstrument

void unmapBackendMidiInstrument(int mapId,
                                int bank,
                                int program)
Schedules a new task for removing a MIDI instrument on the backend side.

Parameters:
mapId - The id of the MIDI instrument map containing the instrument to be removed.
bank - The index of the MIDI bank containing the instrument to be removed.
program - The MIDI program number of the instrument to be removed.

getEngines

SamplerEngine[] getEngines()
Gets a list of all available engines.

Returns:
A list of all available engines.

getChannels

SamplerChannelModel[] getChannels()
Gets the current list of sampler channel models.

Returns:
The current list of sampler channel models.

getChannel

SamplerChannelModel getChannel(int index)
Gets the model of the sampler channel in the specified position.

Parameters:
index - The position of the channel to return.
Returns:
The model of the specified sampler channel.
See Also:
#getchannelCount

getChannelById

SamplerChannelModel getChannelById(int channelId)
Gets the model of the sampler channel with ID channelId.

Parameters:
channelId - The ID of the sampler channel whose model should be obtained.
Returns:
The model of the specified sampler channel or null if there is no channel with ID channelId.

getChannelCount

int getChannelCount()
Gets the current number of sampler channels.

Returns:
The current number of sampler channels.

addBackendChannel

void addBackendChannel()
Adds a new sampler channel on the backend side. The channel will be actually added to this model when the backend notifies for its creation.

See Also:
addChannel(SamplerChannel)

addChannel

void addChannel(SamplerChannel channel)
Adds the specified sampler channel.

Parameters:
channel - The channel to be added.

removeChannelById

boolean removeChannelById(int channelId)
Removes the specified sampler channel. Note that this method doesn't remove the channel in the backend, it is used to remove the channel from the model when those channel is removed in the backend.

Parameters:
channelId - The ID of the channel to be removed.
Returns:
true if the channel is removed successfully, false if the channel's list does not contain channel with ID channelId.

removeBackendChannel

void removeBackendChannel(int channelId)
Schedules a new task for removing the specified sampler channel on the backend side.

Parameters:
channelId - The ID of the channel to be removed.

updateChannel

void updateChannel(SamplerChannel channel)
Updates the settings of the specified channel.

Parameters:
channel - A SamplerChannel instance containing the new settings for the channel.

editBackendInstrument

void editBackendInstrument(int channelId)
Schedules a new task for starting an instrument editor for editing the loaded instrument on the specified sampler channel.

Parameters:
channelId - The sampler channel number.

hasSoloChannel

boolean hasSoloChannel()
Determines whether there is at least one solo channel in the current list of sampler channels.

Returns:
true if there is at least one solo channel in the current list of sampler channels, false otherwise.

getSoloChannelCount

int getSoloChannelCount()
Gets the number of solo channels in the current list of sampler channels.

Returns:
The number of solo channels in the current list of sampler channels.

getMutedChannelCount

int getMutedChannelCount()
Gets the number of muted channels in the current list of sampler channels. This number includes the channels muted because of the presence of a solo channel.

Returns:
The number of muted channels in the current list of sampler channels.

getMutedBySoloChannelCount

int getMutedBySoloChannelCount()
Gets the number of channels muted because of the presence of a solo channel.

Returns:
The number of channels muted because of the presence of a solo channel.

getTotalStreamCount

int getTotalStreamCount()
Gets the total number of active streams.

Returns:
The total number of active streams.

getTotalVoiceCount

int getTotalVoiceCount()
Gets the total number of active voices.

Returns:
The total number of active voices.

getTotalVoiceCountMax

int getTotalVoiceCountMax()
Gets the maximum number of active voices.

Returns:
The maximum number of active voices.

getVolume

float getVolume()
Gets the golobal volume of the sampler.

Returns:
The golobal volume of the sampler.

setVolume

void setVolume(float volume)
Sets the global volume.

Parameters:
volume - The new volume value.

setBackendVolume

void setBackendVolume(float volume)
Sets the global volume on the backend side.

Parameters:
volume - The new volume value.

resetBackend

void resetBackend()
Schedules a new task for resetting the sampler.


updateActiveStreamsInfo

void updateActiveStreamsInfo(int count)
Updates the current number of active disk streams in the sampler.

Parameters:
count - The new number of active streams.

updateActiveVoiceInfo

void updateActiveVoiceInfo(int count,
                           int countMax)
Updates the current and the maximum number of active voices in the sampler.

Parameters:
count - The new number of active voices.
countMax - The maximum number of active voices.

isModified

boolean isModified()
Determines whether the sampler configuration is modified.


setModified

void setModified(boolean b)
Sets whether the sampler configuration is modified.


JSampler
v0.8a

Copyright © 2007 Grigor Iliev. All rights reserved.