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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 return m_private->requiresAudioConsumer(); | 161 return m_private->requiresAudioConsumer(); |
162 } | 162 } |
163 | 163 |
164 class ConsumerWrapper FINAL : public AudioDestinationConsumer { | 164 class ConsumerWrapper FINAL : public AudioDestinationConsumer { |
165 public: | 165 public: |
166 static ConsumerWrapper* create(WebAudioDestinationConsumer* consumer) | 166 static ConsumerWrapper* create(WebAudioDestinationConsumer* consumer) |
167 { | 167 { |
168 return new ConsumerWrapper(consumer); | 168 return new ConsumerWrapper(consumer); |
169 } | 169 } |
170 | 170 |
171 virtual void setFormat(size_t numberOfChannels, float sampleRate) OVERRIDE; | 171 virtual void setFormat(size_t numberOfChannels, float sampleRate) override; |
172 virtual void consumeAudio(AudioBus*, size_t numberOfFrames) OVERRIDE; | 172 virtual void consumeAudio(AudioBus*, size_t numberOfFrames) override; |
173 | 173 |
174 WebAudioDestinationConsumer* consumer() { return m_consumer; } | 174 WebAudioDestinationConsumer* consumer() { return m_consumer; } |
175 | 175 |
176 private: | 176 private: |
177 explicit ConsumerWrapper(WebAudioDestinationConsumer* consumer) : m_consumer
(consumer) { } | 177 explicit ConsumerWrapper(WebAudioDestinationConsumer* consumer) : m_consumer
(consumer) { } |
178 | 178 |
179 // m_consumer is not owned by this class. | 179 // m_consumer is not owned by this class. |
180 WebAudioDestinationConsumer* m_consumer; | 180 WebAudioDestinationConsumer* m_consumer; |
181 }; | 181 }; |
182 | 182 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 ConsumerWrapper* wrapper = static_cast<ConsumerWrapper*>(it->get()); | 217 ConsumerWrapper* wrapper = static_cast<ConsumerWrapper*>(it->get()); |
218 if (wrapper->consumer() == consumer) { | 218 if (wrapper->consumer() == consumer) { |
219 m_private->removeAudioConsumer(wrapper); | 219 m_private->removeAudioConsumer(wrapper); |
220 return true; | 220 return true; |
221 } | 221 } |
222 } | 222 } |
223 return false; | 223 return false; |
224 } | 224 } |
225 | 225 |
226 } // namespace blink | 226 } // namespace blink |
OLD | NEW |