001/**
002 * Copyright 2001 Sun Microsystems, Inc.
003 * 
004 * See the file "license.terms" for information on usage and
005 * redistribution of this file, and for a DISCLAIMER OF ALL 
006 * WARRANTIES.
007 */
008package com.sun.speech.engine.synthesis.text;
009
010import javax.speech.EngineCentral;
011import javax.speech.EngineModeDesc;
012import javax.speech.EngineList;
013
014/**
015 * Supports the JSAPI 1.0 <code>EngineCentral</code> interface for a
016 * synthesizer that sends text to standard out.  Place the following
017 * line into the <code>speech.properties</code> file so that a
018 * <code>TextSynthesizer</code> can be created.
019 *
020 * <pre>
021 * TextSynthEngineCentral=com.sun.speech.engine.synthesis.text.TextEngineCentral
022 * </pre>
023 */
024public class TextEngineCentral implements EngineCentral {
025    /**
026     * Simple mode.
027     */
028    static private TextSynthesizerModeDesc textModeDesc = 
029            new TextSynthesizerModeDesc();
030
031    /**
032     * Returns a list containing a single reference to a
033     * <code>TextSynthesizerModeDesc</code>
034     * if the required features match those of the
035     * <code>TextSynthesizer</code>.
036     *
037     * @param require the required characteristics; <code>null</code>
038     *   always matches       
039     */
040    public EngineList createEngineList(EngineModeDesc require) {
041        if (require == null || textModeDesc.match(require)) {
042            EngineList el = new EngineList();
043            el.addElement(textModeDesc);
044            return el;
045        }
046        return null;
047    }
048}