| 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/IIRFilterNode.h" | 53 #include "modules/webaudio/IIRFilterNode.h" |
| 54 #include "modules/webaudio/MediaElementAudioSourceNode.h" | 54 #include "modules/webaudio/MediaElementAudioSourceNode.h" |
| 55 #include "modules/webaudio/MediaStreamAudioDestinationNode.h" | 55 #include "modules/webaudio/MediaStreamAudioDestinationNode.h" |
| 56 #include "modules/webaudio/MediaStreamAudioSourceNode.h" | 56 #include "modules/webaudio/MediaStreamAudioSourceNode.h" |
| 57 #include "modules/webaudio/OfflineAudioCompletionEvent.h" | 57 #include "modules/webaudio/OfflineAudioCompletionEvent.h" |
| 58 #include "modules/webaudio/OfflineAudioContext.h" | 58 #include "modules/webaudio/OfflineAudioContext.h" |
| 59 #include "modules/webaudio/OfflineAudioDestinationNode.h" | 59 #include "modules/webaudio/OfflineAudioDestinationNode.h" |
| 60 #include "modules/webaudio/OscillatorNode.h" | 60 #include "modules/webaudio/OscillatorNode.h" |
| 61 #include "modules/webaudio/PannerNode.h" | 61 #include "modules/webaudio/PannerNode.h" |
| 62 #include "modules/webaudio/PeriodicWave.h" | 62 #include "modules/webaudio/PeriodicWave.h" |
| 63 #include "modules/webaudio/PeriodicWaveConstraints.h" |
| 63 #include "modules/webaudio/ScriptProcessorNode.h" | 64 #include "modules/webaudio/ScriptProcessorNode.h" |
| 64 #include "modules/webaudio/StereoPannerNode.h" | 65 #include "modules/webaudio/StereoPannerNode.h" |
| 65 #include "modules/webaudio/WaveShaperNode.h" | 66 #include "modules/webaudio/WaveShaperNode.h" |
| 66 #include "platform/ThreadSafeFunctional.h" | 67 #include "platform/ThreadSafeFunctional.h" |
| 67 #include "platform/audio/IIRFilter.h" | 68 #include "platform/audio/IIRFilter.h" |
| 68 #include "public/platform/Platform.h" | 69 #include "public/platform/Platform.h" |
| 69 #include "wtf/text/WTFString.h" | 70 #include "wtf/text/WTFString.h" |
| 70 | 71 |
| 71 namespace blink { | 72 namespace blink { |
| 72 | 73 |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 // called. | 572 // called. |
| 572 | 573 |
| 573 return node; | 574 return node; |
| 574 } | 575 } |
| 575 | 576 |
| 576 PeriodicWave* AbstractAudioContext::createPeriodicWave(DOMFloat32Array* real, DO
MFloat32Array* imag, ExceptionState& exceptionState) | 577 PeriodicWave* AbstractAudioContext::createPeriodicWave(DOMFloat32Array* real, DO
MFloat32Array* imag, ExceptionState& exceptionState) |
| 577 { | 578 { |
| 578 return PeriodicWave::create(sampleRate(), real, imag, false); | 579 return PeriodicWave::create(sampleRate(), real, imag, false); |
| 579 } | 580 } |
| 580 | 581 |
| 581 PeriodicWave* AbstractAudioContext::createPeriodicWave(DOMFloat32Array* real, DO
MFloat32Array* imag, const Dictionary& options, ExceptionState& exceptionState) | 582 PeriodicWave* AbstractAudioContext::createPeriodicWave(DOMFloat32Array* real, DO
MFloat32Array* imag, const PeriodicWaveConstraints& options, ExceptionState& exc
eptionState) |
| 582 { | 583 { |
| 583 ASSERT(isMainThread()); | 584 ASSERT(isMainThread()); |
| 584 | 585 |
| 585 if (isContextClosed()) { | 586 if (isContextClosed()) { |
| 586 throwExceptionForClosedState(exceptionState); | 587 throwExceptionForClosedState(exceptionState); |
| 587 return nullptr; | 588 return nullptr; |
| 588 } | 589 } |
| 589 | 590 |
| 590 if (real->length() != imag->length()) { | 591 if (real->length() != imag->length()) { |
| 591 exceptionState.throwDOMException( | 592 exceptionState.throwDOMException( |
| 592 IndexSizeError, | 593 IndexSizeError, |
| 593 "length of real array (" + String::number(real->length()) | 594 "length of real array (" + String::number(real->length()) |
| 594 + ") and length of imaginary array (" + String::number(imag->length
()) | 595 + ") and length of imaginary array (" + String::number(imag->length
()) |
| 595 + ") must match."); | 596 + ") must match."); |
| 596 return nullptr; | 597 return nullptr; |
| 597 } | 598 } |
| 598 | 599 |
| 599 bool isNormalizationDisabled = false; | 600 bool disable = options.hasDisableNormalization() ? options.disableNormalizat
ion() : false; |
| 600 DictionaryHelper::getWithUndefinedOrNullCheck(options, "disableNormalization
", isNormalizationDisabled); | |
| 601 | 601 |
| 602 return PeriodicWave::create(sampleRate(), real, imag, isNormalizationDisable
d); | 602 return PeriodicWave::create(sampleRate(), real, imag, disable); |
| 603 } | 603 } |
| 604 | 604 |
| 605 IIRFilterNode* AbstractAudioContext::createIIRFilter(Vector<double> feedforwardC
oef, Vector<double> feedbackCoef, ExceptionState& exceptionState) | 605 IIRFilterNode* AbstractAudioContext::createIIRFilter(Vector<double> feedforwardC
oef, Vector<double> feedbackCoef, ExceptionState& exceptionState) |
| 606 { | 606 { |
| 607 ASSERT(isMainThread()); | 607 ASSERT(isMainThread()); |
| 608 | 608 |
| 609 if (isContextClosed()) { | 609 if (isContextClosed()) { |
| 610 throwExceptionForClosedState(exceptionState); | 610 throwExceptionForClosedState(exceptionState); |
| 611 return nullptr; | 611 return nullptr; |
| 612 } | 612 } |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 SecurityOrigin* AbstractAudioContext::getSecurityOrigin() const | 962 SecurityOrigin* AbstractAudioContext::getSecurityOrigin() const |
| 963 { | 963 { |
| 964 if (getExecutionContext()) | 964 if (getExecutionContext()) |
| 965 return getExecutionContext()->getSecurityOrigin(); | 965 return getExecutionContext()->getSecurityOrigin(); |
| 966 | 966 |
| 967 return nullptr; | 967 return nullptr; |
| 968 } | 968 } |
| 969 | 969 |
| 970 } // namespace blink | 970 } // namespace blink |
| 971 | 971 |
| OLD | NEW |