| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012, Intel Corporation. All rights reserved. | 2 * Copyright (C) 2012, Intel Corporation. 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 11 matching lines...) Expand all Loading... |
| 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 #ifndef AudioBasicInspectorNode_h | 25 #ifndef AudioBasicInspectorNode_h |
| 26 #define AudioBasicInspectorNode_h | 26 #define AudioBasicInspectorNode_h |
| 27 | 27 |
| 28 #include "modules/webaudio/AudioNode.h" | 28 #include "modules/webaudio/AudioNode.h" |
| 29 | 29 |
| 30 namespace blink { | 30 namespace blink { |
| 31 | 31 |
| 32 class AbstractAudioContext; |
| 32 class ExceptionState; | 33 class ExceptionState; |
| 33 | 34 |
| 34 // AudioBasicInspectorNode is an AudioNode with one input and one output where t
he output might not necessarily connect to another node's input. | 35 // AudioBasicInspectorNode is an AudioNode with one input and one output where t
he output might not necessarily connect to another node's input. |
| 35 // If the output is not connected to any other node, then the AudioBasicInspecto
rNode's processIfNecessary() function will be called automatically by | 36 // If the output is not connected to any other node, then the AudioBasicInspecto
rNode's processIfNecessary() function will be called automatically by |
| 36 // AudioContext before the end of each render quantum so that it can inspect the
audio stream. | 37 // AbstractAudioContext before the end of each render quantum so that it can ins
pect the audio stream. |
| 37 class AudioBasicInspectorHandler : public AudioHandler { | 38 class AudioBasicInspectorHandler : public AudioHandler { |
| 38 public: | 39 public: |
| 39 AudioBasicInspectorHandler(NodeType, AudioNode&, float sampleRate, unsigned
outputChannelCount); | 40 AudioBasicInspectorHandler(NodeType, AudioNode&, float sampleRate, unsigned
outputChannelCount); |
| 40 | 41 |
| 41 // AudioHandler | 42 // AudioHandler |
| 42 void pullInputs(size_t framesToProcess) final; | 43 void pullInputs(size_t framesToProcess) final; |
| 43 void checkNumberOfChannelsForInput(AudioNodeInput*) final; | 44 void checkNumberOfChannelsForInput(AudioNodeInput*) final; |
| 44 | 45 |
| 45 void updatePullStatus(); | 46 void updatePullStatus(); |
| 46 | 47 |
| 47 private: | 48 private: |
| 48 bool m_needAutomaticPull; // When setting to true, AudioBasicInspectorHandle
r will be pulled automaticlly by AudioContext before the end of each render quan
tum. | 49 bool m_needAutomaticPull; // When setting to true, AudioBasicInspectorHandle
r will be pulled automaticlly by AbstractAudioContext before the end of each ren
der quantum. |
| 49 }; | 50 }; |
| 50 | 51 |
| 51 class AudioBasicInspectorNode : public AudioNode { | 52 class AudioBasicInspectorNode : public AudioNode { |
| 52 protected: | 53 protected: |
| 53 explicit AudioBasicInspectorNode(AudioContext& context) : AudioNode(context)
{ } | 54 explicit AudioBasicInspectorNode(AbstractAudioContext& context) : AudioNode(
context) { } |
| 54 | 55 |
| 55 private: | 56 private: |
| 56 // TODO(tkent): Should AudioBasicInspectorNode override other variants of | 57 // TODO(tkent): Should AudioBasicInspectorNode override other variants of |
| 57 // connect() and disconnect()? | 58 // connect() and disconnect()? |
| 58 void connect(AudioNode*, unsigned outputIndex, unsigned inputIndex, Exceptio
nState&) final; | 59 void connect(AudioNode*, unsigned outputIndex, unsigned inputIndex, Exceptio
nState&) final; |
| 59 void disconnect(unsigned outputIndex, ExceptionState&) final; | 60 void disconnect(unsigned outputIndex, ExceptionState&) final; |
| 60 }; | 61 }; |
| 61 | 62 |
| 62 } // namespace blink | 63 } // namespace blink |
| 63 | 64 |
| 64 #endif // AudioBasicInspectorNode_h | 65 #endif // AudioBasicInspectorNode_h |
| OLD | NEW |