Methods Summary |
---|
public void | enqueue(PlaybackQueueItem item)
try {
mQueue.put(item);
} catch (InterruptedException ie) {
// This exception will never be thrown, since we allow our queue
// to be have an unbounded size. put() will therefore never block.
}
|
public boolean | isSpeaking()
return (mQueue.peek() != null) || (mCurrentWorkItem != null);
|
public void | quit()Shut down the audio playback thread.
removeAllMessages();
stop(mCurrentWorkItem);
mHandlerThread.interrupt();
|
private void | removeAllMessages()
mQueue.clear();
|
private void | removeWorkItemsFor(java.lang.Object callerIdentity)
Iterator<PlaybackQueueItem> it = mQueue.iterator();
while (it.hasNext()) {
final PlaybackQueueItem item = it.next();
if (item.getCallerIdentity() == callerIdentity) {
it.remove();
}
}
|
public void | start()
mHandlerThread.start();
|
private void | stop(PlaybackQueueItem item)
if (item == null) {
return;
}
item.stop(TextToSpeech.STOPPED);
|
public void | stop()
if (DBG) Log.d(TAG, "Stopping all items");
removeAllMessages();
stop(mCurrentWorkItem);
|
public void | stopForApp(java.lang.Object callerIdentity)
if (DBG) Log.d(TAG, "Removing all callback items for : " + callerIdentity);
removeWorkItemsFor(callerIdentity);
final PlaybackQueueItem current = mCurrentWorkItem;
if (current != null && (current.getCallerIdentity() == callerIdentity)) {
stop(current);
}
|