| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 return nullptr; | 76 return nullptr; |
| 77 } | 77 } |
| 78 | 78 |
| 79 PeriodicWave* periodic_wave = new PeriodicWave(context.sampleRate()); | 79 PeriodicWave* periodic_wave = new PeriodicWave(context.sampleRate()); |
| 80 periodic_wave->CreateBandLimitedTables(real, imag, real_length, | 80 periodic_wave->CreateBandLimitedTables(real, imag, real_length, |
| 81 disable_normalization); | 81 disable_normalization); |
| 82 return periodic_wave; | 82 return periodic_wave; |
| 83 } | 83 } |
| 84 | 84 |
| 85 PeriodicWave* PeriodicWave::Create(BaseAudioContext& context, | 85 PeriodicWave* PeriodicWave::Create(BaseAudioContext& context, |
| 86 DOMFloat32Array* real, | 86 NotShared<DOMFloat32Array> real, |
| 87 DOMFloat32Array* imag, | 87 NotShared<DOMFloat32Array> imag, |
| 88 bool disable_normalization, | 88 bool disable_normalization, |
| 89 ExceptionState& exception_state) { | 89 ExceptionState& exception_state) { |
| 90 DCHECK(IsMainThread()); | 90 DCHECK(IsMainThread()); |
| 91 | 91 |
| 92 return Create(context, real->length(), real->Data(), imag->length(), | 92 return Create(context, real.View()->length(), real.View()->Data(), |
| 93 imag->Data(), disable_normalization, exception_state); | 93 imag.View()->length(), imag.View()->Data(), |
| 94 disable_normalization, exception_state); |
| 94 } | 95 } |
| 95 | 96 |
| 96 PeriodicWave* PeriodicWave::Create(BaseAudioContext* context, | 97 PeriodicWave* PeriodicWave::Create(BaseAudioContext* context, |
| 97 const PeriodicWaveOptions& options, | 98 const PeriodicWaveOptions& options, |
| 98 ExceptionState& exception_state) { | 99 ExceptionState& exception_state) { |
| 99 bool normalize = options.hasDisableNormalization() | 100 bool normalize = options.hasDisableNormalization() |
| 100 ? options.disableNormalization() | 101 ? options.disableNormalization() |
| 101 : false; | 102 : false; |
| 102 | 103 |
| 103 Vector<float> real_coef; | 104 Vector<float> real_coef; |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 } | 398 } |
| 398 | 399 |
| 399 real_p[n] = 0; | 400 real_p[n] = 0; |
| 400 imag_p[n] = b; | 401 imag_p[n] = b; |
| 401 } | 402 } |
| 402 | 403 |
| 403 CreateBandLimitedTables(real_p, imag_p, half_size, false); | 404 CreateBandLimitedTables(real_p, imag_p, half_size, false); |
| 404 } | 405 } |
| 405 | 406 |
| 406 } // namespace blink | 407 } // namespace blink |
| OLD | NEW |