author | ddehaven |
Tue, 19 Aug 2014 10:32:16 -0700 | |
changeset 26037 | 508779ce6619 |
parent 26003 | jdk/src/share/classes/javax/sound/midi/Soundbank.java@d630c97424bd |
parent 25859 | jdk/src/share/classes/javax/sound/midi/Soundbank.java@3317bb8137f4 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
26003
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
2 |
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package javax.sound.midi; |
|
27 |
||
28 |
/** |
|
26003
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
29 |
* A {@code Soundbank} contains a set of {@code Instruments} that can be loaded |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
30 |
* into a {@code Synthesizer}. Note that a Java Sound {@code Soundbank} is |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
31 |
* different from a MIDI bank. MIDI permits up to 16383 banks, each containing |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
32 |
* up to 128 instruments (also sometimes called programs, patches, or timbres). |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
33 |
* However, a {@code Soundbank} can contain 16383 times 128 instruments, because |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
34 |
* the instruments within a {@code Soundbank} are indexed by both a MIDI program |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
35 |
* number and a MIDI bank number (via a {@code Patch} object). Thus, a |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
36 |
* {@code Soundbank} can be thought of as a collection of MIDI banks. |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
37 |
* <p> |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
38 |
* {@code Soundbank} includes methods that return {@code String} objects |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
39 |
* containing the sound bank's name, manufacturer, version number, and |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
40 |
* description. The precise content and format of these strings is left to the |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
41 |
* implementor. |
2 | 42 |
* <p> |
26003
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
43 |
* Different synthesizers use a variety of synthesis techniques. A common one is |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
44 |
* wavetable synthesis, in which a segment of recorded sound is played back, |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
45 |
* often with looping and pitch change. The Downloadable Sound (DLS) format uses |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
46 |
* segments of recorded sound, as does the Headspace Engine. {@code Soundbanks} |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
47 |
* and {@code Instruments} that are based on wavetable synthesis (or other uses |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
48 |
* of stored sound recordings) should typically implement the |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
49 |
* {@code getResources()} method to provide access to these recorded segments. |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
50 |
* This is optional, however; the method can return an zero-length array if the |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
51 |
* synthesis technique doesn't use sampled sound (FM synthesis and physical |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
52 |
* modeling are examples of such techniques), or if it does but the implementor |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
53 |
* chooses not to make the samples accessible. |
2 | 54 |
* |
26003
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
55 |
* @author David Rivas |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
56 |
* @author Kara Kytle |
2 | 57 |
* @see Synthesizer#getDefaultSoundbank |
58 |
* @see Synthesizer#isSoundbankSupported |
|
59 |
* @see Synthesizer#loadInstruments(Soundbank, Patch[]) |
|
60 |
* @see Patch |
|
61 |
* @see Instrument |
|
62 |
* @see SoundbankResource |
|
63 |
*/ |
|
64 |
public interface Soundbank { |
|
65 |
||
66 |
/** |
|
67 |
* Obtains the name of the sound bank. |
|
26003
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
68 |
* |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
69 |
* @return a {@code String} naming the sound bank |
2 | 70 |
*/ |
26003
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
71 |
String getName(); |
2 | 72 |
|
73 |
/** |
|
74 |
* Obtains the version string for the sound bank. |
|
26003
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
75 |
* |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
76 |
* @return a {@code String} that indicates the sound bank's version |
2 | 77 |
*/ |
26003
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
78 |
String getVersion(); |
2 | 79 |
|
80 |
/** |
|
26003
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
81 |
* Obtains a {@code string} naming the company that provides the sound bank. |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
82 |
* |
2 | 83 |
* @return the vendor string |
84 |
*/ |
|
26003
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
85 |
String getVendor(); |
2 | 86 |
|
87 |
/** |
|
88 |
* Obtains a textual description of the sound bank, suitable for display. |
|
26003
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
89 |
* |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
90 |
* @return a {@code String} that describes the sound bank |
2 | 91 |
*/ |
26003
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
92 |
String getDescription(); |
2 | 93 |
|
94 |
/** |
|
95 |
* Extracts a list of non-Instrument resources contained in the sound bank. |
|
26003
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
96 |
* |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
97 |
* @return an array of resources, excluding instruments. If the sound bank |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
98 |
* contains no resources (other than instruments), returns an array |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
99 |
* of length 0. |
2 | 100 |
*/ |
26003
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
101 |
SoundbankResource[] getResources(); |
2 | 102 |
|
103 |
/** |
|
104 |
* Obtains a list of instruments contained in this sound bank. |
|
105 |
* |
|
26003
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
106 |
* @return an array of the {@code Instruments} in this {@code SoundBank}. If |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
107 |
* the sound bank contains no instruments, returns an array of |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
108 |
* length 0. |
2 | 109 |
* @see Synthesizer#getLoadedInstruments |
110 |
* @see #getInstrument(Patch) |
|
111 |
*/ |
|
26003
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
112 |
Instrument[] getInstruments(); |
2 | 113 |
|
114 |
/** |
|
26003
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
115 |
* Obtains an {@code Instrument} from the given {@code Patch}. |
2 | 116 |
* |
26003
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
117 |
* @param patch a {@code Patch} object specifying the bank index and |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
118 |
* program change number |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
119 |
* @return the requested instrument, or {@code null} if the sound bank |
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
120 |
* doesn't contain that instrument |
2 | 121 |
* @see #getInstruments |
122 |
* @see Synthesizer#loadInstruments(Soundbank, Patch[]) |
|
123 |
*/ |
|
26003
d630c97424bd
8050852: Javadoc cleanup of javax.sound.midi package
serb
parents:
23010
diff
changeset
|
124 |
Instrument getInstrument(Patch patch); |
2 | 125 |
} |