OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 /** | 5 /** |
6 * @fileoverview Provides output services for ChromeVox. | 6 * @fileoverview Provides output services for ChromeVox. |
7 */ | 7 */ |
8 | 8 |
9 goog.provide('Output'); | 9 goog.provide('Output'); |
10 goog.provide('Output.EventType'); | 10 goog.provide('Output.EventType'); |
11 | 11 |
12 goog.require('AutomationUtil.Dir'); | 12 goog.require('AutomationUtil.Dir'); |
13 goog.require('EarconEngine'); | 13 goog.require('EarconEngine'); |
14 goog.require('Panel'); | |
14 goog.require('cursors.Cursor'); | 15 goog.require('cursors.Cursor'); |
15 goog.require('cursors.Range'); | 16 goog.require('cursors.Range'); |
16 goog.require('cursors.Unit'); | 17 goog.require('cursors.Unit'); |
17 goog.require('cvox.AbstractEarcons'); | 18 goog.require('cvox.AbstractEarcons'); |
18 goog.require('cvox.NavBraille'); | 19 goog.require('cvox.NavBraille'); |
19 goog.require('cvox.Spannable'); | 20 goog.require('cvox.Spannable'); |
20 goog.require('cvox.ValueSelectionSpan'); | 21 goog.require('cvox.ValueSelectionSpan'); |
21 goog.require('cvox.ValueSpan'); | 22 goog.require('cvox.ValueSpan'); |
22 goog.require('goog.i18n.MessageFormat'); | 23 goog.require('goog.i18n.MessageFormat'); |
23 | 24 |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
701 } | 702 } |
702 }; | 703 }; |
703 }.bind(this)()); | 704 }.bind(this)()); |
704 | 705 |
705 if (this.speechEndCallback_ && i == a.length - 1) | 706 if (this.speechEndCallback_ && i == a.length - 1) |
706 this.speechProperties_['endCallback'] = this.speechEndCallback_; | 707 this.speechProperties_['endCallback'] = this.speechEndCallback_; |
707 else | 708 else |
708 this.speechProperties_['endCallback'] = null; | 709 this.speechProperties_['endCallback'] = null; |
709 cvox.ChromeVox.tts.speak( | 710 cvox.ChromeVox.tts.speak( |
710 buff.toString(), queueMode, this.speechProperties_); | 711 buff.toString(), queueMode, this.speechProperties_); |
712 if (queueMode == cvox.QueueMode.FLUSH) | |
713 (new PanelCommand(PanelCommandType.CLEAR_SPEECH)).send(); | |
714 if (this.speechProperties_.relativePitch == | |
715 cvox.AbstractTts.PERSONALITY_ANNOTATION.relativePitch) { | |
716 (new PanelCommand( | |
717 PanelCommandType.ADD_ANNOTATION_SPEECH, | |
718 buff.toString())).send(); | |
719 } else { | |
720 (new PanelCommand( | |
721 PanelCommandType.ADD_NORMAL_SPEECH, | |
722 buff.toString())).send(); | |
723 } | |
Peter Lundblad
2015/11/06 15:00:58
Why is this needed here in addition to background_
dmazzoni
2015/11/06 21:01:00
I was thinking we could provide more detailed info
| |
711 queueMode = cvox.QueueMode.QUEUE; | 724 queueMode = cvox.QueueMode.QUEUE; |
712 }.bind(this)); | 725 }.bind(this)); |
713 | 726 |
714 // Braille. | 727 // Braille. |
715 if (this.brailleBuffer_.length) { | 728 if (this.brailleBuffer_.length) { |
716 var buff = this.createBrailleOutput_(); | 729 var buff = this.createBrailleOutput_(); |
717 var selSpan = | 730 var selSpan = |
718 buff.getSpanInstanceOf(Output.SelectionSpan); | 731 buff.getSpanInstanceOf(Output.SelectionSpan); |
719 var startIndex = -1, endIndex = -1; | 732 var startIndex = -1, endIndex = -1; |
720 if (selSpan) { | 733 if (selSpan) { |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1325 elem.end); | 1338 elem.end); |
1326 }); | 1339 }); |
1327 spansToRemove.forEach(result.removeSpan.bind(result)); | 1340 spansToRemove.forEach(result.removeSpan.bind(result)); |
1328 separator = Output.SPACE; | 1341 separator = Output.SPACE; |
1329 }); | 1342 }); |
1330 return result; | 1343 return result; |
1331 } | 1344 } |
1332 }; | 1345 }; |
1333 | 1346 |
1334 }); // goog.scope | 1347 }); // goog.scope |
OLD | NEW |