diff options
author | chaitanyag@chromium.org <chaitanyag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-09 16:11:57 +0000 |
---|---|---|
committer | chaitanyag@chromium.org <chaitanyag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-09 16:11:57 +0000 |
commit | bc1ce7baad4927e24ff2d9611bb2f7a024b329e1 (patch) | |
tree | 90c86a3106a7d14a257e807317e0ce3b2f4a52c0 | |
parent | 7f76259cd86cc080ac246253e5ff7c8e53eb09fb (diff) | |
download | chromium_src-bc1ce7baad4927e24ff2d9611bb2f7a024b329e1.zip chromium_src-bc1ce7baad4927e24ff2d9611bb2f7a024b329e1.tar.gz chromium_src-bc1ce7baad4927e24ff2d9611bb2f7a024b329e1.tar.bz2 |
Added InitTts function to speech synthesis library
Review URL: http://codereview.chromium.org/2510001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49260 0039d316-1c4b-4281-b951-d872f2087c98
3 files changed, 11 insertions, 0 deletions
diff --git a/chrome/browser/chromeos/cros/mock_speech_synthesis_library.h b/chrome/browser/chromeos/cros/mock_speech_synthesis_library.h index f40b9e7..08cf883 100644 --- a/chrome/browser/chromeos/cros/mock_speech_synthesis_library.h +++ b/chrome/browser/chromeos/cros/mock_speech_synthesis_library.h @@ -18,6 +18,7 @@ class MockSpeechSynthesisLibrary : public SpeechSynthesisLibrary { MOCK_METHOD1(SetSpeakProperties, bool(const char*)); MOCK_METHOD0(StopSpeaking, bool(void)); MOCK_METHOD0(IsSpeaking, bool(void)); + MOCK_METHOD1(InitTts, void(InitStatusCallback)); }; } // namespace chromeos diff --git a/chrome/browser/chromeos/cros/speech_synthesis_library.cc b/chrome/browser/chromeos/cros/speech_synthesis_library.cc index e7478c5..b70a458 100644 --- a/chrome/browser/chromeos/cros/speech_synthesis_library.cc +++ b/chrome/browser/chromeos/cros/speech_synthesis_library.cc @@ -27,4 +27,8 @@ bool SpeechSynthesisLibraryImpl::IsSpeaking() { return chromeos::IsSpeaking(); } +void SpeechSynthesisLibraryImpl::InitTts(InitStatusCallback callback) { + chromeos::InitTts(callback); +} + } // namespace chromeos diff --git a/chrome/browser/chromeos/cros/speech_synthesis_library.h b/chrome/browser/chromeos/cros/speech_synthesis_library.h index f042207..10f2c11 100644 --- a/chrome/browser/chromeos/cros/speech_synthesis_library.h +++ b/chrome/browser/chromeos/cros/speech_synthesis_library.h @@ -12,6 +12,8 @@ namespace chromeos { // This interface defines the interaction with the ChromeOS login library APIs. class SpeechSynthesisLibrary { public: + typedef void(*InitStatusCallback)(bool success); + virtual ~SpeechSynthesisLibrary() {} // Speaks the specified text. virtual bool Speak(const char* text) = 0; @@ -21,6 +23,9 @@ class SpeechSynthesisLibrary { virtual bool StopSpeaking() = 0; // Checks if the engine is currently speaking. virtual bool IsSpeaking() = 0; + // Starts the speech synthesis service and indicates through a callback if + // it started successfully. + virtual void InitTts(InitStatusCallback) = 0; }; // This class handles the interaction with the ChromeOS login library APIs. @@ -34,6 +39,7 @@ class SpeechSynthesisLibraryImpl : public SpeechSynthesisLibrary { virtual bool SetSpeakProperties(const char* props); virtual bool StopSpeaking(); virtual bool IsSpeaking(); + virtual void InitTts(InitStatusCallback); private: DISALLOW_COPY_AND_ASSIGN(SpeechSynthesisLibraryImpl); |