KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > sound > sampled > spi > MixerProvider


1 /*
2  * @(#)MixerProvider.java 1.18 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.sound.sampled.spi;
9
10 import javax.sound.sampled.Mixer JavaDoc;
11
12 /**
13  * A provider or factory for a particular mixer type.
14  * This mechanism allows the implementation to determine
15  * how resources are managed in creation / management of
16  * a mixer.
17  *
18  * @version 1.18 03/12/19
19  * @author Kara Kytle
20  * @since 1.3
21  */

22 public abstract class MixerProvider {
23
24
25     /**
26      * Indicates whether the mixer provider supports the mixer represented by
27      * the specified mixer info object.
28      * @param info an info object that describes the mixer for which support is queried
29      * @return <code>true</code> if the specified mixer is supported,
30      * otherwise <code>false</code>
31      */

32     public boolean isMixerSupported(Mixer.Info JavaDoc info) {
33
34     Mixer.Info JavaDoc infos[] = getMixerInfo();
35         
36     for(int i=0; i<infos.length; i++){
37         if( info.equals( infos[i] ) ) {
38         return true;
39         }
40     }
41     return false;
42     }
43
44
45     /**
46      * Obtains the set of info objects representing the mixer
47      * or mixers provided by this MixerProvider.
48      * @return set of mixer info objects
49      */

50     public abstract Mixer.Info JavaDoc[] getMixerInfo();
51
52
53     /**
54      * Obtains an instance of the mixer represented by the info object.
55      * @param info an info object that describes the desired mixer
56      * @return mixer instance
57      * @throws IllegalArgumentException if the info object specified does not
58      * match the info object for a mixer supported by this MixerProvider.
59      */

60     public abstract Mixer JavaDoc getMixer(Mixer.Info JavaDoc info);
61 }
62
Popular Tags