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 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 AudioParam::create(context, ParamTypeAudioListenerPositionZ, 0.0)), | 43 AudioParam::create(context, ParamTypeAudioListenerPositionZ, 0.0)), |
44 m_forwardX( | 44 m_forwardX( |
45 AudioParam::create(context, ParamTypeAudioListenerForwardX, 0.0)), | 45 AudioParam::create(context, ParamTypeAudioListenerForwardX, 0.0)), |
46 m_forwardY( | 46 m_forwardY( |
47 AudioParam::create(context, ParamTypeAudioListenerForwardY, 0.0)), | 47 AudioParam::create(context, ParamTypeAudioListenerForwardY, 0.0)), |
48 m_forwardZ( | 48 m_forwardZ( |
49 AudioParam::create(context, ParamTypeAudioListenerForwardZ, -1.0)), | 49 AudioParam::create(context, ParamTypeAudioListenerForwardZ, -1.0)), |
50 m_upX(AudioParam::create(context, ParamTypeAudioListenerUpX, 0.0)), | 50 m_upX(AudioParam::create(context, ParamTypeAudioListenerUpX, 0.0)), |
51 m_upY(AudioParam::create(context, ParamTypeAudioListenerUpY, 1.0)), | 51 m_upY(AudioParam::create(context, ParamTypeAudioListenerUpY, 1.0)), |
52 m_upZ(AudioParam::create(context, ParamTypeAudioListenerUpZ, 0.0)), | 52 m_upZ(AudioParam::create(context, ParamTypeAudioListenerUpZ, 0.0)), |
53 m_dopplerFactor(1), | |
54 m_speedOfSound(343.3), | |
55 m_lastUpdateTime(-1), | 53 m_lastUpdateTime(-1), |
56 m_isListenerDirty(false), | 54 m_isListenerDirty(false), |
57 m_positionXValues(AudioUtilities::kRenderQuantumFrames), | 55 m_positionXValues(AudioUtilities::kRenderQuantumFrames), |
58 m_positionYValues(AudioUtilities::kRenderQuantumFrames), | 56 m_positionYValues(AudioUtilities::kRenderQuantumFrames), |
59 m_positionZValues(AudioUtilities::kRenderQuantumFrames), | 57 m_positionZValues(AudioUtilities::kRenderQuantumFrames), |
60 m_forwardXValues(AudioUtilities::kRenderQuantumFrames), | 58 m_forwardXValues(AudioUtilities::kRenderQuantumFrames), |
61 m_forwardYValues(AudioUtilities::kRenderQuantumFrames), | 59 m_forwardYValues(AudioUtilities::kRenderQuantumFrames), |
62 m_forwardZValues(AudioUtilities::kRenderQuantumFrames), | 60 m_forwardZValues(AudioUtilities::kRenderQuantumFrames), |
63 m_upXValues(AudioUtilities::kRenderQuantumFrames), | 61 m_upXValues(AudioUtilities::kRenderQuantumFrames), |
64 m_upYValues(AudioUtilities::kRenderQuantumFrames), | 62 m_upYValues(AudioUtilities::kRenderQuantumFrames), |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 DCHECK(isMainThread()); | 275 DCHECK(isMainThread()); |
278 | 276 |
279 // This synchronizes with panner's process(). | 277 // This synchronizes with panner's process(). |
280 MutexLocker listenerLocker(m_listenerLock); | 278 MutexLocker listenerLocker(m_listenerLock); |
281 m_upX->setValue(upVector.x()); | 279 m_upX->setValue(upVector.x()); |
282 m_upY->setValue(upVector.y()); | 280 m_upY->setValue(upVector.y()); |
283 m_upZ->setValue(upVector.z()); | 281 m_upZ->setValue(upVector.z()); |
284 markPannersAsDirty(PannerHandler::AzimuthElevationDirty); | 282 markPannersAsDirty(PannerHandler::AzimuthElevationDirty); |
285 } | 283 } |
286 | 284 |
287 void AudioListener::setVelocity(float x, float y, float z) { | |
288 // The velocity is not used internally and cannot be read back by scripts, | |
289 // so it can be ignored entirely. | |
290 } | |
291 | |
292 void AudioListener::setDopplerFactor(double dopplerFactor) { | |
293 m_dopplerFactor = dopplerFactor; | |
294 } | |
295 | |
296 void AudioListener::setSpeedOfSound(double speedOfSound) { | |
297 m_speedOfSound = speedOfSound; | |
298 } | |
299 | |
300 } // namespace blink | 285 } // namespace blink |
OLD | NEW |