| 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 BaseAudioContext; |
| 33 class ExceptionState; | 33 class ExceptionState; |
| 34 | 34 |
| 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 // AudioBasicInspectorNode is an AudioNode with one input and one output where t
he output might not necessarily connect to another node's input. |
| 36 // 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 |
| 37 // AbstractAudioContext before the end of each render quantum so that it can ins
pect the audio stream. | 37 // BaseAudioContext before the end of each render quantum so that it can inspect
the audio stream. |
| 38 class AudioBasicInspectorHandler : public AudioHandler { | 38 class AudioBasicInspectorHandler : public AudioHandler { |
| 39 public: | 39 public: |
| 40 AudioBasicInspectorHandler(NodeType, AudioNode&, float sampleRate, unsigned
outputChannelCount); | 40 AudioBasicInspectorHandler(NodeType, AudioNode&, float sampleRate, unsigned
outputChannelCount); |
| 41 | 41 |
| 42 // AudioHandler | 42 // AudioHandler |
| 43 void pullInputs(size_t framesToProcess) final; | 43 void pullInputs(size_t framesToProcess) final; |
| 44 void checkNumberOfChannelsForInput(AudioNodeInput*) final; | 44 void checkNumberOfChannelsForInput(AudioNodeInput*) final; |
| 45 | 45 |
| 46 void updatePullStatus(); | 46 void updatePullStatus(); |
| 47 | 47 |
| 48 private: | 48 private: |
| 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 bool m_needAutomaticPull; // When setting to true, AudioBasicInspectorHandle
r will be pulled automaticlly by BaseAudioContext before the end of each render
quantum. |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 class AudioBasicInspectorNode : public AudioNode { | 52 class AudioBasicInspectorNode : public AudioNode { |
| 53 protected: | 53 protected: |
| 54 explicit AudioBasicInspectorNode(AbstractAudioContext& context) : AudioNode(
context) { } | 54 explicit AudioBasicInspectorNode(BaseAudioContext& context) : AudioNode(cont
ext) { } |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 // TODO(tkent): Should AudioBasicInspectorNode override other variants of | 57 // TODO(tkent): Should AudioBasicInspectorNode override other variants of |
| 58 // connect() and disconnect()? | 58 // connect() and disconnect()? |
| 59 AudioNode* connect(AudioNode*, unsigned outputIndex, unsigned inputIndex, Ex
ceptionState&) final; | 59 AudioNode* connect(AudioNode*, unsigned outputIndex, unsigned inputIndex, Ex
ceptionState&) final; |
| 60 void disconnect(unsigned outputIndex, ExceptionState&) final; | 60 void disconnect(unsigned outputIndex, ExceptionState&) final; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 } // namespace blink | 63 } // namespace blink |
| 64 | 64 |
| 65 #endif // AudioBasicInspectorNode_h | 65 #endif // AudioBasicInspectorNode_h |
| OLD | NEW |