Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Unified Diff: chrome/browser/speech/tts_controller.h

Issue 15108002: Add Pause and Resume to Web TTS & Extension TTS APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/speech/tts_controller.h
diff --git a/chrome/browser/speech/tts_controller.h b/chrome/browser/speech/tts_controller.h
index 53ca53744a227a120c34eb35416c2b089c0fd2ca..28bb90c4c8ad968525e68813f70699c899a734bb 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 {
@@ -243,9 +245,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
@@ -299,6 +309,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_;

Powered by Google App Engine
This is Rietveld 408576698