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

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: Rebase 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
« no previous file with comments | « chrome/browser/speech/tts_chromeos.cc ('k') | chrome/browser/speech/tts_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/speech/tts_controller.h
diff --git a/chrome/browser/speech/tts_controller.h b/chrome/browser/speech/tts_controller.h
index b6b7372a645b9ca2d1c1bba57ba16da7cf383d39..b55600aa06df417a2146d4232b928c4574ab064e 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_;
« no previous file with comments | « chrome/browser/speech/tts_chromeos.cc ('k') | chrome/browser/speech/tts_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698