OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <math.h> | 5 #include <math.h> |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/leak_annotations.h" | 10 #include "base/debug/leak_annotations.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 struct SPDChromeVoice { | 27 struct SPDChromeVoice { |
28 std::string name; | 28 std::string name; |
29 std::string module; | 29 std::string module; |
30 }; | 30 }; |
31 | 31 |
32 } // namespace | 32 } // namespace |
33 | 33 |
34 class TtsPlatformImplLinux : public TtsPlatformImpl { | 34 class TtsPlatformImplLinux : public TtsPlatformImpl { |
35 public: | 35 public: |
36 virtual bool PlatformImplAvailable() override; | 36 bool PlatformImplAvailable() override; |
37 virtual bool Speak( | 37 bool Speak(int utterance_id, |
38 int utterance_id, | 38 const std::string& utterance, |
39 const std::string& utterance, | 39 const std::string& lang, |
40 const std::string& lang, | 40 const VoiceData& voice, |
41 const VoiceData& voice, | 41 const UtteranceContinuousParameters& params) override; |
42 const UtteranceContinuousParameters& params) override; | 42 bool StopSpeaking() override; |
43 virtual bool StopSpeaking() override; | 43 void Pause() override; |
44 virtual void Pause() override; | 44 void Resume() override; |
45 virtual void Resume() override; | 45 bool IsSpeaking() override; |
46 virtual bool IsSpeaking() override; | 46 void GetVoices(std::vector<VoiceData>* out_voices) override; |
47 virtual void GetVoices(std::vector<VoiceData>* out_voices) override; | |
48 | 47 |
49 void OnSpeechEvent(SPDNotificationType type); | 48 void OnSpeechEvent(SPDNotificationType type); |
50 | 49 |
51 // Get the single instance of this class. | 50 // Get the single instance of this class. |
52 static TtsPlatformImplLinux* GetInstance(); | 51 static TtsPlatformImplLinux* GetInstance(); |
53 | 52 |
54 private: | 53 private: |
55 TtsPlatformImplLinux(); | 54 TtsPlatformImplLinux(); |
56 virtual ~TtsPlatformImplLinux(); | 55 ~TtsPlatformImplLinux() override; |
57 | 56 |
58 // Initiate the connection with the speech dispatcher. | 57 // Initiate the connection with the speech dispatcher. |
59 void Initialize(); | 58 void Initialize(); |
60 | 59 |
61 // Resets the connection with speech dispatcher. | 60 // Resets the connection with speech dispatcher. |
62 void Reset(); | 61 void Reset(); |
63 | 62 |
64 static void NotificationCallback(size_t msg_id, | 63 static void NotificationCallback(size_t msg_id, |
65 size_t client_id, | 64 size_t client_id, |
66 SPDNotificationType type); | 65 SPDNotificationType type); |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 // static | 342 // static |
344 TtsPlatformImplLinux* TtsPlatformImplLinux::GetInstance() { | 343 TtsPlatformImplLinux* TtsPlatformImplLinux::GetInstance() { |
345 return Singleton<TtsPlatformImplLinux, | 344 return Singleton<TtsPlatformImplLinux, |
346 LeakySingletonTraits<TtsPlatformImplLinux> >::get(); | 345 LeakySingletonTraits<TtsPlatformImplLinux> >::get(); |
347 } | 346 } |
348 | 347 |
349 // static | 348 // static |
350 TtsPlatformImpl* TtsPlatformImpl::GetInstance() { | 349 TtsPlatformImpl* TtsPlatformImpl::GetInstance() { |
351 return TtsPlatformImplLinux::GetInstance(); | 350 return TtsPlatformImplLinux::GetInstance(); |
352 } | 351 } |
OLD | NEW |