OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 16 matching lines...) Expand all Loading... |
27 */ | 27 */ |
28 | 28 |
29 #ifndef Panner_h | 29 #ifndef Panner_h |
30 #define Panner_h | 30 #define Panner_h |
31 | 31 |
32 #include <wtf/PassOwnPtr.h> | 32 #include <wtf/PassOwnPtr.h> |
33 | 33 |
34 namespace WebCore { | 34 namespace WebCore { |
35 | 35 |
36 class AudioBus; | 36 class AudioBus; |
| 37 class HRTFDatabaseLoader; |
37 | 38 |
38 // Abstract base class for panning a mono or stereo source. | 39 // Abstract base class for panning a mono or stereo source. |
39 | 40 |
40 class Panner { | 41 class Panner { |
41 public: | 42 public: |
42 enum { | 43 enum { |
43 PanningModelEqualPower = 0, | 44 PanningModelEqualPower = 0, |
44 PanningModelHRTF = 1, | 45 PanningModelHRTF = 1, |
45 PanningModelSoundField = 2 | 46 PanningModelSoundField = 2 |
46 }; | 47 }; |
47 | 48 |
48 typedef unsigned PanningModel; | 49 typedef unsigned PanningModel; |
49 | 50 |
50 static PassOwnPtr<Panner> create(PanningModel, float sampleRate); | 51 static PassOwnPtr<Panner> create(PanningModel, float sampleRate, HRTFDatabas
eLoader*); |
51 | 52 |
52 virtual ~Panner() { }; | 53 virtual ~Panner() { }; |
53 | 54 |
54 PanningModel panningModel() const { return m_panningModel; } | 55 PanningModel panningModel() const { return m_panningModel; } |
55 | 56 |
56 virtual void pan(double azimuth, double elevation, const AudioBus* inputBus,
AudioBus* outputBus, size_t framesToProcess) = 0; | 57 virtual void pan(double azimuth, double elevation, const AudioBus* inputBus,
AudioBus* outputBus, size_t framesToProcess) = 0; |
57 | 58 |
58 virtual void reset() = 0; | 59 virtual void reset() = 0; |
59 | 60 |
60 virtual double tailTime() const = 0; | 61 virtual double tailTime() const = 0; |
61 virtual double latencyTime() const = 0; | 62 virtual double latencyTime() const = 0; |
62 | 63 |
63 protected: | 64 protected: |
64 Panner(PanningModel model) : m_panningModel(model) { } | 65 Panner(PanningModel model) : m_panningModel(model) { } |
65 | 66 |
66 PanningModel m_panningModel; | 67 PanningModel m_panningModel; |
67 }; | 68 }; |
68 | 69 |
69 } // namespace WebCore | 70 } // namespace WebCore |
70 | 71 |
71 #endif // Panner_h | 72 #endif // Panner_h |
OLD | NEW |