Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(347)

Side by Side Diff: Source/modules/webaudio/PannerNode.cpp

Issue 14636011: Support multiple HRTFDatabases for different sample-rates (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add ASSERT(isMainThread()) Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/modules/webaudio/OfflineAudioDestinationNode.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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)
OLDNEW
« no previous file with comments | « Source/modules/webaudio/OfflineAudioDestinationNode.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698