| 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 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 #ifndef AnalyserNode_h | 25 #ifndef AnalyserNode_h |
| 26 #define AnalyserNode_h | 26 #define AnalyserNode_h |
| 27 | 27 |
| 28 #include "core/dom/DOMTypedArray.h" | 28 #include "core/dom/DOMTypedArray.h" |
| 29 #include "modules/webaudio/AudioBasicInspectorNode.h" | 29 #include "modules/webaudio/AudioBasicInspectorNode.h" |
| 30 #include "modules/webaudio/RealtimeAnalyser.h" | 30 #include "modules/webaudio/RealtimeAnalyser.h" |
| 31 | 31 |
| 32 namespace blink { | 32 namespace blink { |
| 33 | 33 |
| 34 class AbstractAudioContext; |
| 34 class ExceptionState; | 35 class ExceptionState; |
| 35 | 36 |
| 36 class AnalyserHandler final : public AudioBasicInspectorHandler { | 37 class AnalyserHandler final : public AudioBasicInspectorHandler { |
| 37 public: | 38 public: |
| 38 static PassRefPtr<AnalyserHandler> create(AudioNode&, float sampleRate); | 39 static PassRefPtr<AnalyserHandler> create(AudioNode&, float sampleRate); |
| 39 ~AnalyserHandler() override; | 40 ~AnalyserHandler() override; |
| 40 | 41 |
| 41 // AudioHandler | 42 // AudioHandler |
| 42 void process(size_t framesToProcess) override; | 43 void process(size_t framesToProcess) override; |
| 43 | 44 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 62 | 63 |
| 63 private: | 64 private: |
| 64 AnalyserHandler(AudioNode&, float sampleRate); | 65 AnalyserHandler(AudioNode&, float sampleRate); |
| 65 | 66 |
| 66 RealtimeAnalyser m_analyser; | 67 RealtimeAnalyser m_analyser; |
| 67 }; | 68 }; |
| 68 | 69 |
| 69 class AnalyserNode final : public AudioBasicInspectorNode { | 70 class AnalyserNode final : public AudioBasicInspectorNode { |
| 70 DEFINE_WRAPPERTYPEINFO(); | 71 DEFINE_WRAPPERTYPEINFO(); |
| 71 public: | 72 public: |
| 72 static AnalyserNode* create(AudioContext&, float sampleRate); | 73 static AnalyserNode* create(AbstractAudioContext&, float sampleRate); |
| 73 | 74 |
| 74 unsigned fftSize() const; | 75 unsigned fftSize() const; |
| 75 void setFftSize(unsigned size, ExceptionState&); | 76 void setFftSize(unsigned size, ExceptionState&); |
| 76 unsigned frequencyBinCount() const; | 77 unsigned frequencyBinCount() const; |
| 77 void setMinDecibels(double, ExceptionState&); | 78 void setMinDecibels(double, ExceptionState&); |
| 78 double minDecibels() const; | 79 double minDecibels() const; |
| 79 void setMaxDecibels(double, ExceptionState&); | 80 void setMaxDecibels(double, ExceptionState&); |
| 80 double maxDecibels() const; | 81 double maxDecibels() const; |
| 81 void setSmoothingTimeConstant(double, ExceptionState&); | 82 void setSmoothingTimeConstant(double, ExceptionState&); |
| 82 double smoothingTimeConstant() const; | 83 double smoothingTimeConstant() const; |
| 83 void getFloatFrequencyData(DOMFloat32Array*); | 84 void getFloatFrequencyData(DOMFloat32Array*); |
| 84 void getByteFrequencyData(DOMUint8Array*); | 85 void getByteFrequencyData(DOMUint8Array*); |
| 85 void getFloatTimeDomainData(DOMFloat32Array*); | 86 void getFloatTimeDomainData(DOMFloat32Array*); |
| 86 void getByteTimeDomainData(DOMUint8Array*); | 87 void getByteTimeDomainData(DOMUint8Array*); |
| 87 | 88 |
| 88 private: | 89 private: |
| 89 AnalyserNode(AudioContext&, float sampleRate); | 90 AnalyserNode(AbstractAudioContext&, float sampleRate); |
| 90 AnalyserHandler& analyserHandler() const; | 91 AnalyserHandler& analyserHandler() const; |
| 91 }; | 92 }; |
| 92 | 93 |
| 93 } // namespace blink | 94 } // namespace blink |
| 94 | 95 |
| 95 #endif // AnalyserNode_h | 96 #endif // AnalyserNode_h |
| OLD | NEW |