| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 class ExceptionState; | 45 class ExceptionState; |
| 46 | 46 |
| 47 // An AudioNode is the basic building block for handling audio within an AudioCo
ntext. | 47 // An AudioNode is the basic building block for handling audio within an AudioCo
ntext. |
| 48 // It may be an audio source, an intermediate processing module, or an audio des
tination. | 48 // It may be an audio source, an intermediate processing module, or an audio des
tination. |
| 49 // Each AudioNode can have inputs and/or outputs. An AudioSourceNode has no inpu
ts and a single output. | 49 // Each AudioNode can have inputs and/or outputs. An AudioSourceNode has no inpu
ts and a single output. |
| 50 // An AudioDestinationNode has one input and no outputs and represents the final
destination to the audio hardware. | 50 // An AudioDestinationNode has one input and no outputs and represents the final
destination to the audio hardware. |
| 51 // Most processing nodes such as filters will have one input and one output, alt
hough multiple inputs and outputs are possible. | 51 // Most processing nodes such as filters will have one input and one output, alt
hough multiple inputs and outputs are possible. |
| 52 | 52 |
| 53 // AudioNode has its own ref-counting mechanism that use RefTypes so we cannot u
se RefCountedGarbageCollected. | 53 // AudioNode has its own ref-counting mechanism that use RefTypes so we cannot u
se RefCountedGarbageCollected. |
| 54 class AudioNode : public NoBaseWillBeGarbageCollectedFinalized<AudioNode>, publi
c ScriptWrappable, public EventTargetWithInlineData { | 54 class AudioNode : public NoBaseWillBeGarbageCollectedFinalized<AudioNode>, publi
c ScriptWrappable, public EventTargetWithInlineData { |
| 55 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(AudioNode); |
| 55 public: | 56 public: |
| 56 enum { ProcessingSizeInFrames = 128 }; | 57 enum { ProcessingSizeInFrames = 128 }; |
| 57 | 58 |
| 58 AudioNode(AudioContext*, float sampleRate); | 59 AudioNode(AudioContext*, float sampleRate); |
| 59 virtual ~AudioNode(); | 60 virtual ~AudioNode(); |
| 60 | 61 |
| 61 AudioContext* context() { return m_context.get(); } | 62 AudioContext* context() { return m_context.get(); } |
| 62 const AudioContext* context() const { return m_context.get(); } | 63 const AudioContext* context() const { return m_context.get(); } |
| 63 | 64 |
| 64 enum NodeType { | 65 enum NodeType { |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 String channelInterpretation(); | 174 String channelInterpretation(); |
| 174 void setChannelInterpretation(const String&, ExceptionState&); | 175 void setChannelInterpretation(const String&, ExceptionState&); |
| 175 | 176 |
| 176 ChannelCountMode internalChannelCountMode() const { return m_channelCountMod
e; } | 177 ChannelCountMode internalChannelCountMode() const { return m_channelCountMod
e; } |
| 177 AudioBus::ChannelInterpretation internalChannelInterpretation() const { retu
rn m_channelInterpretation; } | 178 AudioBus::ChannelInterpretation internalChannelInterpretation() const { retu
rn m_channelInterpretation; } |
| 178 | 179 |
| 179 // EventTarget | 180 // EventTarget |
| 180 virtual const AtomicString& interfaceName() const OVERRIDE FINAL; | 181 virtual const AtomicString& interfaceName() const OVERRIDE FINAL; |
| 181 virtual ExecutionContext* executionContext() const OVERRIDE FINAL; | 182 virtual ExecutionContext* executionContext() const OVERRIDE FINAL; |
| 182 | 183 |
| 183 virtual void trace(Visitor*); | 184 virtual void trace(Visitor*) OVERRIDE; |
| 184 | 185 |
| 185 #if ENABLE(OILPAN) | 186 #if ENABLE(OILPAN) |
| 186 void clearKeepAlive(); | 187 void clearKeepAlive(); |
| 187 #endif | 188 #endif |
| 188 | 189 |
| 189 protected: | 190 protected: |
| 190 // Inputs and outputs must be created before the AudioNode is initialized. | 191 // Inputs and outputs must be created before the AudioNode is initialized. |
| 191 void addInput(PassOwnPtr<AudioNodeInput>); | 192 void addInput(PassOwnPtr<AudioNodeInput>); |
| 192 void addOutput(PassOwnPtr<AudioNodeOutput>); | 193 void addOutput(PassOwnPtr<AudioNodeOutput>); |
| 193 | 194 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 240 |
| 240 protected: | 241 protected: |
| 241 unsigned m_channelCount; | 242 unsigned m_channelCount; |
| 242 ChannelCountMode m_channelCountMode; | 243 ChannelCountMode m_channelCountMode; |
| 243 AudioBus::ChannelInterpretation m_channelInterpretation; | 244 AudioBus::ChannelInterpretation m_channelInterpretation; |
| 244 }; | 245 }; |
| 245 | 246 |
| 246 } // namespace WebCore | 247 } // namespace WebCore |
| 247 | 248 |
| 248 #endif // AudioNode_h | 249 #endif // AudioNode_h |
| OLD | NEW |