| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 #include "modules/webaudio/DelayNode.h" | 53 #include "modules/webaudio/DelayNode.h" |
| 54 #include "modules/webaudio/DynamicsCompressorNode.h" | 54 #include "modules/webaudio/DynamicsCompressorNode.h" |
| 55 #include "modules/webaudio/GainNode.h" | 55 #include "modules/webaudio/GainNode.h" |
| 56 #include "modules/webaudio/MediaElementAudioSourceNode.h" | 56 #include "modules/webaudio/MediaElementAudioSourceNode.h" |
| 57 #include "modules/webaudio/MediaStreamAudioDestinationNode.h" | 57 #include "modules/webaudio/MediaStreamAudioDestinationNode.h" |
| 58 #include "modules/webaudio/MediaStreamAudioSourceNode.h" | 58 #include "modules/webaudio/MediaStreamAudioSourceNode.h" |
| 59 #include "modules/webaudio/OfflineAudioCompletionEvent.h" | 59 #include "modules/webaudio/OfflineAudioCompletionEvent.h" |
| 60 #include "modules/webaudio/OfflineAudioDestinationNode.h" | 60 #include "modules/webaudio/OfflineAudioDestinationNode.h" |
| 61 #include "modules/webaudio/OscillatorNode.h" | 61 #include "modules/webaudio/OscillatorNode.h" |
| 62 #include "modules/webaudio/PannerNode.h" | 62 #include "modules/webaudio/PannerNode.h" |
| 63 #include "modules/webaudio/PeriodicWave.h" |
| 63 #include "modules/webaudio/ScriptProcessorNode.h" | 64 #include "modules/webaudio/ScriptProcessorNode.h" |
| 64 #include "modules/webaudio/WaveShaperNode.h" | 65 #include "modules/webaudio/WaveShaperNode.h" |
| 65 #include "modules/webaudio/WaveTable.h" | |
| 66 #include "wtf/MemoryInstrumentationHashSet.h" | 66 #include "wtf/MemoryInstrumentationHashSet.h" |
| 67 #include "wtf/MemoryInstrumentationVector.h" | 67 #include "wtf/MemoryInstrumentationVector.h" |
| 68 | 68 |
| 69 #if DEBUG_AUDIONODE_REFERENCES | 69 #if DEBUG_AUDIONODE_REFERENCES |
| 70 #include <stdio.h> | 70 #include <stdio.h> |
| 71 #endif | 71 #endif |
| 72 | 72 |
| 73 #include "wtf/ArrayBuffer.h" | 73 #include "wtf/ArrayBuffer.h" |
| 74 #include "wtf/Atomics.h" | 74 #include "wtf/Atomics.h" |
| 75 #include "wtf/MainThread.h" | 75 #include "wtf/MainThread.h" |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 | 549 |
| 550 RefPtr<OscillatorNode> node = OscillatorNode::create(this, m_destinationNode
->sampleRate()); | 550 RefPtr<OscillatorNode> node = OscillatorNode::create(this, m_destinationNode
->sampleRate()); |
| 551 | 551 |
| 552 // Because this is an AudioScheduledSourceNode, the context keeps a referenc
e until it has finished playing. | 552 // Because this is an AudioScheduledSourceNode, the context keeps a referenc
e until it has finished playing. |
| 553 // When this happens, AudioScheduledSourceNode::finish() calls AudioContext:
:notifyNodeFinishedProcessing(). | 553 // When this happens, AudioScheduledSourceNode::finish() calls AudioContext:
:notifyNodeFinishedProcessing(). |
| 554 refNode(node.get()); | 554 refNode(node.get()); |
| 555 | 555 |
| 556 return node; | 556 return node; |
| 557 } | 557 } |
| 558 | 558 |
| 559 PassRefPtr<WaveTable> AudioContext::createWaveTable(Float32Array* real, Float32A
rray* imag, ExceptionCode& ec) | 559 PassRefPtr<PeriodicWave> AudioContext::createPeriodicWave(Float32Array* real, Fl
oat32Array* imag, ExceptionCode& ec) |
| 560 { | 560 { |
| 561 ASSERT(isMainThread()); | 561 ASSERT(isMainThread()); |
| 562 | 562 |
| 563 if (!real || !imag || (real->length() != imag->length())) { | 563 if (!real || !imag || (real->length() != imag->length())) { |
| 564 ec = SYNTAX_ERR; | 564 ec = SYNTAX_ERR; |
| 565 return 0; | 565 return 0; |
| 566 } | 566 } |
| 567 | 567 |
| 568 lazyInitialize(); | 568 lazyInitialize(); |
| 569 return WaveTable::create(sampleRate(), real, imag); | 569 return PeriodicWave::create(sampleRate(), real, imag); |
| 570 } | 570 } |
| 571 | 571 |
| 572 void AudioContext::notifyNodeFinishedProcessing(AudioNode* node) | 572 void AudioContext::notifyNodeFinishedProcessing(AudioNode* node) |
| 573 { | 573 { |
| 574 ASSERT(isAudioThread()); | 574 ASSERT(isAudioThread()); |
| 575 m_finishedNodes.append(node); | 575 m_finishedNodes.append(node); |
| 576 } | 576 } |
| 577 | 577 |
| 578 void AudioContext::derefFinishedSourceNodes() | 578 void AudioContext::derefFinishedSourceNodes() |
| 579 { | 579 { |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 info.addMember(m_deferredFinishDerefList, "deferredFinishDerefList"); | 979 info.addMember(m_deferredFinishDerefList, "deferredFinishDerefList"); |
| 980 info.addMember(m_hrtfDatabaseLoader, "hrtfDatabaseLoader"); | 980 info.addMember(m_hrtfDatabaseLoader, "hrtfDatabaseLoader"); |
| 981 info.addMember(m_eventTargetData, "eventTargetData"); | 981 info.addMember(m_eventTargetData, "eventTargetData"); |
| 982 info.addMember(m_renderTarget, "renderTarget"); | 982 info.addMember(m_renderTarget, "renderTarget"); |
| 983 info.addMember(m_audioDecoder, "audioDecoder"); | 983 info.addMember(m_audioDecoder, "audioDecoder"); |
| 984 } | 984 } |
| 985 | 985 |
| 986 } // namespace WebCore | 986 } // namespace WebCore |
| 987 | 987 |
| 988 #endif // ENABLE(WEB_AUDIO) | 988 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |