diff options
Diffstat (limited to 'chrome/browser/speech/tts_controller.h')
-rw-r--r-- | chrome/browser/speech/tts_controller.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/chrome/browser/speech/tts_controller.h b/chrome/browser/speech/tts_controller.h index b6b7372..b55600a 100644 --- a/chrome/browser/speech/tts_controller.h +++ b/chrome/browser/speech/tts_controller.h @@ -31,7 +31,9 @@ enum TtsEventType { TTS_EVENT_MARKER, TTS_EVENT_INTERRUPTED, TTS_EVENT_CANCELLED, - TTS_EVENT_ERROR + TTS_EVENT_ERROR, + TTS_EVENT_PAUSE, + TTS_EVENT_RESUME }; enum TtsGenderType { @@ -251,9 +253,17 @@ class TtsController { // immediately. void SpeakOrEnqueue(Utterance* utterance); - // Stop all utterances and flush the queue. + // Stop all utterances and flush the queue. Implies leaving pause mode + // as well. void Stop(); + // Pause the speech queue. Some engines may support pausing in the middle + // of an utterance. + void Pause(); + + // Resume speaking. + void Resume(); + // Handle events received from the speech engine. Events are forwarded to // the callback function, and in addition, completion and error events // trigger finishing the current utterance and starting the next one, if @@ -317,6 +327,9 @@ class TtsController { // The current utterance being spoken. Utterance* current_utterance_; + // Whether the queue is paused or not. + bool paused_; + // A queue of utterances to speak after the current one finishes. std::queue<Utterance*> utterance_queue_; |