| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * * Redistributions of source code must retain the above copyright | 7 * * Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * * Redistributions in binary form must reproduce the above copyright | 9 * * Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 WebSpeechSynthesizerClientImpl::WebSpeechSynthesizerClientImpl(PlatformSpeechSyn
thesizer* synthesizer, PlatformSpeechSynthesizerClient* client) | 33 WebSpeechSynthesizerClientImpl::WebSpeechSynthesizerClientImpl(PlatformSpeechSyn
thesizer* synthesizer, PlatformSpeechSynthesizerClient* client) |
| 34 : m_synthesizer(synthesizer) | 34 : m_synthesizer(synthesizer) |
| 35 , m_client(client) | 35 , m_client(client) |
| 36 { | 36 { |
| 37 } | 37 } |
| 38 | 38 |
| 39 WebSpeechSynthesizerClientImpl::~WebSpeechSynthesizerClientImpl() | 39 WebSpeechSynthesizerClientImpl::~WebSpeechSynthesizerClientImpl() |
| 40 { | 40 { |
| 41 } | 41 } |
| 42 | 42 |
| 43 void WebSpeechSynthesizerClientImpl::setVoiceList(const blink::WebVector<blink::
WebSpeechSynthesisVoice>& voices) | 43 void WebSpeechSynthesizerClientImpl::setVoiceList(const WebVector<WebSpeechSynth
esisVoice>& voices) |
| 44 { | 44 { |
| 45 HeapVector<Member<PlatformSpeechSynthesisVoice> > outVoices; | 45 HeapVector<Member<PlatformSpeechSynthesisVoice> > outVoices; |
| 46 for (size_t i = 0; i < voices.size(); i++) | 46 for (size_t i = 0; i < voices.size(); i++) |
| 47 outVoices.append(voices[i]); | 47 outVoices.append(voices[i]); |
| 48 m_synthesizer->setVoiceList(outVoices); | 48 m_synthesizer->setVoiceList(outVoices); |
| 49 m_client->voicesDidChange(); | 49 m_client->voicesDidChange(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void WebSpeechSynthesizerClientImpl::didStartSpeaking(const blink::WebSpeechSynt
hesisUtterance& utterance) | 52 void WebSpeechSynthesizerClientImpl::didStartSpeaking(const WebSpeechSynthesisUt
terance& utterance) |
| 53 { | 53 { |
| 54 m_client->didStartSpeaking(utterance); | 54 m_client->didStartSpeaking(utterance); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void WebSpeechSynthesizerClientImpl::didFinishSpeaking(const blink::WebSpeechSyn
thesisUtterance& utterance) | 57 void WebSpeechSynthesizerClientImpl::didFinishSpeaking(const WebSpeechSynthesisU
tterance& utterance) |
| 58 { | 58 { |
| 59 m_client->didFinishSpeaking(utterance); | 59 m_client->didFinishSpeaking(utterance); |
| 60 } | 60 } |
| 61 | 61 |
| 62 void WebSpeechSynthesizerClientImpl::didPauseSpeaking(const blink::WebSpeechSynt
hesisUtterance& utterance) | 62 void WebSpeechSynthesizerClientImpl::didPauseSpeaking(const WebSpeechSynthesisUt
terance& utterance) |
| 63 { | 63 { |
| 64 m_client->didPauseSpeaking(utterance); | 64 m_client->didPauseSpeaking(utterance); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void WebSpeechSynthesizerClientImpl::didResumeSpeaking(const blink::WebSpeechSyn
thesisUtterance& utterance) | 67 void WebSpeechSynthesizerClientImpl::didResumeSpeaking(const WebSpeechSynthesisU
tterance& utterance) |
| 68 { | 68 { |
| 69 m_client->didResumeSpeaking(utterance); | 69 m_client->didResumeSpeaking(utterance); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void WebSpeechSynthesizerClientImpl::speakingErrorOccurred(const blink::WebSpeec
hSynthesisUtterance& utterance) | 72 void WebSpeechSynthesizerClientImpl::speakingErrorOccurred(const WebSpeechSynthe
sisUtterance& utterance) |
| 73 { | 73 { |
| 74 m_client->speakingErrorOccurred(utterance); | 74 m_client->speakingErrorOccurred(utterance); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void WebSpeechSynthesizerClientImpl::wordBoundaryEventOccurred(const blink::WebS
peechSynthesisUtterance& utterance, unsigned charIndex) | 77 void WebSpeechSynthesizerClientImpl::wordBoundaryEventOccurred(const WebSpeechSy
nthesisUtterance& utterance, unsigned charIndex) |
| 78 { | 78 { |
| 79 m_client->boundaryEventOccurred(utterance, SpeechWordBoundary, charIndex); | 79 m_client->boundaryEventOccurred(utterance, SpeechWordBoundary, charIndex); |
| 80 } | 80 } |
| 81 | 81 |
| 82 void WebSpeechSynthesizerClientImpl::sentenceBoundaryEventOccurred(const blink::
WebSpeechSynthesisUtterance& utterance, unsigned charIndex) | 82 void WebSpeechSynthesizerClientImpl::sentenceBoundaryEventOccurred(const WebSpee
chSynthesisUtterance& utterance, unsigned charIndex) |
| 83 { | 83 { |
| 84 m_client->boundaryEventOccurred(utterance, SpeechSentenceBoundary, charIndex
); | 84 m_client->boundaryEventOccurred(utterance, SpeechSentenceBoundary, charIndex
); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void WebSpeechSynthesizerClientImpl::trace(Visitor* visitor) | 87 void WebSpeechSynthesizerClientImpl::trace(Visitor* visitor) |
| 88 { | 88 { |
| 89 visitor->trace(m_synthesizer); | 89 visitor->trace(m_synthesizer); |
| 90 visitor->trace(m_client); | 90 visitor->trace(m_client); |
| 91 } | 91 } |
| 92 | 92 |
| 93 } // namespace blink | 93 } // namespace blink |
| OLD | NEW |