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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 | 245 |
246 m_orientationX->calculateSampleAccurateValues(values, framesToProcess); | 246 m_orientationX->calculateSampleAccurateValues(values, framesToProcess); |
247 m_orientationY->calculateSampleAccurateValues(values, framesToProcess); | 247 m_orientationY->calculateSampleAccurateValues(values, framesToProcess); |
248 m_orientationZ->calculateSampleAccurateValues(values, framesToProcess); | 248 m_orientationZ->calculateSampleAccurateValues(values, framesToProcess); |
249 } | 249 } |
250 | 250 |
251 void PannerHandler::initialize() { | 251 void PannerHandler::initialize() { |
252 if (isInitialized()) | 252 if (isInitialized()) |
253 return; | 253 return; |
254 | 254 |
255 m_panner = Panner::create(m_panningModel, sampleRate(), | 255 m_panner = Panner::create(m_panningModel, context()->sampleRate(), |
256 listener()->hrtfDatabaseLoader()); | 256 listener()->hrtfDatabaseLoader()); |
257 listener()->addPanner(*this); | 257 listener()->addPanner(*this); |
258 | 258 |
259 // Set the cached values to the current values to start things off. The | 259 // Set the cached values to the current values to start things off. The |
260 // panner is already marked as dirty, so this won't matter. | 260 // panner is already marked as dirty, so this won't matter. |
261 m_lastPosition = position(); | 261 m_lastPosition = position(); |
262 m_lastOrientation = orientation(); | 262 m_lastOrientation = orientation(); |
263 | 263 |
264 AudioHandler::initialize(); | 264 AudioHandler::initialize(); |
265 } | 265 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 // Load the HRTF database asynchronously so we don't block the | 311 // Load the HRTF database asynchronously so we don't block the |
312 // Javascript thread while creating the HRTF database. It's ok to call | 312 // Javascript thread while creating the HRTF database. It's ok to call |
313 // this multiple times; we won't be constantly loading the database over | 313 // this multiple times; we won't be constantly loading the database over |
314 // and over. | 314 // and over. |
315 listener()->createAndLoadHRTFDatabaseLoader(context()->sampleRate()); | 315 listener()->createAndLoadHRTFDatabaseLoader(context()->sampleRate()); |
316 } | 316 } |
317 | 317 |
318 if (!m_panner.get() || model != m_panningModel) { | 318 if (!m_panner.get() || model != m_panningModel) { |
319 // This synchronizes with process(). | 319 // This synchronizes with process(). |
320 MutexLocker processLocker(m_processLock); | 320 MutexLocker processLocker(m_processLock); |
321 m_panner = | 321 m_panner = Panner::create(model, context()->sampleRate(), |
322 Panner::create(model, sampleRate(), listener()->hrtfDatabaseLoader()); | 322 listener()->hrtfDatabaseLoader()); |
323 m_panningModel = model; | 323 m_panningModel = model; |
324 } | 324 } |
325 return true; | 325 return true; |
326 } | 326 } |
327 | 327 |
328 String PannerHandler::distanceModel() const { | 328 String PannerHandler::distanceModel() const { |
329 switch (const_cast<PannerHandler*>(this)->m_distanceEffect.model()) { | 329 switch (const_cast<PannerHandler*>(this)->m_distanceEffect.model()) { |
330 case DistanceEffect::ModelLinear: | 330 case DistanceEffect::ModelLinear: |
331 return "linear"; | 331 return "linear"; |
332 case DistanceEffect::ModelInverse: | 332 case DistanceEffect::ModelInverse: |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 visitor->trace(m_positionZ); | 805 visitor->trace(m_positionZ); |
806 | 806 |
807 visitor->trace(m_orientationX); | 807 visitor->trace(m_orientationX); |
808 visitor->trace(m_orientationY); | 808 visitor->trace(m_orientationY); |
809 visitor->trace(m_orientationZ); | 809 visitor->trace(m_orientationZ); |
810 | 810 |
811 AudioNode::trace(visitor); | 811 AudioNode::trace(visitor); |
812 } | 812 } |
813 | 813 |
814 } // namespace blink | 814 } // namespace blink |
OLD | NEW |