OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 /** @enum {string} */ var AudioNodeType = { | 5 /** @enum {string} */ var AudioNodeType = { |
6 HEADPHONE: 'HEADPHONE', | 6 HEADPHONE: 'HEADPHONE', |
7 MIC: 'MIC', | 7 MIC: 'MIC', |
8 USB: 'USB', | 8 USB: 'USB', |
9 BLUETOOTH: 'BLUETOOTH', | 9 BLUETOOTH: 'BLUETOOTH', |
10 HDMI: 'HDMI', | 10 HDMI: 'HDMI', |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 behaviors: [Polymer.NeonAnimatableBehavior], | 52 behaviors: [Polymer.NeonAnimatableBehavior], |
53 | 53 |
54 properties: { | 54 properties: { |
55 /** | 55 /** |
56 * An AudioNode which is currently being edited. | 56 * An AudioNode which is currently being edited. |
57 * @type {AudioNode} | 57 * @type {AudioNode} |
58 */ | 58 */ |
59 currentEditableObject: { | 59 currentEditableObject: { |
60 type: Object, | 60 type: Object, |
61 value: function() { return {}; } | 61 value: function() { |
| 62 return {}; |
| 63 } |
62 }, | 64 }, |
63 | 65 |
64 /** | 66 /** |
65 * The index of the audio node which is currently being edited. | 67 * The index of the audio node which is currently being edited. |
66 * This is initially set to -1 (i.e. no node selected) becuase no devices | 68 * This is initially set to -1 (i.e. no node selected) becuase no devices |
67 * have been copied. | 69 * have been copied. |
68 */ | 70 */ |
69 currentEditIndex: {type: Number, value: function() { return -1; }}, | 71 currentEditIndex: { |
| 72 type: Number, |
| 73 value: function() { |
| 74 return -1; |
| 75 } |
| 76 }, |
70 | 77 |
71 /** | 78 /** |
72 * A counter that will auto increment everytime a new node is added | 79 * A counter that will auto increment everytime a new node is added |
73 * or copied and used to set a new id. This allows the |AudioNode.id| | 80 * or copied and used to set a new id. This allows the |AudioNode.id| |
74 * to allows be unique. | 81 * to allows be unique. |
75 */ | 82 */ |
76 nodeCount: {type: Number, value: function() { return 0; }}, | 83 nodeCount: { |
| 84 type: Number, |
| 85 value: function() { |
| 86 return 0; |
| 87 } |
| 88 }, |
77 | 89 |
78 /** | 90 /** |
79 * A set of audio nodes. | 91 * A set of audio nodes. |
80 * @type !Array<!AudioNode> | 92 * @type !Array<!AudioNode> |
81 */ | 93 */ |
82 nodes: {type: Array, value: function() { return []; }}, | 94 nodes: { |
| 95 type: Array, |
| 96 value: function() { |
| 97 return []; |
| 98 } |
| 99 }, |
83 | 100 |
84 /** | 101 /** |
85 * A set of options for the possible audio node types. | 102 * A set of options for the possible audio node types. |
86 * AudioNodeType |type| is based on the AudioType emumation. | 103 * AudioNodeType |type| is based on the AudioType emumation. |
87 * @type {!Array<!{name: string, type: string}>} | 104 * @type {!Array<!{name: string, type: string}>} |
88 */ | 105 */ |
89 nodeTypeOptions: { | 106 nodeTypeOptions: { |
90 type: Array, | 107 type: Array, |
91 value: function() { | 108 value: function() { |
92 return [ | 109 return [ |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 /** @type {!Array<!AudioNode>} */ var newNodeList = []; | 210 /** @type {!Array<!AudioNode>} */ var newNodeList = []; |
194 for (var i = 0; i < nodeList.length; ++i) { | 211 for (var i = 0; i < nodeList.length; ++i) { |
195 // Create a new audio node and add all the properties from |nodeList[i]|. | 212 // Create a new audio node and add all the properties from |nodeList[i]|. |
196 var node = new AudioNode(); | 213 var node = new AudioNode(); |
197 Object.assign(node, nodeList[i]); | 214 Object.assign(node, nodeList[i]); |
198 newNodeList.push(node); | 215 newNodeList.push(node); |
199 } | 216 } |
200 this.nodes = newNodeList; | 217 this.nodes = newNodeList; |
201 } | 218 } |
202 }); | 219 }); |
OLD | NEW |