OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 { | 103 { |
104 if (type > BiquadProcessor::Allpass) | 104 if (type > BiquadProcessor::Allpass) |
105 return false; | 105 return false; |
106 | 106 |
107 biquadProcessor()->setType(static_cast<BiquadProcessor::FilterType>(type)); | 107 biquadProcessor()->setType(static_cast<BiquadProcessor::FilterType>(type)); |
108 return true; | 108 return true; |
109 } | 109 } |
110 | 110 |
111 void BiquadFilterNode::getFrequencyResponse(const DOMFloat32Array* frequencyHz,
DOMFloat32Array* magResponse, DOMFloat32Array* phaseResponse) | 111 void BiquadFilterNode::getFrequencyResponse(const DOMFloat32Array* frequencyHz,
DOMFloat32Array* magResponse, DOMFloat32Array* phaseResponse) |
112 { | 112 { |
113 if (!frequencyHz || !magResponse || !phaseResponse) | 113 ASSERT(frequencyHz && magResponse && phaseResponse); |
114 return; | |
115 | 114 |
116 int n = std::min(frequencyHz->length(), std::min(magResponse->length(), phas
eResponse->length())); | 115 int n = std::min(frequencyHz->length(), std::min(magResponse->length(), phas
eResponse->length())); |
117 if (n) | 116 if (n) |
118 biquadProcessor()->getFrequencyResponse(n, frequencyHz->data(), magRespo
nse->data(), phaseResponse->data()); | 117 biquadProcessor()->getFrequencyResponse(n, frequencyHz->data(), magRespo
nse->data(), phaseResponse->data()); |
119 } | 118 } |
120 | 119 |
121 } // namespace blink | 120 } // namespace blink |
122 | 121 |
123 #endif // ENABLE(WEB_AUDIO) | 122 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |