OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 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 14 matching lines...) Expand all Loading... |
25 #ifndef DynamicsCompressorNode_h | 25 #ifndef DynamicsCompressorNode_h |
26 #define DynamicsCompressorNode_h | 26 #define DynamicsCompressorNode_h |
27 | 27 |
28 #include "modules/ModulesExport.h" | 28 #include "modules/ModulesExport.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 "wtf/OwnPtr.h" | 31 #include "wtf/OwnPtr.h" |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 | 34 |
| 35 class AbstractAudioContext; |
35 class DynamicsCompressor; | 36 class DynamicsCompressor; |
36 | 37 |
37 class MODULES_EXPORT DynamicsCompressorHandler final : public AudioHandler { | 38 class MODULES_EXPORT DynamicsCompressorHandler final : public AudioHandler { |
38 public: | 39 public: |
39 static PassRefPtr<DynamicsCompressorHandler> create(AudioNode&, float sample
Rate, AudioParamHandler& threshold, AudioParamHandler& knee, AudioParamHandler&
ratio, AudioParamHandler& reduction, AudioParamHandler& attack, AudioParamHandle
r& release); | 40 static PassRefPtr<DynamicsCompressorHandler> create(AudioNode&, float sample
Rate, AudioParamHandler& threshold, AudioParamHandler& knee, AudioParamHandler&
ratio, AudioParamHandler& reduction, AudioParamHandler& attack, AudioParamHandle
r& release); |
40 ~DynamicsCompressorHandler(); | 41 ~DynamicsCompressorHandler(); |
41 | 42 |
42 // AudioHandler | 43 // AudioHandler |
43 void process(size_t framesToProcess) override; | 44 void process(size_t framesToProcess) override; |
44 void initialize() override; | 45 void initialize() override; |
(...skipping 12 matching lines...) Expand all Loading... |
57 RefPtr<AudioParamHandler> m_attack; | 58 RefPtr<AudioParamHandler> m_attack; |
58 RefPtr<AudioParamHandler> m_release; | 59 RefPtr<AudioParamHandler> m_release; |
59 | 60 |
60 // TODO(tkent): Use FRIEND_TEST macro provided by gtest_prod.h | 61 // TODO(tkent): Use FRIEND_TEST macro provided by gtest_prod.h |
61 friend class DynamicsCompressorNodeTest_ProcessorLifetime_Test; | 62 friend class DynamicsCompressorNodeTest_ProcessorLifetime_Test; |
62 }; | 63 }; |
63 | 64 |
64 class MODULES_EXPORT DynamicsCompressorNode final : public AudioNode { | 65 class MODULES_EXPORT DynamicsCompressorNode final : public AudioNode { |
65 DEFINE_WRAPPERTYPEINFO(); | 66 DEFINE_WRAPPERTYPEINFO(); |
66 public: | 67 public: |
67 static DynamicsCompressorNode* create(AudioContext&, float sampleRate); | 68 static DynamicsCompressorNode* create(AbstractAudioContext&, float sampleRat
e); |
68 DECLARE_VIRTUAL_TRACE(); | 69 DECLARE_VIRTUAL_TRACE(); |
69 | 70 |
70 AudioParam* threshold() const; | 71 AudioParam* threshold() const; |
71 AudioParam* knee() const; | 72 AudioParam* knee() const; |
72 AudioParam* ratio() const; | 73 AudioParam* ratio() const; |
73 AudioParam* reduction() const; | 74 AudioParam* reduction() const; |
74 AudioParam* attack() const; | 75 AudioParam* attack() const; |
75 AudioParam* release() const; | 76 AudioParam* release() const; |
76 | 77 |
77 private: | 78 private: |
78 DynamicsCompressorNode(AudioContext&, float sampleRate); | 79 DynamicsCompressorNode(AbstractAudioContext&, float sampleRate); |
79 DynamicsCompressorHandler& dynamicsCompressorHandler() const; | 80 DynamicsCompressorHandler& dynamicsCompressorHandler() const; |
80 | 81 |
81 Member<AudioParam> m_threshold; | 82 Member<AudioParam> m_threshold; |
82 Member<AudioParam> m_knee; | 83 Member<AudioParam> m_knee; |
83 Member<AudioParam> m_ratio; | 84 Member<AudioParam> m_ratio; |
84 Member<AudioParam> m_reduction; | 85 Member<AudioParam> m_reduction; |
85 Member<AudioParam> m_attack; | 86 Member<AudioParam> m_attack; |
86 Member<AudioParam> m_release; | 87 Member<AudioParam> m_release; |
87 | 88 |
88 // TODO(tkent): Use FRIEND_TEST macro provided by gtest_prod.h | 89 // TODO(tkent): Use FRIEND_TEST macro provided by gtest_prod.h |
89 friend class DynamicsCompressorNodeTest_ProcessorLifetime_Test; | 90 friend class DynamicsCompressorNodeTest_ProcessorLifetime_Test; |
90 }; | 91 }; |
91 | 92 |
92 } // namespace blink | 93 } // namespace blink |
93 | 94 |
94 #endif // DynamicsCompressorNode_h | 95 #endif // DynamicsCompressorNode_h |
OLD | NEW |