| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 class AudioSummingJunction; | 61 class AudioSummingJunction; |
| 62 class BiquadFilterNode; | 62 class BiquadFilterNode; |
| 63 class DelayNode; | 63 class DelayNode; |
| 64 class Document; | 64 class Document; |
| 65 class ConvolverNode; | 65 class ConvolverNode; |
| 66 class DynamicsCompressorNode; | 66 class DynamicsCompressorNode; |
| 67 class AnalyserNode; | 67 class AnalyserNode; |
| 68 class WaveShaperNode; | 68 class WaveShaperNode; |
| 69 class ScriptProcessorNode; | 69 class ScriptProcessorNode; |
| 70 class OscillatorNode; | 70 class OscillatorNode; |
| 71 class WaveTable; | 71 class PeriodicWave; |
| 72 | 72 |
| 73 // AudioContext is the cornerstone of the web audio API and all AudioNodes are c
reated from it. | 73 // AudioContext is the cornerstone of the web audio API and all AudioNodes are c
reated from it. |
| 74 // For thread safety between the audio thread and the main thread, it has a rend
ering graph locking mechanism. | 74 // For thread safety between the audio thread and the main thread, it has a rend
ering graph locking mechanism. |
| 75 | 75 |
| 76 class AudioContext : public ActiveDOMObject, public ScriptWrappable, public Thre
adSafeRefCounted<AudioContext>, public EventTarget { | 76 class AudioContext : public ActiveDOMObject, public ScriptWrappable, public Thre
adSafeRefCounted<AudioContext>, public EventTarget { |
| 77 public: | 77 public: |
| 78 // Create an AudioContext for rendering to the audio hardware. | 78 // Create an AudioContext for rendering to the audio hardware. |
| 79 static PassRefPtr<AudioContext> create(Document*); | 79 static PassRefPtr<AudioContext> create(Document*); |
| 80 | 80 |
| 81 // Create an AudioContext for offline (non-realtime) rendering. | 81 // Create an AudioContext for offline (non-realtime) rendering. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 PassRefPtr<DynamicsCompressorNode> createDynamicsCompressor(); | 130 PassRefPtr<DynamicsCompressorNode> createDynamicsCompressor(); |
| 131 PassRefPtr<AnalyserNode> createAnalyser(); | 131 PassRefPtr<AnalyserNode> createAnalyser(); |
| 132 PassRefPtr<ScriptProcessorNode> createScriptProcessor(size_t bufferSize, Exc
eptionCode&); | 132 PassRefPtr<ScriptProcessorNode> createScriptProcessor(size_t bufferSize, Exc
eptionCode&); |
| 133 PassRefPtr<ScriptProcessorNode> createScriptProcessor(size_t bufferSize, siz
e_t numberOfInputChannels, ExceptionCode&); | 133 PassRefPtr<ScriptProcessorNode> createScriptProcessor(size_t bufferSize, siz
e_t numberOfInputChannels, ExceptionCode&); |
| 134 PassRefPtr<ScriptProcessorNode> createScriptProcessor(size_t bufferSize, siz
e_t numberOfInputChannels, size_t numberOfOutputChannels, ExceptionCode&); | 134 PassRefPtr<ScriptProcessorNode> createScriptProcessor(size_t bufferSize, siz
e_t numberOfInputChannels, size_t numberOfOutputChannels, ExceptionCode&); |
| 135 PassRefPtr<ChannelSplitterNode> createChannelSplitter(ExceptionCode&); | 135 PassRefPtr<ChannelSplitterNode> createChannelSplitter(ExceptionCode&); |
| 136 PassRefPtr<ChannelSplitterNode> createChannelSplitter(size_t numberOfOutputs
, ExceptionCode&); | 136 PassRefPtr<ChannelSplitterNode> createChannelSplitter(size_t numberOfOutputs
, ExceptionCode&); |
| 137 PassRefPtr<ChannelMergerNode> createChannelMerger(ExceptionCode&); | 137 PassRefPtr<ChannelMergerNode> createChannelMerger(ExceptionCode&); |
| 138 PassRefPtr<ChannelMergerNode> createChannelMerger(size_t numberOfInputs, Exc
eptionCode&); | 138 PassRefPtr<ChannelMergerNode> createChannelMerger(size_t numberOfInputs, Exc
eptionCode&); |
| 139 PassRefPtr<OscillatorNode> createOscillator(); | 139 PassRefPtr<OscillatorNode> createOscillator(); |
| 140 PassRefPtr<WaveTable> createWaveTable(Float32Array* real, Float32Array* imag
, ExceptionCode&); | 140 PassRefPtr<PeriodicWave> createPeriodicWave(Float32Array* real, Float32Array
* imag, ExceptionCode&); |
| 141 | 141 |
| 142 // When a source node has no more processing to do (has finished playing), t
hen it tells the context to dereference it. | 142 // When a source node has no more processing to do (has finished playing), t
hen it tells the context to dereference it. |
| 143 void notifyNodeFinishedProcessing(AudioNode*); | 143 void notifyNodeFinishedProcessing(AudioNode*); |
| 144 | 144 |
| 145 // Called at the start of each render quantum. | 145 // Called at the start of each render quantum. |
| 146 void handlePreRenderTasks(); | 146 void handlePreRenderTasks(); |
| 147 | 147 |
| 148 // Called at the end of each render quantum. | 148 // Called at the end of each render quantum. |
| 149 void handlePostRenderTasks(); | 149 void handlePostRenderTasks(); |
| 150 | 150 |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 // It is somewhat arbitrary and could be increased if necessary. | 347 // It is somewhat arbitrary and could be increased if necessary. |
| 348 enum { MaxNumberOfChannels = 32 }; | 348 enum { MaxNumberOfChannels = 32 }; |
| 349 | 349 |
| 350 // Number of AudioBufferSourceNodes that are active (playing). | 350 // Number of AudioBufferSourceNodes that are active (playing). |
| 351 int m_activeSourceCount; | 351 int m_activeSourceCount; |
| 352 }; | 352 }; |
| 353 | 353 |
| 354 } // WebCore | 354 } // WebCore |
| 355 | 355 |
| 356 #endif // AudioContext_h | 356 #endif // AudioContext_h |
| OLD | NEW |