JSampler
v0.8a

org.jsampler
Class DefaultSamplerModel

java.lang.Object
  extended by org.jsampler.DefaultSamplerModel
All Implemented Interfaces:
SamplerModel

public class DefaultSamplerModel
extends java.lang.Object
implements SamplerModel

This class provides default implementation of the SamplerModel interface. Note that the setter methods of this class does not alter any settings on the backend side unless otherwise specified.


Constructor Summary
DefaultSamplerModel()
          Creates a new instance of DefaultSamplerModel
 
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()
          Schedules a new task for adding 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)
          Schedules a new task for removing the specified audio device on the backend side.
 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 removeMidiInstrumentMap(MidiInstrumentMap map)
          Removes the specified MIDI instrument map.
 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 setAudioOutputDrivers(AudioOutputDriver[] drivers)
          Sets the currently available audio output drivers for the LinuxSampler instance.
 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)
          Schedules a new task for setting the global volume on the backend side.
 void setEngines(SamplerEngine[] engines)
          Sets the list of all available engines.
 void setMidiInputDrivers(MidiInputDriver[] drivers)
          Sets the currently available MIDI input drivers for the LinuxSampler instance.
 void setModified(boolean b)
          Sets whether the sampler configuration is modified.
 void setServerInfo(ServerInfo serverInfo)
          Sets information about the LinuxSampler instance the front-end is connected to.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSamplerModel

public DefaultSamplerModel()
Creates a new instance of DefaultSamplerModel

Method Detail

addSamplerListener

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

Specified by:
addSamplerListener in interface SamplerModel
Parameters:
l - The SamplerListener to register.

removeSamplerListener

public void removeSamplerListener(SamplerListener l)
Removes the specified listener.

Specified by:
removeSamplerListener in interface SamplerModel
Parameters:
l - The SamplerListener to remove.

addAudioDeviceListListener

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

Specified by:
addAudioDeviceListListener in interface SamplerModel
Parameters:
listener - The AudioDeviceListListener to register.

removeAudioDeviceListListener

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

Specified by:
removeAudioDeviceListListener in interface SamplerModel
Parameters:
listener - The AudioDeviceListListener to remove.

addMidiDeviceListListener

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

Specified by:
addMidiDeviceListListener in interface SamplerModel
Parameters:
listener - The MidiDeviceListListener to register.

removeMidiDeviceListListener

public void removeMidiDeviceListListener(MidiDeviceListListener listener)
Removes the specified listener.

Specified by:
removeMidiDeviceListListener in interface SamplerModel
Parameters:
listener - The MidiDeviceListListener to remove.

addMidiInstrumentMapListListener

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

Specified by:
addMidiInstrumentMapListListener in interface SamplerModel
Parameters:
listener - The ListListener to register.

removeMidiInstrumentMapListListener

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

Specified by:
removeMidiInstrumentMapListListener in interface SamplerModel
Parameters:
listener - The ListListener to remove.

addSamplerChannelListListener

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

Specified by:
addSamplerChannelListListener in interface SamplerModel
Parameters:
listener - The SamplerChannelListListener to register.

removeSamplerChannelListListener

public void removeSamplerChannelListListener(SamplerChannelListListener listener)
Removes the specified listener.

Specified by:
removeSamplerChannelListListener in interface SamplerModel
Parameters:
listener - The SamplerChannelListListener to remove.

getServerInfo

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

Specified by:
getServerInfo in interface SamplerModel
Returns:
ServerInfo instance containing information about the LinuxSampler instance the front-end is connected to.

setServerInfo

public void setServerInfo(ServerInfo serverInfo)
Sets information about the LinuxSampler instance the front-end is connected to.

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

getAudioOutputDrivers

public AudioOutputDriver[] getAudioOutputDrivers()
Gets all audio output drivers currently available for the LinuxSampler instance.

Specified by:
getAudioOutputDrivers in interface SamplerModel
Returns:
AudioOutputDriver array containing all audio output drivers currently available for the LinuxSampler instance.

setAudioOutputDrivers

public void setAudioOutputDrivers(AudioOutputDriver[] drivers)
Sets the currently available audio output drivers for the LinuxSampler instance.

Parameters:
drivers - AudioOutputDriver array containing all audio output drivers currently available for the LinuxSampler instance.

getAudioDevice

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

Specified by:
getAudioDevice in interface SamplerModel
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

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

Specified by:
getAudioDeviceById in interface SamplerModel
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

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

Specified by:
getAudioDeviceCount in interface SamplerModel
Returns:
The current number of audio devices.

getAudioDevices

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

Specified by:
getAudioDevices in interface SamplerModel
Returns:
The current list of audio device models.

addAudioDevice

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

Specified by:
addAudioDevice in interface SamplerModel
Parameters:
device - The audio device to be added.

removeAudioDeviceById

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

Specified by:
removeAudioDeviceById in interface SamplerModel
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

public void removeBackendAudioDevice(int deviceId)
Schedules a new task for removing the specified audio device on the backend side.

Specified by:
removeBackendAudioDevice in interface SamplerModel
Parameters:
deviceId - The ID of the audio device to be removed.

getMidiInputDrivers

public MidiInputDriver[] getMidiInputDrivers()
Gets all MIDI input drivers currently available for the LinuxSampler instance.

Specified by:
getMidiInputDrivers in interface SamplerModel
Returns:
MidiInputDriver array containing all MIDI input drivers currently available for the LinuxSampler instance.

setMidiInputDrivers

public void setMidiInputDrivers(MidiInputDriver[] drivers)
Sets the currently available MIDI input drivers for the LinuxSampler instance.

Parameters:
drivers - MidiInputDriver array containing all MIDI input drivers currently available for the LinuxSampler instance.

getMidiDevice

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

Specified by:
getMidiDevice in interface SamplerModel
Parameters:
index - The position of the MIDI device to return.
Returns:
The model of the MIDI device at the specified position.

getMidiDeviceById

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

Specified by:
getMidiDeviceById in interface SamplerModel
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

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

Specified by:
getMidiDeviceCount in interface SamplerModel
Returns:
The current number of MIDI input devices.

getMidiDevices

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

Specified by:
getMidiDevices in interface SamplerModel
Returns:
The current list of MIDI device models.

addMidiDevice

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

Specified by:
addMidiDevice in interface SamplerModel
Parameters:
device - The MIDI device to be added.

addBackendMidiDevice

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

Specified by:
addBackendMidiDevice in interface SamplerModel
Parameters:
driver - The desired MIDI input system.
parameters - An optional list of driver specific parameters.

removeMidiDeviceById

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

Specified by:
removeMidiDeviceById in interface SamplerModel
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

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

Specified by:
removeBackendMidiDevice in interface SamplerModel
Parameters:
deviceId - The ID of the MIDI input device to be destroyed.

getMidiInstrumentMapById

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

Specified by:
getMidiInstrumentMapById in interface SamplerModel
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

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

Specified by:
getMidiInstrumentMap in interface SamplerModel
Parameters:
index - The position of the MIDI instrument map to return.
Returns:
The MIDI instrument map at the specified position.

getMidiInstrumentMapCount

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

Specified by:
getMidiInstrumentMapCount in interface SamplerModel
Returns:
The current number of MIDI instrument maps.

getMidiInstrumentMaps

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

Specified by:
getMidiInstrumentMaps in interface SamplerModel
Returns:
The current list of MIDI instrument maps.

getMidiInstrumentMapIndex

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

Specified by:
getMidiInstrumentMapIndex in interface SamplerModel
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

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

Specified by:
addMidiInstrumentMap in interface SamplerModel
Parameters:
map - The MIDI instrument map to be added.
Throws:
java.lang.IllegalArgumentException - If map is null.

addBackendMidiInstrumentMap

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

Specified by:
addBackendMidiInstrumentMap in interface SamplerModel
Parameters:
name - The name of the MIDI instrument map.
Throws:
java.lang.IllegalArgumentException - If name is null.

removeMidiInstrumentMapById

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

Specified by:
removeMidiInstrumentMapById in interface SamplerModel
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.

removeMidiInstrumentMap

public boolean removeMidiInstrumentMap(MidiInstrumentMap map)
Removes the specified MIDI instrument map.

Parameters:
map - The MIDI instrument map to remove.
Returns:
true if the specified MIDI instrument map was in the list, false otherwise.

removeAllMidiInstrumentMaps

public void removeAllMidiInstrumentMaps()
Removes all MIDI instrument maps.

Specified by:
removeAllMidiInstrumentMaps in interface SamplerModel

removeBackendMidiInstrumentMap

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

Specified by:
removeBackendMidiInstrumentMap in interface SamplerModel
Parameters:
mapId - The numerical ID of the MIDI instrument map to remove.

setBackendMidiInstrumentMapName

public 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.

Specified by:
setBackendMidiInstrumentMapName in interface SamplerModel
Parameters:
mapId - The numerical ID of the MIDI instrument map.
name - The new name for the specified MIDI instrument map.

getDefaultMidiInstrumentMap

public MidiInstrumentMap getDefaultMidiInstrumentMap()
Gets the default MIDI instrument map.

Specified by:
getDefaultMidiInstrumentMap in interface SamplerModel
Returns:
The default MIDI instrument map or null if there are no maps created.

mapBackendMidiInstrument

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

Specified by:
mapBackendMidiInstrument in interface SamplerModel
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

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

Specified by:
unmapBackendMidiInstrument in interface SamplerModel
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

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

Specified by:
getEngines in interface SamplerModel
Returns:
A list of all available engines.

setEngines

public void setEngines(SamplerEngine[] engines)
Sets the list of all available engines.

Parameters:
engines - The new list of all available engines.

getChannel

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

Specified by:
getChannel in interface SamplerModel
Parameters:
index - The position of the channel to return.
Returns:
The model of the specified sampler channel.
See Also:
#getchannelCount

getChannelById

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

Specified by:
getChannelById in interface SamplerModel
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

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

Specified by:
getChannelCount in interface SamplerModel
Returns:
The current number of sampler channels.

getChannels

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

Specified by:
getChannels in interface SamplerModel
Returns:
The current list of sampler channel models.

addBackendChannel

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

Specified by:
addBackendChannel in interface SamplerModel
See Also:
addChannel(SamplerChannel)

addChannel

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

Specified by:
addChannel in interface SamplerModel
Parameters:
channel - The channel to be added.

updateChannel

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

Specified by:
updateChannel in interface SamplerModel
Parameters:
channel - A SamplerChannel instance containing the new settings for the channel.

removeChannelById

public boolean removeChannelById(int channelId)
Removes the specified sampler channel.

Specified by:
removeChannelById in interface SamplerModel
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

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

Specified by:
removeBackendChannel in interface SamplerModel
Parameters:
channelId - The ID of the channel to be removed.

editBackendInstrument

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

Specified by:
editBackendInstrument in interface SamplerModel
Parameters:
channelId - The sampler channel number.

hasSoloChannel

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

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

getSoloChannelCount

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

Specified by:
getSoloChannelCount in interface SamplerModel
Returns:
The number of solo channels in the current list of sampler channels.

getMutedChannelCount

public 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.

Specified by:
getMutedChannelCount in interface SamplerModel
Returns:
The number of muted channels in the current list of sampler channels.

getMutedBySoloChannelCount

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

Specified by:
getMutedBySoloChannelCount in interface SamplerModel
Returns:
The number of channels muted because of the presence of a solo channel.

getTotalStreamCount

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

Specified by:
getTotalStreamCount in interface SamplerModel
Returns:
The total number of active streams.

getTotalVoiceCount

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

Specified by:
getTotalVoiceCount in interface SamplerModel
Returns:
The total number of active voices.

getTotalVoiceCountMax

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

Specified by:
getTotalVoiceCountMax in interface SamplerModel
Returns:
The maximum number of active voices.

getVolume

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

Specified by:
getVolume in interface SamplerModel
Returns:
The golobal volume of the sampler.

setVolume

public void setVolume(float volume)
Sets the global volume.

Specified by:
setVolume in interface SamplerModel
Parameters:
volume - The new volume value.

setBackendVolume

public void setBackendVolume(float volume)
Schedules a new task for setting the global volume on the backend side.

Specified by:
setBackendVolume in interface SamplerModel
Parameters:
volume - The new volume value.

resetBackend

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

Specified by:
resetBackend in interface SamplerModel

updateActiveStreamsInfo

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

Specified by:
updateActiveStreamsInfo in interface SamplerModel
Parameters:
count - The new number of active streams.

updateActiveVoiceInfo

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

Specified by:
updateActiveVoiceInfo in interface SamplerModel
Parameters:
count - The new number of active voices.
countMax - The maximum number of active voices.

isModified

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

Specified by:
isModified in interface SamplerModel

setModified

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

Specified by:
setModified in interface SamplerModel

JSampler
v0.8a

Copyright © 2007 Grigor Iliev. All rights reserved.