| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 { | 137 { |
| 138 m_lastGain = -1.0; // force to snap to initial gain | 138 m_lastGain = -1.0; // force to snap to initial gain |
| 139 if (m_panner.get()) | 139 if (m_panner.get()) |
| 140 m_panner->reset(); | 140 m_panner->reset(); |
| 141 } | 141 } |
| 142 | 142 |
| 143 void PannerNode::initialize() | 143 void PannerNode::initialize() |
| 144 { | 144 { |
| 145 if (isInitialized()) | 145 if (isInitialized()) |
| 146 return; | 146 return; |
| 147 | 147 |
| 148 m_panner = Panner::create(m_panningModel, sampleRate()); | 148 m_panner = Panner::create(m_panningModel, sampleRate(), context()->hrtfDatab
aseLoader()); |
| 149 | 149 |
| 150 AudioNode::initialize(); | 150 AudioNode::initialize(); |
| 151 } | 151 } |
| 152 | 152 |
| 153 void PannerNode::uninitialize() | 153 void PannerNode::uninitialize() |
| 154 { | 154 { |
| 155 if (!isInitialized()) | 155 if (!isInitialized()) |
| 156 return; | 156 return; |
| 157 | 157 |
| 158 m_panner.clear(); | 158 m_panner.clear(); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 } | 192 } |
| 193 | 193 |
| 194 bool PannerNode::setPanningModel(unsigned model) | 194 bool PannerNode::setPanningModel(unsigned model) |
| 195 { | 195 { |
| 196 switch (model) { | 196 switch (model) { |
| 197 case EQUALPOWER: | 197 case EQUALPOWER: |
| 198 case HRTF: | 198 case HRTF: |
| 199 if (!m_panner.get() || model != m_panningModel) { | 199 if (!m_panner.get() || model != m_panningModel) { |
| 200 // This synchronizes with process(). | 200 // This synchronizes with process(). |
| 201 MutexLocker processLocker(m_pannerLock); | 201 MutexLocker processLocker(m_pannerLock); |
| 202 | 202 |
| 203 OwnPtr<Panner> newPanner = Panner::create(model, sampleRate()); | 203 OwnPtr<Panner> newPanner = Panner::create(model, sampleRate(), conte
xt()->hrtfDatabaseLoader()); |
| 204 m_panner = newPanner.release(); | 204 m_panner = newPanner.release(); |
| 205 m_panningModel = model; | 205 m_panningModel = model; |
| 206 } | 206 } |
| 207 break; | 207 break; |
| 208 case SOUNDFIELD: | 208 case SOUNDFIELD: |
| 209 // FIXME: Implement sound field model. See // https://bugs.webkit.org/sh
ow_bug.cgi?id=77367. | 209 // FIXME: Implement sound field model. See // https://bugs.webkit.org/sh
ow_bug.cgi?id=77367. |
| 210 context()->scriptExecutionContext()->addConsoleMessage(JSMessageSource,
WarningMessageLevel, "'soundfield' panning model not implemented."); | 210 context()->scriptExecutionContext()->addConsoleMessage(JSMessageSource,
WarningMessageLevel, "'soundfield' panning model not implemented."); |
| 211 break; | 211 break; |
| 212 default: | 212 default: |
| 213 return false; | 213 return false; |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 AudioNode* connectedNode = connectedOutput->node(); | 408 AudioNode* connectedNode = connectedOutput->node(); |
| 409 notifyAudioSourcesConnectedToNode(connectedNode); // recurse | 409 notifyAudioSourcesConnectedToNode(connectedNode); // recurse |
| 410 } | 410 } |
| 411 } | 411 } |
| 412 } | 412 } |
| 413 } | 413 } |
| 414 | 414 |
| 415 } // namespace WebCore | 415 } // namespace WebCore |
| 416 | 416 |
| 417 #endif // ENABLE(WEB_AUDIO) | 417 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |