| Index: chrome/browser/resources/access_chromevox/audio/common/remote_tts_manager.js
|
| ===================================================================
|
| --- chrome/browser/resources/access_chromevox/audio/common/remote_tts_manager.js (revision 0)
|
| +++ chrome/browser/resources/access_chromevox/audio/common/remote_tts_manager.js (revision 0)
|
| @@ -0,0 +1,109 @@
|
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +/**
|
| + * @fileoverview Bridge that sends TTS messages from content scripts or
|
| + * other pages to the main background page.
|
| + */
|
| +
|
| +goog.provide('cvox.RemoteTtsManager');
|
| +
|
| +goog.require('cvox.AbstractTts');
|
| +goog.require('cvox.AbstractTtsManager');
|
| +
|
| +if (BUILD_TYPE == BUILD_TYPE_CHROME) {
|
| +
|
| + /**
|
| + * @constructor
|
| + * @extends {cvox.AbstractTtsManager}
|
| + */
|
| + cvox.RemoteTtsManager = function() {
|
| + cvox.AbstractTtsManager.call(this);
|
| + };
|
| + goog.inherits(cvox.RemoteTtsManager, cvox.AbstractTtsManager);
|
| +
|
| + /**
|
| + * @return {string} The human-readable name of this instance.
|
| + */
|
| + cvox.RemoteTtsManager.prototype.getName = function() {
|
| + return 'RemoteTtsManager';
|
| + };
|
| +
|
| + /**
|
| + * Speaks the given string using the specified queueMode and properties.
|
| + * @param {string} textString The string of text to be spoken.
|
| + * @param {number=} queueMode The queue mode: AbstractTts.QUEUE_MODE_FLUSH
|
| + * for flush, AbstractTts.QUEUE_MODE_QUEUE for adding to queue.
|
| + * @param {Object=} properties Speech properties to use for this utterance.
|
| + */
|
| + cvox.RemoteTtsManager.prototype.speak = function(textString, queueMode,
|
| + properties) {
|
| + cvox.RemoteTtsManager.superClass_.speak.call(this, textString, queueMode,
|
| + properties);
|
| + cvox.ExtensionBridge.send(
|
| + {'target': 'TTS',
|
| + 'action': 'speak',
|
| + 'text': textString,
|
| + 'queueMode': queueMode,
|
| + 'properties': properties});
|
| + };
|
| +
|
| + /**
|
| + * Returns true if the TTS is currently speaking.
|
| + * @return {boolean} True if the TTS is speaking.
|
| + */
|
| + cvox.RemoteTtsManager.prototype.isSpeaking = function() {
|
| + cvox.RemoteTtsManager.superClass_.isSpeaking.call(this);
|
| + return false;
|
| + };
|
| +
|
| + /**
|
| + * Stops speech.
|
| + */
|
| + cvox.RemoteTtsManager.prototype.stop = function() {
|
| + cvox.RemoteTtsManager.superClass_.stop.call(this);
|
| + cvox.ExtensionBridge.send(
|
| + {'target': 'TTS',
|
| + 'action': 'stop'});
|
| + };
|
| +
|
| + /**
|
| + * Switch to the next TTS engine and optionally announce its name.
|
| + *
|
| + * @param {boolean} announce If true, will announce the name of the
|
| + * new TTS engine.
|
| + */
|
| + cvox.RemoteTtsManager.prototype.nextEngine = function(announce) {
|
| + cvox.RemoteTtsManager.superClass_.nextTtsEngine.call(this, announce);
|
| + cvox.ExtensionBridge.send(
|
| + {'target': 'TTS',
|
| + 'action': 'nextEngine'});
|
| + };
|
| +
|
| + /**
|
| + * Decreases a TTS speech property.
|
| + * @param {string} property_name The name of the property to decrease.
|
| + */
|
| + cvox.RemoteTtsManager.prototype.decreaseProperty = function(property_name) {
|
| + cvox.RemoteTtsManager.superClass_.decreaseProperty.call(this,
|
| + property_name);
|
| + cvox.ExtensionBridge.send(
|
| + {'target': 'TTS',
|
| + 'action': 'decrease' + property_name });
|
| + };
|
| +
|
| + /**
|
| + * Increases a TTS speech property.
|
| + * @param {string} property_name The name of the property to increase.
|
| + */
|
| + cvox.RemoteTtsManager.prototype.increaseProperty = function(property_name) {
|
| + cvox.RemoteTtsManager.superClass_.increaseProperty.call(this,
|
| + property_name);
|
| + cvox.ExtensionBridge.send(
|
| + {'target': 'TTS',
|
| + 'action': 'increase' + property_name});
|
| + };
|
| +} else {
|
| + cvox.RemoteTtsManager = function() {};
|
| +}
|
|
|
| Property changes on: chrome/browser/resources/access_chromevox/audio/common/remote_tts_manager.js
|
| ___________________________________________________________________
|
| Added: svn:executable
|
| + *
|
| Added: svn:eol-style
|
| + LF
|
|
|
|
|