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 16 matching lines...) Expand all Loading... |
27 | 27 |
28 #include "modules/webaudio/AudioListener.h" | 28 #include "modules/webaudio/AudioListener.h" |
29 #include "modules/webaudio/AudioNode.h" | 29 #include "modules/webaudio/AudioNode.h" |
30 #include "modules/webaudio/AudioParam.h" | 30 #include "modules/webaudio/AudioParam.h" |
31 #include "platform/audio/AudioBus.h" | 31 #include "platform/audio/AudioBus.h" |
32 #include "platform/audio/Cone.h" | 32 #include "platform/audio/Cone.h" |
33 #include "platform/audio/Distance.h" | 33 #include "platform/audio/Distance.h" |
34 #include "platform/audio/Panner.h" | 34 #include "platform/audio/Panner.h" |
35 #include "platform/geometry/FloatPoint3D.h" | 35 #include "platform/geometry/FloatPoint3D.h" |
36 #include "wtf/HashMap.h" | 36 #include "wtf/HashMap.h" |
| 37 #include <memory> |
37 | 38 |
38 namespace blink { | 39 namespace blink { |
39 | 40 |
40 class AbstractAudioContext; | 41 class AbstractAudioContext; |
41 | 42 |
42 // PannerNode is an AudioNode with one input and one output. | 43 // PannerNode is an AudioNode with one input and one output. |
43 // It positions a sound in 3D space, with the exact effect dependent on the pann
ing model. | 44 // It positions a sound in 3D space, with the exact effect dependent on the pann
ing model. |
44 // It has a position and an orientation in 3D space which is relative to the pos
ition and orientation of the context's AudioListener. | 45 // It has a position and an orientation in 3D space which is relative to the pos
ition and orientation of the context's AudioListener. |
45 // A distance effect will attenuate the gain as the position moves away from the
listener. | 46 // A distance effect will attenuate the gain as the position moves away from the
listener. |
46 // A cone effect will attenuate the gain as the orientation moves away from the
listener. | 47 // A cone effect will attenuate the gain as the orientation moves away from the
listener. |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 void azimuthElevation(double* outAzimuth, double* outElevation); | 146 void azimuthElevation(double* outAzimuth, double* outElevation); |
146 float distanceConeGain(); | 147 float distanceConeGain(); |
147 | 148 |
148 bool isAzimuthElevationDirty() const { return m_isAzimuthElevationDirty; } | 149 bool isAzimuthElevationDirty() const { return m_isAzimuthElevationDirty; } |
149 bool isDistanceConeGainDirty() const { return m_isDistanceConeGainDirty; } | 150 bool isDistanceConeGainDirty() const { return m_isDistanceConeGainDirty; } |
150 void updateDirtyState(); | 151 void updateDirtyState(); |
151 | 152 |
152 // This Persistent doesn't make a reference cycle including the owner | 153 // This Persistent doesn't make a reference cycle including the owner |
153 // PannerNode. | 154 // PannerNode. |
154 Persistent<AudioListener> m_listener; | 155 Persistent<AudioListener> m_listener; |
155 OwnPtr<Panner> m_panner; | 156 std::unique_ptr<Panner> m_panner; |
156 unsigned m_panningModel; | 157 unsigned m_panningModel; |
157 unsigned m_distanceModel; | 158 unsigned m_distanceModel; |
158 | 159 |
159 bool m_isAzimuthElevationDirty; | 160 bool m_isAzimuthElevationDirty; |
160 bool m_isDistanceConeGainDirty; | 161 bool m_isDistanceConeGainDirty; |
161 | 162 |
162 // Gain | 163 // Gain |
163 DistanceEffect m_distanceEffect; | 164 DistanceEffect m_distanceEffect; |
164 ConeEffect m_coneEffect; | 165 ConeEffect m_coneEffect; |
165 float m_lastGain; | 166 float m_lastGain; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 Member<AudioParam> m_positionZ; | 249 Member<AudioParam> m_positionZ; |
249 | 250 |
250 Member<AudioParam> m_orientationX; | 251 Member<AudioParam> m_orientationX; |
251 Member<AudioParam> m_orientationY; | 252 Member<AudioParam> m_orientationY; |
252 Member<AudioParam> m_orientationZ; | 253 Member<AudioParam> m_orientationZ; |
253 }; | 254 }; |
254 | 255 |
255 } // namespace blink | 256 } // namespace blink |
256 | 257 |
257 #endif // PannerNode_h | 258 #endif // PannerNode_h |
OLD | NEW |