| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 {name: 'Aokr', type: AudioNodeType.AOKR}, | 101 {name: 'Aokr', type: AudioNodeType.AOKR}, |
| 102 {name: 'Post Mix Loopback', type: AudioNodeType.POST_MIX_LOOPBACK}, | 102 {name: 'Post Mix Loopback', type: AudioNodeType.POST_MIX_LOOPBACK}, |
| 103 {name: 'Post Dsp Loopback', type: AudioNodeType.POST_DSP_LOOPBACK}, | 103 {name: 'Post Dsp Loopback', type: AudioNodeType.POST_DSP_LOOPBACK}, |
| 104 {name: 'Other', type: AudioNodeType.OTHER} | 104 {name: 'Other', type: AudioNodeType.OTHER} |
| 105 ]; | 105 ]; |
| 106 } | 106 } |
| 107 }, | 107 }, |
| 108 }, | 108 }, |
| 109 | 109 |
| 110 ready: function() { | 110 ready: function() { |
| 111 this.title = 'Audio'; | 111 chrome.send('requestAudioNodes'); |
| 112 }, | |
| 113 | |
| 114 initialize: function() { | |
| 115 if (!this.initialized) { | |
| 116 chrome.send('requestAudioNodes'); | |
| 117 this.initialized = true; | |
| 118 } | |
| 119 }, | 112 }, |
| 120 | 113 |
| 121 /** | 114 /** |
| 122 * Adds a new node with default settings to the list of nodes. | 115 * Adds a new node with default settings to the list of nodes. |
| 123 */ | 116 */ |
| 124 appendNewNode: function() { | 117 appendNewNode: function() { |
| 125 var newNode = new AudioNode(); | 118 var newNode = new AudioNode(); |
| 126 newNode.id += this.nodeCount; | 119 newNode.id += this.nodeCount; |
| 127 this.nodeCount++; | 120 this.nodeCount++; |
| 128 this.push('nodes', newNode); | 121 this.push('nodes', newNode); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 /** @type {!Array<!AudioNode>} */ var newNodeList = []; | 193 /** @type {!Array<!AudioNode>} */ var newNodeList = []; |
| 201 for (var i = 0; i < nodeList.length; ++i) { | 194 for (var i = 0; i < nodeList.length; ++i) { |
| 202 // Create a new audio node and add all the properties from |nodeList[i]|. | 195 // Create a new audio node and add all the properties from |nodeList[i]|. |
| 203 var node = new AudioNode(); | 196 var node = new AudioNode(); |
| 204 Object.assign(node, nodeList[i]); | 197 Object.assign(node, nodeList[i]); |
| 205 newNodeList.push(node); | 198 newNodeList.push(node); |
| 206 } | 199 } |
| 207 this.nodes = newNodeList; | 200 this.nodes = newNodeList; |
| 208 } | 201 } |
| 209 }); | 202 }); |
| OLD | NEW |