APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.media.sound

public final Class DLSSoundbank

extends Object
implements Soundbank
Class Inheritance
All Implemented Interfaces
javax.sound.midi.Soundbank
Imports
java.io.File, .FileInputStream, .IOException, .InputStream, .OutputStream, java.net.URL, java.util.ArrayDeque, .ArrayList, .Arrays, .HashMap, .List, .Map, javax.sound.midi.Instrument, .Patch, .Soundbank, .SoundbankResource, javax.sound.sampled.AudioFormat, .AudioFormat.Encoding, .AudioInputStream, .AudioSystem

A DLS Level 1 and Level 2 soundbank reader (from files/url/streams).
Author
Karl Helgason

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final int
DLS_CDL_ADD

X = X + Y

private static final int
DLS_CDL_AND

X = X & Y

private static final int
DLS_CDL_CONST

32-bit constant

private static final int
DLS_CDL_DIVIDE

X = X / Y

private static final int
DLS_CDL_EQ

X = (X == Y)

private static final int
DLS_CDL_GE

X = (X >= Y)

private static final int
DLS_CDL_GT

X = (X > Y)

private static final int
DLS_CDL_LE

X = (X <= Y)

private static final int
private static final int
private static final int
DLS_CDL_LT

X = (X < Y)

private static final int
private static final int
private static final int
DLS_CDL_OR

X = X | Y

private static final int
DLS_CDL_QUERY

32-bit value returned from query

private static final int
DLS_CDL_QUERYSUPPORTED

32-bit value returned from query

private static final int
private static final int
DLS_CDL_XOR

X = X ^ Y

private static final DLSSoundbank.DLSID
private static final DLSSoundbank.DLSID
private static final DLSSoundbank.DLSID
private static final DLSSoundbank.DLSID
private static final DLSSoundbank.DLSID
private static final DLSSoundbank.DLSID
private static final DLSSoundbank.DLSID
private static final DLSSoundbank.DLSID
private static final DLSSoundbank.DLSID
private final DLSInfo
private final List<DLSInstrument>
private boolean
private long
private long
private File
private final List<DLSSample>
private Map<DLSRegion, Long>

Constructor Summary

AccessConstructor and Description
public
public
public
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
private boolean
private long
public String
getDescription()

Implements javax.sound.midi.Soundbank.getDescription.

Obtains a textual description of the sound bank, suitable for display.

public DLSInfo
public Instrument
getInstrument(Patch patch)

Implements javax.sound.midi.Soundbank.getInstrument.

Obtains an Instrument from the given Patch.

public DLSInstrument[]
getInstruments()

Implements javax.sound.midi.Soundbank.getInstruments.

Obtains a list of instruments contained in this sound bank.

public long
public long
public String
getName()

Implements javax.sound.midi.Soundbank.getName.

Obtains the name of the sound bank.

public SoundbankResource[]
getResources()

Implements javax.sound.midi.Soundbank.getResources.

Extracts a list of non-Instrument resources contained in the sound bank.

public DLSSample[]
public String
getVendor()

Implements javax.sound.midi.Soundbank.getVendor.

Obtains a string naming the company that provides the sound bank.

public String
getVersion()

Implements javax.sound.midi.Soundbank.getVersion.

Obtains the version string for the sound bank.

private void
private void
private boolean
private void
private void
private void
private void
private boolean
private void
private void
private void
private void
private void
public void
public void
public void
save(String name)

public void
save(File file)

public void
public void
public void
setMajor(long major)

public void
setMinor(long minor)

public void
public void
private void
private void
private void
private void
private void
private void
writeRegion(RIFFWriter writer, DLSRegion region, int version)

private void
private void
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DLS_CDL_ADDback to summary
private static final int DLS_CDL_ADD

X = X + Y

DLS_CDL_ANDback to summary
private static final int DLS_CDL_AND

X = X & Y

DLS_CDL_CONSTback to summary
private static final int DLS_CDL_CONST

32-bit constant

DLS_CDL_DIVIDEback to summary
private static final int DLS_CDL_DIVIDE

X = X / Y

DLS_CDL_EQback to summary
private static final int DLS_CDL_EQ

X = (X == Y)

DLS_CDL_GEback to summary
private static final int DLS_CDL_GE

X = (X >= Y)

DLS_CDL_GTback to summary
private static final int DLS_CDL_GT

X = (X > Y)

DLS_CDL_LEback to summary
private static final int DLS_CDL_LE

X = (X <= Y)

DLS_CDL_LOGICAL_ANDback to summary
private static final int DLS_CDL_LOGICAL_AND

X = X && Y

DLS_CDL_LOGICAL_ORback to summary
private static final int DLS_CDL_LOGICAL_OR

X = X || Y

DLS_CDL_LTback to summary
private static final int DLS_CDL_LT

X = (X < Y)

DLS_CDL_MULTIPLYback to summary
private static final int DLS_CDL_MULTIPLY

X = X * Y

DLS_CDL_NOTback to summary
private static final int DLS_CDL_NOT

X = !X

DLS_CDL_ORback to summary
private static final int DLS_CDL_OR

X = X | Y

DLS_CDL_QUERYback to summary
private static final int DLS_CDL_QUERY

32-bit value returned from query

DLS_CDL_QUERYSUPPORTEDback to summary
private static final int DLS_CDL_QUERYSUPPORTED

32-bit value returned from query

DLS_CDL_SUBTRACTback to summary
private static final int DLS_CDL_SUBTRACT

X = X - Y

DLS_CDL_XORback to summary
private static final int DLS_CDL_XOR

X = X ^ Y

DLSID_GMInHardwareback to summary
private static final DLSSoundbank.DLSID DLSID_GMInHardware
DLSID_GSInHardwareback to summary
private static final DLSSoundbank.DLSID DLSID_GSInHardware
DLSID_ManufacturersIDback to summary
private static final DLSSoundbank.DLSID DLSID_ManufacturersID
DLSID_ProductIDback to summary
private static final DLSSoundbank.DLSID DLSID_ProductID
DLSID_SampleMemorySizeback to summary
private static final DLSSoundbank.DLSID DLSID_SampleMemorySize
DLSID_SamplePlaybackRateback to summary
private static final DLSSoundbank.DLSID DLSID_SamplePlaybackRate
DLSID_SupportsDLS1back to summary
private static final DLSSoundbank.DLSID DLSID_SupportsDLS1
DLSID_SupportsDLS2back to summary
private static final DLSSoundbank.DLSID DLSID_SupportsDLS2
DLSID_XGInHardwareback to summary
private static final DLSSoundbank.DLSID DLSID_XGInHardware
infoback to summary
private final DLSInfo info
instrumentsback to summary
private final List<DLSInstrument> instruments
largeFormatback to summary
private boolean largeFormat
majorback to summary
private long major
minorback to summary
private long minor
sampleFileback to summary
private File sampleFile
samplesback to summary
private final List<DLSSample> samples
temp_rgnassignback to summary
private Map<DLSRegion, Long> temp_rgnassign

Constructor Detail

DLSSoundbankback to summary
public DLSSoundbank()
DLSSoundbankback to summary
public DLSSoundbank(URL url) throws IOException
DLSSoundbankback to summary
public DLSSoundbank(File file) throws IOException
DLSSoundbankback to summary
public DLSSoundbank(InputStream inputstream) throws IOException

Method Detail

addInstrumentback to summary
public void addInstrument(DLSInstrument resource)
addResourceback to summary
public void addResource(SoundbankResource resource)
cdlIsQuerySupportedback to summary
private boolean cdlIsQuerySupported(DLSSoundbank.DLSID uuid)
cdlQueryback to summary
private long cdlQuery(DLSSoundbank.DLSID uuid)
getDescriptionback to summary
public String getDescription()

Implements javax.sound.midi.Soundbank.getDescription.

Doc from javax.sound.midi.Soundbank.getDescription.

Obtains a textual description of the sound bank, suitable for display.

Annotations
@Override
getInfoback to summary
public DLSInfo getInfo()
getInstrumentback to summary
public Instrument getInstrument(Patch patch)

Implements javax.sound.midi.Soundbank.getInstrument.

Doc from javax.sound.midi.Soundbank.getInstrument.

Obtains an Instrument from the given Patch.

Annotations
@Override
getInstrumentsback to summary
public DLSInstrument[] getInstruments()

Implements javax.sound.midi.Soundbank.getInstruments.

Doc from javax.sound.midi.Soundbank.getInstruments.

Obtains a list of instruments contained in this sound bank.

Annotations
@Override
getMajorback to summary
public long getMajor()
getMinorback to summary
public long getMinor()
getNameback to summary
public String getName()

Implements javax.sound.midi.Soundbank.getName.

Doc from javax.sound.midi.Soundbank.getName.

Obtains the name of the sound bank.

Annotations
@Override
getResourcesback to summary
public SoundbankResource[] getResources()

Implements javax.sound.midi.Soundbank.getResources.

Doc from javax.sound.midi.Soundbank.getResources.

Extracts a list of non-Instrument resources contained in the sound bank.

Annotations
@Override
getSamplesback to summary
public DLSSample[] getSamples()
getVendorback to summary
public String getVendor()

Implements javax.sound.midi.Soundbank.getVendor.

Doc from javax.sound.midi.Soundbank.getVendor.

Obtains a string naming the company that provides the sound bank.

Annotations
@Override
getVersionback to summary
public String getVersion()

Implements javax.sound.midi.Soundbank.getVersion.

Doc from javax.sound.midi.Soundbank.getVersion.

Obtains the version string for the sound bank.

Annotations
@Override
readArt1Chunkback to summary
private void readArt1Chunk(List<DLSModulator> modulators, RIFFReader riff) throws IOException
readArt2Chunkback to summary
private void readArt2Chunk(List<DLSModulator> modulators, RIFFReader riff) throws IOException
readCdlChunkback to summary
private boolean readCdlChunk(RIFFReader riff) throws IOException
readInfoChunkback to summary
private void readInfoChunk(RIFFReader riff) throws IOException
readInsChunkback to summary
private void readInsChunk(RIFFReader riff) throws IOException
readInsInfoChunkback to summary
private void readInsInfoChunk(DLSInstrument dlsinstrument, RIFFReader riff) throws IOException
readLinsChunkback to summary
private void readLinsChunk(RIFFReader riff) throws IOException
readRgnChunkback to summary
private boolean readRgnChunk(DLSRegion split, RIFFReader riff) throws IOException
readSoundbankback to summary
private void readSoundbank(InputStream inputstream) throws IOException
readWaveChunkback to summary
private void readWaveChunk(RIFFReader riff) throws IOException
readWaveInfoChunkback to summary
private void readWaveInfoChunk(DLSSample dlssample, RIFFReader riff) throws IOException
readWsmpChunkback to summary
private void readWsmpChunk(DLSSampleOptions sampleOptions, RIFFReader riff) throws IOException
readWvplChunkback to summary
private void readWvplChunk(RIFFReader riff) throws IOException
removeInstrumentback to summary
public void removeInstrument(DLSInstrument resource)
removeResourceback to summary
public void removeResource(SoundbankResource resource)
saveback to summary
public void save(String name) throws IOException
saveback to summary
public void save(File file) throws IOException
saveback to summary
public void save(OutputStream out) throws IOException
setDescriptionback to summary
public void setDescription(String s)
setMajorback to summary
public void setMajor(long major)
setMinorback to summary
public void setMinor(long minor)
setNameback to summary
public void setName(String s)
setVendorback to summary
public void setVendor(String s)
writeArticulatorsback to summary
private void writeArticulators(RIFFWriter writer, List<DLSModulator> modulators) throws IOException
writeInfoback to summary
private void writeInfo(RIFFWriter writer, DLSInfo info) throws IOException
writeInfoStringChunkback to summary
private void writeInfoStringChunk(RIFFWriter writer, String name, String value) throws IOException
writeInstrumentback to summary
private void writeInstrument(RIFFWriter writer, DLSInstrument instrument) throws IOException
writeInstrumentsback to summary
private void writeInstruments(RIFFWriter writer) throws IOException
writeRegionback to summary
private void writeRegion(RIFFWriter writer, DLSRegion region, int version) throws IOException
writeSampleback to summary
private void writeSample(RIFFWriter writer, DLSSample sample) throws IOException
writeSampleOptionsback to summary
private void writeSampleOptions(RIFFWriter wsmp, DLSSampleOptions sampleoptions) throws IOException
writeSoundbankback to summary
private void writeSoundbank(RIFFWriter writer) throws IOException
com.sun.media.sound back to summary

private Class DLSSoundbank.DLSID

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv long
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv int

Constructor Summary

AccessConstructor and Description
private
pack-priv
DLSID(long i1, int s1, int s2, int x1, int x2, int x3, int x4, int x5, int x6, int x7, int x8)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object obj)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public static DLSSoundbank.DLSID
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

i1back to summary
pack-priv long i1
s1back to summary
pack-priv int s1
s2back to summary
pack-priv int s2
x1back to summary
pack-priv int x1
x2back to summary
pack-priv int x2
x3back to summary
pack-priv int x3
x4back to summary
pack-priv int x4
x5back to summary
pack-priv int x5
x6back to summary
pack-priv int x6
x7back to summary
pack-priv int x7
x8back to summary
pack-priv int x8

Constructor Detail

DLSIDback to summary
private DLSID()
DLSIDback to summary
pack-priv DLSID(long i1, int s1, int s2, int x1, int x2, int x3, int x4, int x5, int x6, int x7, int x8)

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
readback to summary
public static DLSSoundbank.DLSID read(RIFFReader riff) throws IOException