| 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 15 matching lines...) Expand all Loading... |
| 26 #define DynamicsCompressorNode_h | 26 #define DynamicsCompressorNode_h |
| 27 | 27 |
| 28 #include "base/gtest_prod_util.h" | 28 #include "base/gtest_prod_util.h" |
| 29 #include "modules/ModulesExport.h" | 29 #include "modules/ModulesExport.h" |
| 30 #include "modules/webaudio/AudioNode.h" | 30 #include "modules/webaudio/AudioNode.h" |
| 31 #include "modules/webaudio/AudioParam.h" | 31 #include "modules/webaudio/AudioParam.h" |
| 32 #include "wtf/OwnPtr.h" | 32 #include "wtf/OwnPtr.h" |
| 33 | 33 |
| 34 namespace blink { | 34 namespace blink { |
| 35 | 35 |
| 36 class AbstractAudioContext; | 36 class BaseAudioContext; |
| 37 class DynamicsCompressor; | 37 class DynamicsCompressor; |
| 38 | 38 |
| 39 class MODULES_EXPORT DynamicsCompressorHandler final : public AudioHandler { | 39 class MODULES_EXPORT DynamicsCompressorHandler final : public AudioHandler { |
| 40 public: | 40 public: |
| 41 static PassRefPtr<DynamicsCompressorHandler> create(AudioNode&, float sample
Rate, AudioParamHandler& threshold, AudioParamHandler& knee, AudioParamHandler&
ratio, AudioParamHandler& reduction, AudioParamHandler& attack, AudioParamHandle
r& release); | 41 static PassRefPtr<DynamicsCompressorHandler> create(AudioNode&, float sample
Rate, AudioParamHandler& threshold, AudioParamHandler& knee, AudioParamHandler&
ratio, AudioParamHandler& reduction, AudioParamHandler& attack, AudioParamHandle
r& release); |
| 42 ~DynamicsCompressorHandler(); | 42 ~DynamicsCompressorHandler(); |
| 43 | 43 |
| 44 // AudioHandler | 44 // AudioHandler |
| 45 void process(size_t framesToProcess) override; | 45 void process(size_t framesToProcess) override; |
| 46 void initialize() override; | 46 void initialize() override; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 58 RefPtr<AudioParamHandler> m_reduction; | 58 RefPtr<AudioParamHandler> m_reduction; |
| 59 RefPtr<AudioParamHandler> m_attack; | 59 RefPtr<AudioParamHandler> m_attack; |
| 60 RefPtr<AudioParamHandler> m_release; | 60 RefPtr<AudioParamHandler> m_release; |
| 61 | 61 |
| 62 FRIEND_TEST_ALL_PREFIXES(DynamicsCompressorNodeTest, ProcessorLifetime); | 62 FRIEND_TEST_ALL_PREFIXES(DynamicsCompressorNodeTest, ProcessorLifetime); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 class MODULES_EXPORT DynamicsCompressorNode final : public AudioNode { | 65 class MODULES_EXPORT DynamicsCompressorNode final : public AudioNode { |
| 66 DEFINE_WRAPPERTYPEINFO(); | 66 DEFINE_WRAPPERTYPEINFO(); |
| 67 public: | 67 public: |
| 68 static DynamicsCompressorNode* create(AbstractAudioContext&, float sampleRat
e); | 68 static DynamicsCompressorNode* create(BaseAudioContext&, float sampleRate); |
| 69 DECLARE_VIRTUAL_TRACE(); | 69 DECLARE_VIRTUAL_TRACE(); |
| 70 | 70 |
| 71 AudioParam* threshold() const; | 71 AudioParam* threshold() const; |
| 72 AudioParam* knee() const; | 72 AudioParam* knee() const; |
| 73 AudioParam* ratio() const; | 73 AudioParam* ratio() const; |
| 74 AudioParam* reduction() const; | 74 AudioParam* reduction() const; |
| 75 AudioParam* attack() const; | 75 AudioParam* attack() const; |
| 76 AudioParam* release() const; | 76 AudioParam* release() const; |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 DynamicsCompressorNode(AbstractAudioContext&, float sampleRate); | 79 DynamicsCompressorNode(BaseAudioContext&, float sampleRate); |
| 80 DynamicsCompressorHandler& dynamicsCompressorHandler() const; | 80 DynamicsCompressorHandler& dynamicsCompressorHandler() const; |
| 81 | 81 |
| 82 Member<AudioParam> m_threshold; | 82 Member<AudioParam> m_threshold; |
| 83 Member<AudioParam> m_knee; | 83 Member<AudioParam> m_knee; |
| 84 Member<AudioParam> m_ratio; | 84 Member<AudioParam> m_ratio; |
| 85 Member<AudioParam> m_reduction; | 85 Member<AudioParam> m_reduction; |
| 86 Member<AudioParam> m_attack; | 86 Member<AudioParam> m_attack; |
| 87 Member<AudioParam> m_release; | 87 Member<AudioParam> m_release; |
| 88 | 88 |
| 89 FRIEND_TEST_ALL_PREFIXES(DynamicsCompressorNodeTest, ProcessorLifetime); | 89 FRIEND_TEST_ALL_PREFIXES(DynamicsCompressorNodeTest, ProcessorLifetime); |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 } // namespace blink | 92 } // namespace blink |
| 93 | 93 |
| 94 #endif // DynamicsCompressorNode_h | 94 #endif // DynamicsCompressorNode_h |
| OLD | NEW |