167ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamath// Copyright 2011 Google Inc. All Rights Reserved.
267ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamath
367ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamathpackage android.speech.tts;
467ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamath
567ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamathimport android.speech.tts.TextToSpeechService.UtteranceProgressDispatcher;
667ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamath
767ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamathabstract class PlaybackQueueItem implements Runnable {
867ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamath    private final UtteranceProgressDispatcher mDispatcher;
967ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamath    private final Object mCallerIdentity;
1067ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamath
1167ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamath    PlaybackQueueItem(TextToSpeechService.UtteranceProgressDispatcher dispatcher,
1267ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamath            Object callerIdentity) {
1367ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamath        mDispatcher = dispatcher;
1467ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamath        mCallerIdentity = callerIdentity;
1567ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamath    }
1667ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamath
1767ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamath    Object getCallerIdentity() {
1867ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamath        return mCallerIdentity;
1967ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamath    }
2067ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamath
2167ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamath    protected UtteranceProgressDispatcher getDispatcher() {
2267ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamath        return mDispatcher;
2367ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamath    }
2467ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamath
2567ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamath    public abstract void run();
2667ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamath    abstract void stop(boolean isError);
2767ae6bc83cf2b30b0c61b9ebba5fed7a0038549cNarayan Kamath}
28