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 15 matching lines...) Expand all Loading... |
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 */ | 27 */ |
28 | 28 |
29 #ifndef AudioListener_h | 29 #ifndef AudioListener_h |
30 #define AudioListener_h | 30 #define AudioListener_h |
31 | 31 |
32 #include "bindings/core/v8/ScriptWrappable.h" | 32 #include "bindings/core/v8/ScriptWrappable.h" |
33 #include "platform/geometry/FloatPoint3D.h" | 33 #include "platform/geometry/FloatPoint3D.h" |
34 #include "platform/heap/Handle.h" | 34 #include "platform/heap/Handle.h" |
35 #include "wtf/PassRefPtr.h" | 35 #include "wtf/PassRefPtr.h" |
36 #include "wtf/RefCounted.h" | |
37 #include "wtf/Vector.h" | 36 #include "wtf/Vector.h" |
38 | 37 |
39 namespace blink { | 38 namespace blink { |
40 | 39 |
41 class HRTFDatabaseLoader; | 40 class HRTFDatabaseLoader; |
42 class PannerNode; | 41 class PannerNode; |
43 | 42 |
44 // AudioListener maintains the state of the listener in the audio scene as defin
ed in the OpenAL specification. | 43 // AudioListener maintains the state of the listener in the audio scene as defin
ed in the OpenAL specification. |
45 | 44 |
46 class AudioListener : public RefCountedWillBeGarbageCollectedFinalized<AudioList
ener>, public ScriptWrappable { | 45 class AudioListener : public GarbageCollectedFinalized<AudioListener>, public Sc
riptWrappable { |
47 public: | 46 public: |
48 static PassRefPtrWillBeRawPtr<AudioListener> create() | 47 static AudioListener* create() |
49 { | 48 { |
50 return adoptRefWillBeNoop(new AudioListener()); | 49 return new AudioListener(); |
51 } | 50 } |
52 virtual ~AudioListener(); | 51 virtual ~AudioListener(); |
53 | 52 |
54 // Position | 53 // Position |
55 void setPosition(float x, float y, float z) { setPosition(FloatPoint3D(x, y,
z)); } | 54 void setPosition(float x, float y, float z) { setPosition(FloatPoint3D(x, y,
z)); } |
56 const FloatPoint3D& position() const { return m_position; } | 55 const FloatPoint3D& position() const { return m_position; } |
57 | 56 |
58 // Orientation and Up-vector | 57 // Orientation and Up-vector |
59 void setOrientation(float x, float y, float z, float upX, float upY, float u
pZ) | 58 void setOrientation(float x, float y, float z, float upX, float upY, float u
pZ) |
60 { | 59 { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 FloatPoint3D m_orientation; | 101 FloatPoint3D m_orientation; |
103 FloatPoint3D m_upVector; | 102 FloatPoint3D m_upVector; |
104 FloatPoint3D m_velocity; | 103 FloatPoint3D m_velocity; |
105 double m_dopplerFactor; | 104 double m_dopplerFactor; |
106 double m_speedOfSound; | 105 double m_speedOfSound; |
107 | 106 |
108 // Synchronize a panner's process() with setting of the state of the listene
r. | 107 // Synchronize a panner's process() with setting of the state of the listene
r. |
109 mutable Mutex m_listenerLock; | 108 mutable Mutex m_listenerLock; |
110 // List for pannerNodes in context. This is updated only in the main thread, | 109 // List for pannerNodes in context. This is updated only in the main thread, |
111 // and can be referred in audio thread. | 110 // and can be referred in audio thread. |
112 WillBeHeapVector<RawPtrWillBeMember<PannerNode> > m_panners; | 111 HeapVector<Member<PannerNode> > m_panners; |
113 // HRTF DB loader for panner node. | 112 // HRTF DB loader for panner node. |
114 RefPtr<HRTFDatabaseLoader> m_hrtfDatabaseLoader; | 113 RefPtr<HRTFDatabaseLoader> m_hrtfDatabaseLoader; |
115 }; | 114 }; |
116 | 115 |
117 } // namespace blink | 116 } // namespace blink |
118 | 117 |
119 #endif // AudioListener_h | 118 #endif // AudioListener_h |
OLD | NEW |