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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 if (inputBus != outputBus) | 68 if (inputBus != outputBus) |
69 outputBus->copyFrom(*inputBus); | 69 outputBus->copyFrom(*inputBus); |
70 } | 70 } |
71 | 71 |
72 void AnalyserNode::setFftSize(unsigned size, ExceptionState& exceptionState) | 72 void AnalyserNode::setFftSize(unsigned size, ExceptionState& exceptionState) |
73 { | 73 { |
74 if (!m_analyser.setFftSize(size)) { | 74 if (!m_analyser.setFftSize(size)) { |
75 exceptionState.throwDOMException( | 75 exceptionState.throwDOMException( |
76 IndexSizeError, | 76 IndexSizeError, |
77 (size < RealtimeAnalyser::MinFFTSize || size > RealtimeAnalyser::Max
FFTSize) ? | 77 (size < RealtimeAnalyser::MinFFTSize || size > RealtimeAnalyser::Max
FFTSize) ? |
78 ExceptionMessages::indexOutsideRange("FTT size", size, RealtimeA
nalyser::MinFFTSize, ExceptionMessages::InclusiveBound, RealtimeAnalyser::MaxFFT
Size, ExceptionMessages::InclusiveBound) | 78 ExceptionMessages::indexOutsideRange("FFT size", size, RealtimeA
nalyser::MinFFTSize, ExceptionMessages::InclusiveBound, RealtimeAnalyser::MaxFFT
Size, ExceptionMessages::InclusiveBound) |
79 : ("The value provided (" + String::number(size) + " is not a po
wer of two.")); | 79 : ("The value provided (" + String::number(size) + ") is not a p
ower of two.")); |
80 } | 80 } |
81 } | 81 } |
82 | 82 |
83 void AnalyserNode::setMinDecibels(float k, ExceptionState& exceptionState) | 83 void AnalyserNode::setMinDecibels(float k, ExceptionState& exceptionState) |
84 { | 84 { |
85 if (k <= maxDecibels()) { | 85 if (k <= maxDecibels()) { |
86 m_analyser.setMinDecibels(k); | 86 m_analyser.setMinDecibels(k); |
87 } else { | 87 } else { |
88 exceptionState.throwDOMException( | 88 exceptionState.throwDOMException( |
89 IndexSizeError, | 89 IndexSizeError, |
(...skipping 19 matching lines...) Expand all Loading... |
109 } else { | 109 } else { |
110 exceptionState.throwDOMException( | 110 exceptionState.throwDOMException( |
111 IndexSizeError, | 111 IndexSizeError, |
112 ExceptionMessages::indexOutsideRange("smoothing value", k, 0.0f, Exc
eptionMessages::InclusiveBound, 1.0f, ExceptionMessages::InclusiveBound)); | 112 ExceptionMessages::indexOutsideRange("smoothing value", k, 0.0f, Exc
eptionMessages::InclusiveBound, 1.0f, ExceptionMessages::InclusiveBound)); |
113 } | 113 } |
114 } | 114 } |
115 | 115 |
116 } // namespace WebCore | 116 } // namespace WebCore |
117 | 117 |
118 #endif // ENABLE(WEB_AUDIO) | 118 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |