Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / libjava / classpath / javax / sound / midi / Synthesizer.java
blob22e5e9256f4deb54f61e0ec64618f072fda4bda7
1 /* Synthesizer.java -- A MIDI audio synthesizer interface
2 Copyright (C) 2005 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301 USA.
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
39 package javax.sound.midi;
41 /**
42 * Interface for MIDI audio synthesizer devices.
44 * @author Anthony Green (green@redhat.com)
45 * @since 1.3
48 public interface Synthesizer extends MidiDevice
50 /**
51 * Get the maximum number of notes that the synth can play at once.
53 * @return the maximum number of notes that the synth can play at once
55 public int getMaxPolyphony();
57 /**
58 * The processing latency for this synth in microseconds.
60 * @return the processing latency for this synth in microseconds
62 public long getLatency();
64 /**
65 * Get the set of MIDI channels controlled by this synth.
67 * @return an array of MIDI channels controlled by this synth
69 public MidiChannel[] getChannels();
71 /**
72 * Get the current status for the voices produced by this synth.
74 * @return an array of VoiceStatus objects, getMaxPolyphony() in length
76 public VoiceStatus[] getVoiceStatus();
78 /**
79 * Returns true is this synth is capable of loading soundbank.
81 * @param soundbank the Soundbank to examine
82 * @return true if soundbank can be loaded, false otherwise
84 public boolean isSoundbankSupported(Soundbank soundbank);
86 /**
87 * Load an instrument into this synth. The instrument must be part of a
88 * supported soundbank.
90 * @param instrument the Instrument to load
91 * @return true if the instrument was loaded and false otherwise
92 * @throws IllegalArgumentException if this synth doesn't support instrument
94 public boolean loadInstrument(Instrument instrument);
96 /**
97 * Unload an instrument from this synth.
99 * @param instrument the Instrument to unload
100 * @throws IllegalArgumentException if this synth doesn't support instrument
102 public void unloadInstrument(Instrument instrument);
105 * Move an intrument from one place to another. The instrument at the
106 * target location is unloaded.
108 * @param from the instrument source
109 * @param to the instrument target
110 * @return if from was remapped
111 * @throws IllegalArgumentException
113 public boolean remapInstrument(Instrument from, Instrument to);
116 * Get the default Soundbank for this synth. Return null if there is no
117 * default.
119 * @return the default Soundbank for this synth, possibly null.
121 public Soundbank getDefaultSoundbank();
124 * Get an array containing all instruments in this synthesizer.
126 * @return an array containing all instruments in this synthesizer
128 public Instrument[] getAvailableInstruments();
131 * Get an array containing all instruments loaded in this synthesizer.
133 * @return an array containing all instruments loaded in this synthesizer
135 public Instrument[] getLoadedInstruments();
138 * Load all soundbank instruments into this synthesizer.
140 * @param soundbank the Soundbank from which to load instruments
141 * @return true if all instruments were loaded, false othewise
142 * @throws IllegalArgumentException if the soundbank isn't supported by this
144 public boolean loadAllInstruments(Soundbank soundbank);
147 * Unload all soundbank instruments from this synthesizer.
149 * @param soundbank the Soundbank containing the instruments to unload
150 * @throws IllegalArgumentException if the soundbank isn't supported by this
152 public void unloadAllInstruments(Soundbank soundbank);
155 * Load a subset of soundbank instruments into this synthesizer. The
156 * subset is defined by an array of Patch objects.
158 * @param soundbank the Soundbank from which to load instruments
159 * @param patchList the array of patches identifying instruments to load
160 * @return true if instruments were loaded, false otherwise
161 * @throws IllegalArgumentException if the soundbank isn't supported by this
163 public boolean loadInstruments(Soundbank soundbank, Patch[] patchList);
166 * Unload a subset of soundbank instruments from this synthesizer.
168 * @param soundbank the Soundbank containing the instruments to unload
169 * @param patchList the array of patches identifying instruments to unload
170 * @throws IllegalArgumentException if the soundbank isn't supported by this
172 public void unloadInstruments(Soundbank soundbank, Patch[] patchList);