Merge from mainline.
[official-gcc.git] / libjava / classpath / javax / sound / sampled / Mixer.java
blobff657cfd1dc6d2d0dfb3d13e84b3cf0659cbce0d
1 /* Mixers
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.sampled;
41 /**
42 * A Mixer is a Line which itself holds multiple lines.
43 * @since 1.3
45 public interface Mixer extends Line
47 /**
48 * An Info object describes a mixer.
49 * @since 1.3
51 class Info
53 private String name;
54 private String description;
55 private String vendor;
56 private String version;
58 /**
59 * Create a new mixer description.
60 * @param name the name of the mixer
61 * @param vendor the vendor
62 * @param desc a descriptive string
63 * @param vers the mixer's version
65 protected Info(String name, String vendor, String desc, String vers)
67 this.name = name;
68 this.description = desc;
69 this.vendor = vendor;
70 this.version = vers;
73 public final boolean equals(Object o)
75 return super.equals(o);
78 public final int hashCode()
80 return super.hashCode();
83 /**
84 * Return the name of the mixer.
86 public final String getName()
88 return name;
91 /**
92 * Return the mixer's description.
94 public final String getDescription()
96 return description;
99 /**
100 * Return the mixer's vendor.
102 public final String getVendor()
104 return vendor;
108 * Return the mixer's version.
110 public final String getVersion()
112 return version;
115 public final String toString()
117 return ("name=" + name + "; description=" + description
118 + "; vendor=" + vendor + "; version=" + version);
123 * Return a Line associated with this Mixer, given its description.
124 * @param info the description of the line to find
125 * @return the corresponding Line
126 * @throws LineUnavailableException if no Line matching the description
127 * exists in this Mixer
129 Line getLine(Line.Info info) throws LineUnavailableException;
132 * Return the number of lines matching this description.
133 * @param info the description of the lines to find.
135 int getMaxLines(Line.Info info);
138 * Return an Info object describing this Mixer.
140 Info getMixerInfo();
143 * Return an array of Info objects describing all the source lines
144 * available in this Mixer.
146 Line.Info[] getSourceLineInfo();
149 * Return an array of Info objects describing all the source lines
150 * available in this Mixer, which match the provided decsription.
151 * @param info the description of the source lines to find
153 Line.Info[] getSourceLineInfo(Line.Info info);
156 * Return an array of all the source lines available in this Mixer.
158 Line[] getSourceLines();
161 * Return an array of Info objects describing all the target lines
162 * available in this Mixer.
164 Line.Info[] getTargetLineInfo();
167 * Return an array of Info objects describing all the target lines
168 * available in this Mixer, which match the provided decsription.
169 * @param info the description of the target lines to find
171 Line.Info[] getTargetLineInfo(Line.Info info);
174 * Return an array of all the target lines available in this Mixer.
176 Line[] getTargetLines();
179 * Return true if a Line matching the given description is supported
180 * by this Mixer, false otherwise.
181 * @param info the description of the line to find
183 boolean isLineSupported(Line.Info info);
186 * Return true if this Mixer supports synchronization of the given set
187 * of lines.
188 * @param lines the lines to check
189 * @param sync true if the synchronization must be accurate at all times
191 boolean isSynchronizationSupported(Line[] lines, boolean sync);
194 * Start synchronization on the given set of lines.
195 * @param lines the lines to synchronize, or null for all the lines
196 * @param sync true if the synchronization must be accurate at all times
197 * @throws IllegalArgumentException if the lines cannot be synchronized
199 void synchronize(Line[] lines, boolean sync);
202 * Stop synchronization for the given set of lines.
203 * @param lines the lines to unsynchronize, or null for all the lines
205 void unsynchronize(Line[] lines);