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 26 matching lines...) Expand all Loading... |
37 AudioListener::AudioListener(BaseAudioContext& context) | 37 AudioListener::AudioListener(BaseAudioContext& context) |
38 : m_positionX(AudioParam::create(context, ParamTypeAudioListenerPositionX, 0
.0)) | 38 : m_positionX(AudioParam::create(context, ParamTypeAudioListenerPositionX, 0
.0)) |
39 , m_positionY(AudioParam::create(context, ParamTypeAudioListenerPositionY, 0
.0)) | 39 , m_positionY(AudioParam::create(context, ParamTypeAudioListenerPositionY, 0
.0)) |
40 , m_positionZ(AudioParam::create(context, ParamTypeAudioListenerPositionZ, 0
.0)) | 40 , m_positionZ(AudioParam::create(context, ParamTypeAudioListenerPositionZ, 0
.0)) |
41 , m_forwardX(AudioParam::create(context, ParamTypeAudioListenerForwardX, 0.0
)) | 41 , m_forwardX(AudioParam::create(context, ParamTypeAudioListenerForwardX, 0.0
)) |
42 , m_forwardY(AudioParam::create(context, ParamTypeAudioListenerForwardY, 0.0
)) | 42 , m_forwardY(AudioParam::create(context, ParamTypeAudioListenerForwardY, 0.0
)) |
43 , m_forwardZ(AudioParam::create(context, ParamTypeAudioListenerForwardZ, -1.
0)) | 43 , m_forwardZ(AudioParam::create(context, ParamTypeAudioListenerForwardZ, -1.
0)) |
44 , m_upX(AudioParam::create(context, ParamTypeAudioListenerUpX, 0.0)) | 44 , m_upX(AudioParam::create(context, ParamTypeAudioListenerUpX, 0.0)) |
45 , m_upY(AudioParam::create(context, ParamTypeAudioListenerUpY, 1.0)) | 45 , m_upY(AudioParam::create(context, ParamTypeAudioListenerUpY, 1.0)) |
46 , m_upZ(AudioParam::create(context, ParamTypeAudioListenerUpZ, 0.0)) | 46 , m_upZ(AudioParam::create(context, ParamTypeAudioListenerUpZ, 0.0)) |
47 , m_dopplerFactor(1) | |
48 , m_speedOfSound(343.3) | |
49 , m_lastUpdateTime(-1) | 47 , m_lastUpdateTime(-1) |
50 , m_isListenerDirty(false) | 48 , m_isListenerDirty(false) |
51 , m_positionXValues(AudioUtilities::kRenderQuantumFrames) | 49 , m_positionXValues(AudioUtilities::kRenderQuantumFrames) |
52 , m_positionYValues(AudioUtilities::kRenderQuantumFrames) | 50 , m_positionYValues(AudioUtilities::kRenderQuantumFrames) |
53 , m_positionZValues(AudioUtilities::kRenderQuantumFrames) | 51 , m_positionZValues(AudioUtilities::kRenderQuantumFrames) |
54 , m_forwardXValues(AudioUtilities::kRenderQuantumFrames) | 52 , m_forwardXValues(AudioUtilities::kRenderQuantumFrames) |
55 , m_forwardYValues(AudioUtilities::kRenderQuantumFrames) | 53 , m_forwardYValues(AudioUtilities::kRenderQuantumFrames) |
56 , m_forwardZValues(AudioUtilities::kRenderQuantumFrames) | 54 , m_forwardZValues(AudioUtilities::kRenderQuantumFrames) |
57 , m_upXValues(AudioUtilities::kRenderQuantumFrames) | 55 , m_upXValues(AudioUtilities::kRenderQuantumFrames) |
58 , m_upYValues(AudioUtilities::kRenderQuantumFrames) | 56 , m_upYValues(AudioUtilities::kRenderQuantumFrames) |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 DCHECK(isMainThread()); | 282 DCHECK(isMainThread()); |
285 | 283 |
286 // This synchronizes with panner's process(). | 284 // This synchronizes with panner's process(). |
287 MutexLocker listenerLocker(m_listenerLock); | 285 MutexLocker listenerLocker(m_listenerLock); |
288 m_upX->setValue(upVector.x()); | 286 m_upX->setValue(upVector.x()); |
289 m_upY->setValue(upVector.y()); | 287 m_upY->setValue(upVector.y()); |
290 m_upZ->setValue(upVector.z()); | 288 m_upZ->setValue(upVector.z()); |
291 markPannersAsDirty(PannerHandler::AzimuthElevationDirty); | 289 markPannersAsDirty(PannerHandler::AzimuthElevationDirty); |
292 } | 290 } |
293 | 291 |
294 void AudioListener::setVelocity(float x, float y, float z) | |
295 { | |
296 // The velocity is not used internally and cannot be read back by scripts, | |
297 // so it can be ignored entirely. | |
298 } | |
299 | |
300 void AudioListener::setDopplerFactor(double dopplerFactor) | |
301 { | |
302 m_dopplerFactor = dopplerFactor; | |
303 } | |
304 | |
305 void AudioListener::setSpeedOfSound(double speedOfSound) | |
306 { | |
307 m_speedOfSound = speedOfSound; | |
308 } | |
309 | |
310 } // namespace blink | 292 } // namespace blink |
OLD | NEW |