| 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 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 // PannerNode is an AudioNode with one input and one output. | 41 // PannerNode is an AudioNode with one input and one output. |
| 42 // It positions a sound in 3D space, with the exact effect dependent on the pann
ing model. | 42 // It positions a sound in 3D space, with the exact effect dependent on the pann
ing model. |
| 43 // It has a position and an orientation in 3D space which is relative to the pos
ition and orientation of the context's AudioListener. | 43 // 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 // A distance effect will attenuate the gain as the position moves away from the
listener. | 44 // A distance effect will attenuate the gain as the position moves away from the
listener. |
| 45 // A cone effect will attenuate the gain as the orientation moves away from the
listener. | 45 // A cone effect will attenuate the gain as the orientation moves away from the
listener. |
| 46 // All of these effects follow the OpenAL specification very closely. | 46 // All of these effects follow the OpenAL specification very closely. |
| 47 | 47 |
| 48 class PannerNode FINAL : public AudioNode { | 48 class PannerNode FINAL : public AudioNode { |
| 49 public: | 49 public: |
| 50 // These must be defined as in the .idl file and must match those in the Pan
ner class. | |
| 51 enum { | |
| 52 EQUALPOWER = 0, | |
| 53 HRTF = 1, | |
| 54 }; | |
| 55 | |
| 56 // These must be defined as in the .idl file and must match those | |
| 57 // in the DistanceEffect class. | |
| 58 enum { | |
| 59 LINEAR_DISTANCE = 0, | |
| 60 INVERSE_DISTANCE = 1, | |
| 61 EXPONENTIAL_DISTANCE = 2, | |
| 62 }; | |
| 63 | |
| 64 // These enums are used to distinguish what cached values of panner are dirt
y. | 50 // These enums are used to distinguish what cached values of panner are dirt
y. |
| 65 enum { | 51 enum { |
| 66 AzimuthElevationDirty = 0x1, | 52 AzimuthElevationDirty = 0x1, |
| 67 DistanceConeGainDirty = 0x2, | 53 DistanceConeGainDirty = 0x2, |
| 68 DopplerRateDirty = 0x4, | 54 DopplerRateDirty = 0x4, |
| 69 }; | 55 }; |
| 70 | 56 |
| 71 static PassRefPtr<PannerNode> create(AudioContext* context, float sampleRate
) | 57 static PassRefPtr<PannerNode> create(AudioContext* context, float sampleRate
) |
| 72 { | 58 { |
| 73 return adoptRef(new PannerNode(context, sampleRate)); | 59 return adoptRef(new PannerNode(context, sampleRate)); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 // AudioContext's connection count | 160 // AudioContext's connection count |
| 175 unsigned m_connectionCount; | 161 unsigned m_connectionCount; |
| 176 | 162 |
| 177 // Synchronize process() with setting of the panning model, source's locatio
n information, listener, distance parameters and sound cones. | 163 // Synchronize process() with setting of the panning model, source's locatio
n information, listener, distance parameters and sound cones. |
| 178 mutable Mutex m_processLock; | 164 mutable Mutex m_processLock; |
| 179 }; | 165 }; |
| 180 | 166 |
| 181 } // namespace WebCore | 167 } // namespace WebCore |
| 182 | 168 |
| 183 #endif // PannerNode_h | 169 #endif // PannerNode_h |
| OLD | NEW |