| 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 controller->OnTtsEvent( | 213 controller->OnTtsEvent( |
| 214 utterance_id_, TTS_EVENT_WORD, char_position_, | 214 utterance_id_, TTS_EVENT_WORD, char_position_, |
| 215 std::string()); | 215 std::string()); |
| 216 break; | 216 break; |
| 217 case SPEI_SENTENCE_BOUNDARY: | 217 case SPEI_SENTENCE_BOUNDARY: |
| 218 char_position_ = static_cast<ULONG>(event.lParam) - prefix_len_; | 218 char_position_ = static_cast<ULONG>(event.lParam) - prefix_len_; |
| 219 controller->OnTtsEvent( | 219 controller->OnTtsEvent( |
| 220 utterance_id_, TTS_EVENT_SENTENCE, char_position_, | 220 utterance_id_, TTS_EVENT_SENTENCE, char_position_, |
| 221 std::string()); | 221 std::string()); |
| 222 break; | 222 break; |
| 223 default: |
| 224 break; |
| 223 } | 225 } |
| 224 } | 226 } |
| 225 } | 227 } |
| 226 | 228 |
| 227 TtsPlatformImplWin::TtsPlatformImplWin() | 229 TtsPlatformImplWin::TtsPlatformImplWin() |
| 228 : utterance_id_(0), | 230 : utterance_id_(0), |
| 229 prefix_len_(0), | 231 prefix_len_(0), |
| 230 stream_number_(0), | 232 stream_number_(0), |
| 231 char_position_(0), | 233 char_position_(0), |
| 232 paused_(false) { | 234 paused_(false) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 248 TtsPlatformImplWin* TtsPlatformImplWin::GetInstance() { | 250 TtsPlatformImplWin* TtsPlatformImplWin::GetInstance() { |
| 249 return Singleton<TtsPlatformImplWin, | 251 return Singleton<TtsPlatformImplWin, |
| 250 LeakySingletonTraits<TtsPlatformImplWin> >::get(); | 252 LeakySingletonTraits<TtsPlatformImplWin> >::get(); |
| 251 } | 253 } |
| 252 | 254 |
| 253 // static | 255 // static |
| 254 void TtsPlatformImplWin::SpeechEventCallback( | 256 void TtsPlatformImplWin::SpeechEventCallback( |
| 255 WPARAM w_param, LPARAM l_param) { | 257 WPARAM w_param, LPARAM l_param) { |
| 256 GetInstance()->OnSpeechEvent(); | 258 GetInstance()->OnSpeechEvent(); |
| 257 } | 259 } |
| OLD | NEW |