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 15 matching lines...) Expand all Loading... |
26 #ifndef AudioBasicInspectorNode_h | 26 #ifndef AudioBasicInspectorNode_h |
27 #define AudioBasicInspectorNode_h | 27 #define AudioBasicInspectorNode_h |
28 | 28 |
29 #include "modules/webaudio/AudioNode.h" | 29 #include "modules/webaudio/AudioNode.h" |
30 | 30 |
31 namespace blink { | 31 namespace blink { |
32 | 32 |
33 class BaseAudioContext; | 33 class BaseAudioContext; |
34 class ExceptionState; | 34 class ExceptionState; |
35 | 35 |
36 // AudioBasicInspectorNode is an AudioNode with one input and one output where t
he output might not necessarily connect to another node's input. | 36 // AudioBasicInspectorNode is an AudioNode with one input and one output where |
37 // If the output is not connected to any other node, then the AudioBasicInspecto
rNode's processIfNecessary() function will be called automatically by | 37 // the output might not necessarily connect to another node's input. |
38 // BaseAudioContext before the end of each render quantum so that it can inspect
the audio stream. | 38 // If the output is not connected to any other node, then the |
| 39 // AudioBasicInspectorNode's processIfNecessary() function will be called |
| 40 // automatically by BaseAudioContext before the end of each render quantum so |
| 41 // that it can inspect the audio stream. |
39 class AudioBasicInspectorHandler : public AudioHandler { | 42 class AudioBasicInspectorHandler : public AudioHandler { |
40 public: | 43 public: |
41 AudioBasicInspectorHandler(NodeType, | 44 AudioBasicInspectorHandler(NodeType, |
42 AudioNode&, | 45 AudioNode&, |
43 float sampleRate, | 46 float sampleRate, |
44 unsigned outputChannelCount); | 47 unsigned outputChannelCount); |
45 | 48 |
46 // AudioHandler | 49 // AudioHandler |
47 void pullInputs(size_t framesToProcess) final; | 50 void pullInputs(size_t framesToProcess) final; |
48 void checkNumberOfChannelsForInput(AudioNodeInput*) final; | 51 void checkNumberOfChannelsForInput(AudioNodeInput*) final; |
49 | 52 |
50 void updatePullStatus(); | 53 void updatePullStatus(); |
51 | 54 |
52 private: | 55 private: |
53 bool | 56 // When setting to true, AudioBasicInspectorHandler will be pulled |
54 m_needAutomaticPull; // When setting to true, AudioBasicInspectorHandler
will be pulled automaticlly by BaseAudioContext before the end of each render qu
antum. | 57 // automaticlly by BaseAudioContext before the end of each render quantum. |
| 58 bool m_needAutomaticPull; |
55 }; | 59 }; |
56 | 60 |
57 class AudioBasicInspectorNode : public AudioNode { | 61 class AudioBasicInspectorNode : public AudioNode { |
58 protected: | 62 protected: |
59 explicit AudioBasicInspectorNode(BaseAudioContext& context) | 63 explicit AudioBasicInspectorNode(BaseAudioContext& context) |
60 : AudioNode(context) {} | 64 : AudioNode(context) {} |
61 | 65 |
62 private: | 66 private: |
63 // TODO(tkent): Should AudioBasicInspectorNode override other variants of | 67 // TODO(tkent): Should AudioBasicInspectorNode override other variants of |
64 // connect() and disconnect()? | 68 // connect() and disconnect()? |
65 AudioNode* connect(AudioNode*, | 69 AudioNode* connect(AudioNode*, |
66 unsigned outputIndex, | 70 unsigned outputIndex, |
67 unsigned inputIndex, | 71 unsigned inputIndex, |
68 ExceptionState&) final; | 72 ExceptionState&) final; |
69 void disconnect(unsigned outputIndex, ExceptionState&) final; | 73 void disconnect(unsigned outputIndex, ExceptionState&) final; |
70 }; | 74 }; |
71 | 75 |
72 } // namespace blink | 76 } // namespace blink |
73 | 77 |
74 #endif // AudioBasicInspectorNode_h | 78 #endif // AudioBasicInspectorNode_h |
OLD | NEW |