| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 : ("The value provided (" + String::number(size) + | 91 : ("The value provided (" + String::number(size) + |
| 92 ") is not a power of two.")); | 92 ") is not a power of two.")); |
| 93 } | 93 } |
| 94 } | 94 } |
| 95 | 95 |
| 96 void AnalyserHandler::setMinDecibels(double k, ExceptionState& exceptionState) { | 96 void AnalyserHandler::setMinDecibels(double k, ExceptionState& exceptionState) { |
| 97 if (k < maxDecibels()) { | 97 if (k < maxDecibels()) { |
| 98 m_analyser.setMinDecibels(k); | 98 m_analyser.setMinDecibels(k); |
| 99 } else { | 99 } else { |
| 100 exceptionState.throwDOMException( | 100 exceptionState.throwDOMException( |
| 101 IndexSizeError, ExceptionMessages::indexExceedsMaximumBound( | 101 IndexSizeError, |
| 102 "minDecibels", k, maxDecibels())); | 102 ExceptionMessages::indexExceedsMaximumBound("minDecibels", k, |
| 103 maxDecibels())); |
| 103 } | 104 } |
| 104 } | 105 } |
| 105 | 106 |
| 106 void AnalyserHandler::setMaxDecibels(double k, ExceptionState& exceptionState) { | 107 void AnalyserHandler::setMaxDecibels(double k, ExceptionState& exceptionState) { |
| 107 if (k > minDecibels()) { | 108 if (k > minDecibels()) { |
| 108 m_analyser.setMaxDecibels(k); | 109 m_analyser.setMaxDecibels(k); |
| 109 } else { | 110 } else { |
| 110 exceptionState.throwDOMException( | 111 exceptionState.throwDOMException( |
| 111 IndexSizeError, ExceptionMessages::indexExceedsMinimumBound( | 112 IndexSizeError, |
| 112 "maxDecibels", k, minDecibels())); | 113 ExceptionMessages::indexExceedsMinimumBound("maxDecibels", k, |
| 114 minDecibels())); |
| 113 } | 115 } |
| 114 } | 116 } |
| 115 | 117 |
| 116 void AnalyserHandler::setMinMaxDecibels(double minDecibels, | 118 void AnalyserHandler::setMinMaxDecibels(double minDecibels, |
| 117 double maxDecibels, | 119 double maxDecibels, |
| 118 ExceptionState& exceptionState) { | 120 ExceptionState& exceptionState) { |
| 119 if (minDecibels >= maxDecibels) { | 121 if (minDecibels >= maxDecibels) { |
| 120 exceptionState.throwDOMException( | 122 exceptionState.throwDOMException( |
| 121 IndexSizeError, "maxDecibels (" + String::number(maxDecibels) + | 123 IndexSizeError, |
| 122 ") must be greater than or equal to minDecibels " + | 124 "maxDecibels (" + String::number(maxDecibels) + |
| 123 "( " + String::number(minDecibels) + ")."); | 125 ") must be greater than or equal to minDecibels " + "( " + |
| 126 String::number(minDecibels) + ")."); |
| 124 return; | 127 return; |
| 125 } | 128 } |
| 126 m_analyser.setMinDecibels(minDecibels); | 129 m_analyser.setMinDecibels(minDecibels); |
| 127 m_analyser.setMaxDecibels(maxDecibels); | 130 m_analyser.setMaxDecibels(maxDecibels); |
| 128 } | 131 } |
| 129 | 132 |
| 130 void AnalyserHandler::setSmoothingTimeConstant(double k, | 133 void AnalyserHandler::setSmoothingTimeConstant(double k, |
| 131 ExceptionState& exceptionState) { | 134 ExceptionState& exceptionState) { |
| 132 if (k >= 0 && k <= 1) { | 135 if (k >= 0 && k <= 1) { |
| 133 m_analyser.setSmoothingTimeConstant(k); | 136 m_analyser.setSmoothingTimeConstant(k); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 | 275 |
| 273 void AnalyserNode::getFloatTimeDomainData(DOMFloat32Array* array) { | 276 void AnalyserNode::getFloatTimeDomainData(DOMFloat32Array* array) { |
| 274 analyserHandler().getFloatTimeDomainData(array); | 277 analyserHandler().getFloatTimeDomainData(array); |
| 275 } | 278 } |
| 276 | 279 |
| 277 void AnalyserNode::getByteTimeDomainData(DOMUint8Array* array) { | 280 void AnalyserNode::getByteTimeDomainData(DOMUint8Array* array) { |
| 278 analyserHandler().getByteTimeDomainData(array); | 281 analyserHandler().getByteTimeDomainData(array); |
| 279 } | 282 } |
| 280 | 283 |
| 281 } // namespace blink | 284 } // namespace blink |
| OLD | NEW |