| 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 #include <sapi.h> | 6 #include <sapi.h> |
| 7 | 7 |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 base::win::ScopedComPtr<ISpVoice> speech_synthesizer_; | 50 base::win::ScopedComPtr<ISpVoice> speech_synthesizer_; |
| 51 | 51 |
| 52 // These apply to the current utterance only. | 52 // These apply to the current utterance only. |
| 53 std::wstring utterance_; | 53 std::wstring utterance_; |
| 54 int utterance_id_; | 54 int utterance_id_; |
| 55 int prefix_len_; | 55 int prefix_len_; |
| 56 ULONG stream_number_; | 56 ULONG stream_number_; |
| 57 int char_position_; | 57 int char_position_; |
| 58 bool paused_; | 58 bool paused_; |
| 59 | 59 |
| 60 friend struct DefaultSingletonTraits<TtsPlatformImplWin>; | 60 friend struct base::DefaultSingletonTraits<TtsPlatformImplWin>; |
| 61 | 61 |
| 62 DISALLOW_COPY_AND_ASSIGN(TtsPlatformImplWin); | 62 DISALLOW_COPY_AND_ASSIGN(TtsPlatformImplWin); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 // static | 65 // static |
| 66 TtsPlatformImpl* TtsPlatformImpl::GetInstance() { | 66 TtsPlatformImpl* TtsPlatformImpl::GetInstance() { |
| 67 return TtsPlatformImplWin::GetInstance(); | 67 return TtsPlatformImplWin::GetInstance(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 bool TtsPlatformImplWin::Speak( | 70 bool TtsPlatformImplWin::Speak( |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 SPFEI(SPEI_SENTENCE_BOUNDARY) | | 241 SPFEI(SPEI_SENTENCE_BOUNDARY) | |
| 242 SPFEI(SPEI_END_INPUT_STREAM); | 242 SPFEI(SPEI_END_INPUT_STREAM); |
| 243 speech_synthesizer_->SetInterest(event_mask, event_mask); | 243 speech_synthesizer_->SetInterest(event_mask, event_mask); |
| 244 speech_synthesizer_->SetNotifyCallbackFunction( | 244 speech_synthesizer_->SetNotifyCallbackFunction( |
| 245 TtsPlatformImplWin::SpeechEventCallback, 0, 0); | 245 TtsPlatformImplWin::SpeechEventCallback, 0, 0); |
| 246 } | 246 } |
| 247 } | 247 } |
| 248 | 248 |
| 249 // static | 249 // static |
| 250 TtsPlatformImplWin* TtsPlatformImplWin::GetInstance() { | 250 TtsPlatformImplWin* TtsPlatformImplWin::GetInstance() { |
| 251 return Singleton<TtsPlatformImplWin, | 251 return base::Singleton<TtsPlatformImplWin, |
| 252 LeakySingletonTraits<TtsPlatformImplWin> >::get(); | 252 base::LeakySingletonTraits<TtsPlatformImplWin>>::get(); |
| 253 } | 253 } |
| 254 | 254 |
| 255 // static | 255 // static |
| 256 void TtsPlatformImplWin::SpeechEventCallback( | 256 void TtsPlatformImplWin::SpeechEventCallback( |
| 257 WPARAM w_param, LPARAM l_param) { | 257 WPARAM w_param, LPARAM l_param) { |
| 258 GetInstance()->OnSpeechEvent(); | 258 GetInstance()->OnSpeechEvent(); |
| 259 } | 259 } |
| OLD | NEW |