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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 String::Number(number_of_channels)); | 124 String::Number(number_of_channels)); |
125 return; | 125 return; |
126 } | 126 } |
127 | 127 |
128 // Wrap the AudioBuffer by an AudioBus. It's an efficient pointer set and not | 128 // Wrap the AudioBuffer by an AudioBus. It's an efficient pointer set and not |
129 // a memcpy(). This memory is simply used in the Reverb constructor and no | 129 // a memcpy(). This memory is simply used in the Reverb constructor and no |
130 // reference to it is kept for later use in that class. | 130 // reference to it is kept for later use in that class. |
131 RefPtr<AudioBus> buffer_bus = | 131 RefPtr<AudioBus> buffer_bus = |
132 AudioBus::Create(number_of_channels, buffer_length, false); | 132 AudioBus::Create(number_of_channels, buffer_length, false); |
133 for (unsigned i = 0; i < number_of_channels; ++i) | 133 for (unsigned i = 0; i < number_of_channels; ++i) |
134 buffer_bus->SetChannelMemory(i, buffer->getChannelData(i)->Data(), | 134 buffer_bus->SetChannelMemory(i, buffer->getChannelData(i).View()->Data(), |
135 buffer_length); | 135 buffer_length); |
136 | 136 |
137 buffer_bus->SetSampleRate(buffer->sampleRate()); | 137 buffer_bus->SetSampleRate(buffer->sampleRate()); |
138 | 138 |
139 // Create the reverb with the given impulse response. | 139 // Create the reverb with the given impulse response. |
140 std::unique_ptr<Reverb> reverb = WTF::WrapUnique(new Reverb( | 140 std::unique_ptr<Reverb> reverb = WTF::WrapUnique(new Reverb( |
141 buffer_bus.Get(), AudioUtilities::kRenderQuantumFrames, MaxFFTSize, | 141 buffer_bus.Get(), AudioUtilities::kRenderQuantumFrames, MaxFFTSize, |
142 Context() && Context()->HasRealtimeConstraint(), normalize_)); | 142 Context() && Context()->HasRealtimeConstraint(), normalize_)); |
143 | 143 |
144 { | 144 { |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 | 302 |
303 bool ConvolverNode::normalize() const { | 303 bool ConvolverNode::normalize() const { |
304 return GetConvolverHandler().Normalize(); | 304 return GetConvolverHandler().Normalize(); |
305 } | 305 } |
306 | 306 |
307 void ConvolverNode::setNormalize(bool normalize) { | 307 void ConvolverNode::setNormalize(bool normalize) { |
308 GetConvolverHandler().SetNormalize(normalize); | 308 GetConvolverHandler().SetNormalize(normalize); |
309 } | 309 } |
310 | 310 |
311 } // namespace blink | 311 } // namespace blink |
OLD | NEW |