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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
113 // The AudioNodeInput(s) (if any) will already have their input data availab le when process() is called. | 113 // The AudioNodeInput(s) (if any) will already have their input data availab le when process() is called. |
114 // Subclasses will take this input data and put the results in the AudioBus( s) of its AudioNodeOutput(s) (if any). | 114 // Subclasses will take this input data and put the results in the AudioBus( s) of its AudioNodeOutput(s) (if any). |
115 // Called from context's audio thread. | 115 // Called from context's audio thread. |
116 virtual void process(size_t framesToProcess) = 0; | 116 virtual void process(size_t framesToProcess) = 0; |
117 | 117 |
118 // No significant resources should be allocated until initialize() is called . | 118 // No significant resources should be allocated until initialize() is called . |
119 // Processing may not occur until a node is initialized. | 119 // Processing may not occur until a node is initialized. |
120 virtual void initialize(); | 120 virtual void initialize(); |
121 virtual void uninitialize(); | 121 virtual void uninitialize(); |
122 | 122 |
123 // Clear internal state when the node is disabled. When a node is disabled, | |
124 // it is no longer pulled so any internal state is never updated. But some | |
125 // nodes (DynamicsCompressorNode) have internal state that is still | |
126 // accessible by the user. Update the internal state as if the node were | |
127 // still connected but processing all zeroes. This gives a consistent view | |
128 // to the user. | |
Raymond Toy
2014/10/21 23:25:51
Nit: I think blink style is to use one space after
hongchan
2014/10/21 23:43:21
Acknowledged.
| |
129 virtual void clearInternalStateWhenDisabled(); | |
130 | |
123 bool isInitialized() const { return m_isInitialized; } | 131 bool isInitialized() const { return m_isInitialized; } |
124 | 132 |
125 unsigned numberOfInputs() const { return m_inputs.size(); } | 133 unsigned numberOfInputs() const { return m_inputs.size(); } |
126 unsigned numberOfOutputs() const { return m_outputs.size(); } | 134 unsigned numberOfOutputs() const { return m_outputs.size(); } |
127 | 135 |
128 AudioNodeInput* input(unsigned); | 136 AudioNodeInput* input(unsigned); |
129 AudioNodeOutput* output(unsigned); | 137 AudioNodeOutput* output(unsigned); |
130 | 138 |
131 // Called from main thread by corresponding JavaScript methods. | 139 // Called from main thread by corresponding JavaScript methods. |
132 virtual void connect(AudioNode*, unsigned outputIndex, unsigned inputIndex, ExceptionState&); | 140 virtual void connect(AudioNode*, unsigned outputIndex, unsigned inputIndex, ExceptionState&); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 ChannelCountMode m_channelCountMode; | 234 ChannelCountMode m_channelCountMode; |
227 AudioBus::ChannelInterpretation m_channelInterpretation; | 235 AudioBus::ChannelInterpretation m_channelInterpretation; |
228 // The new channel count mode that will be used to set the actual mode in th e pre or post | 236 // The new channel count mode that will be used to set the actual mode in th e pre or post |
229 // rendering phase. | 237 // rendering phase. |
230 ChannelCountMode m_newChannelCountMode; | 238 ChannelCountMode m_newChannelCountMode; |
231 }; | 239 }; |
232 | 240 |
233 } // namespace blink | 241 } // namespace blink |
234 | 242 |
235 #endif // AudioNode_h | 243 #endif // AudioNode_h |
OLD | NEW |