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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 bool BiquadFilterNode::setType(unsigned type) | 86 bool BiquadFilterNode::setType(unsigned type) |
87 { | 87 { |
88 if (type > BiquadProcessor::Allpass) | 88 if (type > BiquadProcessor::Allpass) |
89 return false; | 89 return false; |
90 | 90 |
91 biquadProcessor()->setType(static_cast<BiquadProcessor::FilterType>(type)); | 91 biquadProcessor()->setType(static_cast<BiquadProcessor::FilterType>(type)); |
92 return true; | 92 return true; |
93 } | 93 } |
94 | 94 |
95 void BiquadFilterNode::getFrequencyResponse(const Float32Array* frequencyHz, | 95 void BiquadFilterNode::getFrequencyResponse(const DOMFloat32Array* frequencyHz,
DOMFloat32Array* magResponse, DOMFloat32Array* phaseResponse) |
96 Float32Array* magResponse, | |
97 Float32Array* phaseResponse) | |
98 { | 96 { |
99 if (!frequencyHz || !magResponse || !phaseResponse) | 97 if (!frequencyHz || !magResponse || !phaseResponse) |
100 return; | 98 return; |
101 | 99 |
102 int n = std::min(frequencyHz->length(), | 100 int n = std::min(frequencyHz->length(), |
103 std::min(magResponse->length(), phaseResponse->length())); | 101 std::min(magResponse->length(), phaseResponse->length())); |
104 | 102 |
105 if (n) { | 103 if (n) { |
106 biquadProcessor()->getFrequencyResponse(n, | 104 biquadProcessor()->getFrequencyResponse(n, |
107 frequencyHz->data(), | 105 frequencyHz->data(), |
108 magResponse->data(), | 106 magResponse->data(), |
109 phaseResponse->data()); | 107 phaseResponse->data()); |
110 } | 108 } |
111 } | 109 } |
112 | 110 |
113 } // namespace blink | 111 } // namespace blink |
114 | 112 |
115 #endif // ENABLE(WEB_AUDIO) | 113 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |