blob: b2e323e719fcfb21ec220bf3b02cdf04cbe7a41e [file] [log] [blame]
Narayan Kamath67ae6bc2011-11-30 14:51:00 +00001// Copyright 2011 Google Inc. All Rights Reserved.
2
3package android.speech.tts;
4
5import android.speech.tts.TextToSpeechService.UtteranceProgressDispatcher;
6
7abstract class PlaybackQueueItem implements Runnable {
8 private final UtteranceProgressDispatcher mDispatcher;
9 private final Object mCallerIdentity;
10
11 PlaybackQueueItem(TextToSpeechService.UtteranceProgressDispatcher dispatcher,
12 Object callerIdentity) {
13 mDispatcher = dispatcher;
14 mCallerIdentity = callerIdentity;
15 }
16
17 Object getCallerIdentity() {
18 return mCallerIdentity;
19 }
20
21 protected UtteranceProgressDispatcher getDispatcher() {
22 return mDispatcher;
23 }
24
Przemyslaw Szczepaniak90d15d22013-06-14 12:02:53 +010025 @Override
Narayan Kamath67ae6bc2011-11-30 14:51:00 +000026 public abstract void run();
Przemyslaw Szczepaniak90d15d22013-06-14 12:02:53 +010027
28 /**
29 * Stop the playback.
30 *
31 * @param errorCode Cause of the stop. Can be either one of the error codes from
32 * {@link android.speech.tts.TextToSpeechClient.Status} or
33 * {@link android.speech.tts.TextToSpeechClient.Status#STOPPED}
34 * if stopped on a client request.
35 */
36 abstract void stop(int errorCode);
Narayan Kamath67ae6bc2011-11-30 14:51:00 +000037}