| 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 18 matching lines...) Expand all Loading... |
| 29 #include "core/dom/DOMTypedArray.h" | 29 #include "core/dom/DOMTypedArray.h" |
| 30 #include "modules/webaudio/AudioNode.h" | 30 #include "modules/webaudio/AudioNode.h" |
| 31 #include "platform/audio/AudioDSPKernel.h" | 31 #include "platform/audio/AudioDSPKernel.h" |
| 32 #include "platform/audio/AudioDSPKernelProcessor.h" | 32 #include "platform/audio/AudioDSPKernelProcessor.h" |
| 33 #include "wtf/RefPtr.h" | 33 #include "wtf/RefPtr.h" |
| 34 #include "wtf/ThreadingPrimitives.h" | 34 #include "wtf/ThreadingPrimitives.h" |
| 35 #include <memory> | 35 #include <memory> |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 // WaveShaperProcessor is an AudioDSPKernelProcessor which uses WaveShaperDSPKer
nel objects to implement non-linear distortion effects. | 39 // WaveShaperProcessor is an AudioDSPKernelProcessor which uses |
| 40 // WaveShaperDSPKernel objects to implement non-linear distortion effects. |
| 40 | 41 |
| 41 class WaveShaperProcessor final : public AudioDSPKernelProcessor { | 42 class WaveShaperProcessor final : public AudioDSPKernelProcessor { |
| 42 public: | 43 public: |
| 43 enum OverSampleType { OverSampleNone, OverSample2x, OverSample4x }; | 44 enum OverSampleType { OverSampleNone, OverSample2x, OverSample4x }; |
| 44 | 45 |
| 45 WaveShaperProcessor(float sampleRate, size_t numberOfChannels); | 46 WaveShaperProcessor(float sampleRate, size_t numberOfChannels); |
| 46 | 47 |
| 47 ~WaveShaperProcessor() override; | 48 ~WaveShaperProcessor() override; |
| 48 | 49 |
| 49 std::unique_ptr<AudioDSPKernel> createKernel() override; | 50 std::unique_ptr<AudioDSPKernel> createKernel() override; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 61 private: | 62 private: |
| 62 // m_curve represents the non-linear shaping curve. | 63 // m_curve represents the non-linear shaping curve. |
| 63 std::unique_ptr<Vector<float>> m_curve; | 64 std::unique_ptr<Vector<float>> m_curve; |
| 64 | 65 |
| 65 OverSampleType m_oversample; | 66 OverSampleType m_oversample; |
| 66 }; | 67 }; |
| 67 | 68 |
| 68 } // namespace blink | 69 } // namespace blink |
| 69 | 70 |
| 70 #endif // WaveShaperProcessor_h | 71 #endif // WaveShaperProcessor_h |
| OLD | NEW |