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