upstream version 1.2.2
[debian/freetts] / com / sun / speech / engine / synthesis / text / TextEngineCentral.java
1 /**
2  * Copyright 2001 Sun Microsystems, Inc.
3  * 
4  * See the file "license.terms" for information on usage and
5  * redistribution of this file, and for a DISCLAIMER OF ALL 
6  * WARRANTIES.
7  */
8 package com.sun.speech.engine.synthesis.text;
9
10 import javax.speech.EngineCentral;
11 import javax.speech.EngineModeDesc;
12 import javax.speech.EngineList;
13
14 /**
15  * Supports the JSAPI 1.0 <code>EngineCentral</code> interface for a
16  * synthesizer that sends text to standard out.  Place the following
17  * line into the <code>speech.properties</code> file so that a
18  * <code>TextSynthesizer</code> can be created.
19  *
20  * <pre>
21  * TextSynthEngineCentral=com.sun.speech.engine.synthesis.text.TextEngineCentral
22  * </pre>
23  */
24 public class TextEngineCentral implements EngineCentral {
25     /**
26      * Simple mode.
27      */
28     static private TextSynthesizerModeDesc textModeDesc = 
29             new TextSynthesizerModeDesc();
30
31     /**
32      * Returns a list containing a single reference to a
33      * <code>TextSynthesizerModeDesc</code>
34      * if the required features match those of the
35      * <code>TextSynthesizer</code>.
36      *
37      * @param require the required characteristics; <code>null</code>
38      *   always matches       
39      */
40     public EngineList createEngineList(EngineModeDesc require) {
41         if (require == null || textModeDesc.match(require)) {
42             EngineList el = new EngineList();
43             el.addElement(textModeDesc);
44             return el;
45         }
46         return null;
47     }
48 }