|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.speech.synthesis.SynthesizerQueueItem com.sun.speech.engine.synthesis.BaseSynthesizerQueueItem
Extends the JSAPI 1.0 SynthesizerQueueItem
with handling
for JSML, generation of engine-specific text, and other features.
Field Summary | |
protected static int |
itemNumber
Global count of queue items used for debug. |
protected BaseSynthesizer |
synth
Synthesizer that has queued this item. |
protected int |
thisItemNumber
Count for this item used for debug. |
Fields inherited from class javax.speech.synthesis.SynthesizerQueueItem |
listener, plainText, source, text |
Constructor Summary | |
BaseSynthesizerQueueItem()
Class constructor. |
Method Summary | |
void |
cancelled()
indicate that this item has been cancelled |
void |
completed()
indicate that this item has been completed |
void |
dispatchSpeechEvent(javax.speech.SpeechEvent event)
Dispatches a SpeechEvent .
|
void |
fireMarkerReached(javax.speech.synthesis.SpeakableEvent event)
Utility function that sends a MARKER_REACHED event
to all speakable listeners. |
void |
fireSpeakableCancelled(javax.speech.synthesis.SpeakableEvent event)
Utility function that sends a SPEAKABLE_CANCELLED event
to all speakable listeners. |
void |
fireSpeakableEnded(javax.speech.synthesis.SpeakableEvent event)
Utility function that sends a SPEAKABLE_ENDED event
to all speakable listeners. |
void |
fireSpeakablePaused(javax.speech.synthesis.SpeakableEvent event)
Utility function that sends a SPEAKABLE_PAUSED event
to all speakable listeners. |
void |
fireSpeakableResumed(javax.speech.synthesis.SpeakableEvent event)
Utility function that sends a SPEAKABLE_RESUMED event
to all speakable listeners. |
void |
fireSpeakableStarted(javax.speech.synthesis.SpeakableEvent event)
Utility function that sends a SPEAKABLE_STARTED event
to all speakable listeners. |
void |
fireTopOfQueue(javax.speech.synthesis.SpeakableEvent event)
Utility function that sends a TOP_OF_QUEUE event
to all speakable listeners. |
void |
fireWordStarted(javax.speech.synthesis.SpeakableEvent event)
Utility function that sends a WORD_STARTED event
to all speakable listeners. |
protected org.w3c.dom.Document |
getDocument()
Gets the DOM document for this object. |
int |
getItemNumber()
Gets the item number for debug purposes only. |
protected boolean |
isCancelled()
determines if this queue item has been cancelled |
boolean |
isCompleted()
returns true if this queue item has been processed. |
void |
postMarkerReached(java.lang.String text,
int markerType)
Utility function that generates a MARKER_REACHED event and posts it
to the event queue. |
void |
postSpeakableCancelled()
Utility function that generates a SPEAKABLE_CANCELLED event and posts it
to the event queue. |
void |
postSpeakableEnded()
Utility function that generates a SPEAKABLE_ENDED event and posts it
to the event queue. |
void |
postSpeakablePaused()
Utility function that generates a SPEAKABLE_PAUSED event and posts it
to the event queue. |
void |
postSpeakableResumed()
Utility function that generates a SPEAKABLE_RESUMED event and posts it
to the event queue. |
void |
postSpeakableStarted()
Utility function that generates a SPEAKABLE_STARTED event and posts it
to the event queue. |
void |
postTopOfQueue()
Utility function that generates a TOP_OF_QUEUE event and posts it
to the event queue. |
void |
postWordStarted(java.lang.String text,
int wordStart,
int wordEnd)
Utility function that generates a WORD_STARTED event and posts it
to the event queue. |
protected void |
setData(BaseSynthesizer synth,
javax.speech.synthesis.Speakable source,
javax.speech.synthesis.SpeakableListener listener)
Sets queue item data with a Speakable source. |
protected void |
setData(BaseSynthesizer synth,
java.lang.String source,
boolean plainText,
javax.speech.synthesis.SpeakableListener listener)
Sets queue item data with a String source that is
either plain text or JSML. |
protected void |
setData(BaseSynthesizer synth,
java.net.URL source,
javax.speech.synthesis.SpeakableListener listener)
Sets queue item data with a URL source. |
void |
started()
indicate that this item has been started |
boolean |
waitCompleted()
wait for this queue item to be completed |
Methods inherited from class javax.speech.synthesis.SynthesizerQueueItem |
getSource, getSpeakableListener, getText, isPlainText |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static int itemNumber
protected int thisItemNumber
protected BaseSynthesizer synth
Synthesizer
that has queued this item.
Constructor Detail |
public BaseSynthesizerQueueItem()
Method Detail |
protected void setData(BaseSynthesizer synth, javax.speech.synthesis.Speakable source, javax.speech.synthesis.SpeakableListener listener) throws javax.speech.synthesis.JSMLException
Speakable
source.
synth
- the synthesizersource
- the Speakable
listener
- the SpeakableListener
to be
notified as this object is processed
javax.speech.synthesis.JSMLException
- if the source
contains JSML errorsprotected void setData(BaseSynthesizer synth, java.lang.String source, boolean plainText, javax.speech.synthesis.SpeakableListener listener) throws javax.speech.synthesis.JSMLException
String
source that is
either plain text or JSML.
synth
- the synthesizersource
- the textplainText
- true
only if the
source
is plain textlistener
- the SpeakableListener
to be
notified as this object is processed
javax.speech.synthesis.JSMLException
- if the source
contains JSML errorsprotected void setData(BaseSynthesizer synth, java.net.URL source, javax.speech.synthesis.SpeakableListener listener) throws javax.speech.synthesis.JSMLException, java.io.IOException
URL
source.
synth
- the synthesizersource
- the URL
containing JSML textlistener
- the SpeakableListener
to be
notified as this object is processed
javax.speech.synthesis.JSMLException
- if the source
contains JSML errors
java.io.IOException
- if there are problems working with the URL.protected org.w3c.dom.Document getDocument()
protected boolean isCancelled()
true
if this item has been cancelled;
otherwise false
public boolean isCompleted()
public boolean waitCompleted()
public void cancelled()
public void completed()
public void started()
public int getItemNumber()
public void postMarkerReached(java.lang.String text, int markerType)
MARKER_REACHED
event and posts it
to the event queue. Eventually
fireMarkerReached
will be called
by dispatchSpeechEvent
as a result
of this action.
text
- the text of the markermarkerType
- the type of markerSpeakableEvent.getMarkerType()
,
fireMarkerReached(javax.speech.synthesis.SpeakableEvent)
,
dispatchSpeechEvent(javax.speech.SpeechEvent)
public void fireMarkerReached(javax.speech.synthesis.SpeakableEvent event)
MARKER_REACHED
event
to all speakable listeners.
event
- the MARKER_REACHED
eventpostMarkerReached(java.lang.String, int)
public void postSpeakableCancelled()
SPEAKABLE_CANCELLED
event and posts it
to the event queue. Eventually
fireSpeakableCancelled
will be called
by dispatchSpeechEvent
as a result
of this action.
fireSpeakableCancelled(javax.speech.synthesis.SpeakableEvent)
,
dispatchSpeechEvent(javax.speech.SpeechEvent)
public void fireSpeakableCancelled(javax.speech.synthesis.SpeakableEvent event)
SPEAKABLE_CANCELLED
event
to all speakable listeners.
event
- the SPEAKABLE_CANCELLED
eventpostSpeakableCancelled()
public void postSpeakableEnded()
SPEAKABLE_ENDED
event and posts it
to the event queue. Eventually
fireSpeakableEnded
will be called
by dispatchSpeechEvent
as a result
of this action.
fireSpeakableEnded(javax.speech.synthesis.SpeakableEvent)
,
dispatchSpeechEvent(javax.speech.SpeechEvent)
public void fireSpeakableEnded(javax.speech.synthesis.SpeakableEvent event)
SPEAKABLE_ENDED
event
to all speakable listeners.
event
- the SPEAKABLE_ENDED
eventpostSpeakableEnded()
public void postSpeakablePaused()
SPEAKABLE_PAUSED
event and posts it
to the event queue. Eventually
fireSpeakablePaused
will be called
by dispatchSpeechEvent
as a result
of this action.
fireSpeakablePaused(javax.speech.synthesis.SpeakableEvent)
,
dispatchSpeechEvent(javax.speech.SpeechEvent)
public void fireSpeakablePaused(javax.speech.synthesis.SpeakableEvent event)
SPEAKABLE_PAUSED
event
to all speakable listeners.
event
- the SPEAKABLE_PAUSED
eventpostSpeakablePaused()
public void postSpeakableResumed()
SPEAKABLE_RESUMED
event and posts it
to the event queue. Eventually
fireSpeakableResumed
will be called
by dispatchSpeechEvent
as a result
of this action.
fireSpeakableResumed(javax.speech.synthesis.SpeakableEvent)
,
dispatchSpeechEvent(javax.speech.SpeechEvent)
public void fireSpeakableResumed(javax.speech.synthesis.SpeakableEvent event)
SPEAKABLE_RESUMED
event
to all speakable listeners.
event
- the SPEAKABLE_RESUMED
eventpostSpeakableResumed()
public void postSpeakableStarted()
SPEAKABLE_STARTED
event and posts it
to the event queue. Eventually
fireSpeakableStarted
will be called
by dispatchSpeechEvent
as a result
of this action.
fireSpeakableStarted(javax.speech.synthesis.SpeakableEvent)
,
dispatchSpeechEvent(javax.speech.SpeechEvent)
public void fireSpeakableStarted(javax.speech.synthesis.SpeakableEvent event)
SPEAKABLE_STARTED
event
to all speakable listeners.
event
- the SPEAKABLE_STARTED
eventpostSpeakableStarted()
public void postTopOfQueue()
TOP_OF_QUEUE
event and posts it
to the event queue. Eventually
fireTopOfQueue
will be called
by dispatchSpeechEvent
as a result
of this action.
fireTopOfQueue(javax.speech.synthesis.SpeakableEvent)
,
dispatchSpeechEvent(javax.speech.SpeechEvent)
public void fireTopOfQueue(javax.speech.synthesis.SpeakableEvent event)
TOP_OF_QUEUE
event
to all speakable listeners.
event
- the TOP_OF_QUEUE
eventpostTopOfQueue()
public void postWordStarted(java.lang.String text, int wordStart, int wordEnd)
WORD_STARTED
event and posts it
to the event queue. Eventually
fireWordStarted
will be called
by dispatchSpeechEvent
as a result
of this action.
fireWordStarted(javax.speech.synthesis.SpeakableEvent)
,
dispatchSpeechEvent(javax.speech.SpeechEvent)
public void fireWordStarted(javax.speech.synthesis.SpeakableEvent event)
WORD_STARTED
event
to all speakable listeners.
event
- the WORD_STARTED
eventpostWordStarted(java.lang.String, int, int)
public void dispatchSpeechEvent(javax.speech.SpeechEvent event)
SpeechEvent
.
The dispatcher should notify all EngineListeners
from this method. The SpeechEvent
was added
via the various post methods of this class.
dispatchSpeechEvent
in interface SpeechEventDispatcher
event
- the SpeechEvent
to dispatchpostMarkerReached(java.lang.String, int)
,
postSpeakableCancelled()
,
postSpeakableEnded()
,
postSpeakablePaused()
,
postSpeakableResumed()
,
postSpeakableStarted()
,
postTopOfQueue()
,
postWordStarted(java.lang.String, int, int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |