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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 exceptionState.throwDOMException( | 257 exceptionState.throwDOMException( |
258 InvalidStateError, | 258 InvalidStateError, |
259 "invalid HTMLMedialElement."); | 259 "invalid HTMLMedialElement."); |
260 return 0; | 260 return 0; |
261 } | 261 } |
262 | 262 |
263 // First check if this media element already has a source node. | 263 // First check if this media element already has a source node. |
264 if (mediaElement->audioSourceNode()) { | 264 if (mediaElement->audioSourceNode()) { |
265 exceptionState.throwDOMException( | 265 exceptionState.throwDOMException( |
266 InvalidStateError, | 266 InvalidStateError, |
267 "invalid HTMLMediaElement."); | 267 "HTMLMediaElement already connected previously to a different MediaE
lementSourceNode."); |
268 return 0; | 268 return 0; |
269 } | 269 } |
270 | 270 |
271 MediaElementAudioSourceNode* node = MediaElementAudioSourceNode::create(this
, mediaElement); | 271 MediaElementAudioSourceNode* node = MediaElementAudioSourceNode::create(this
, mediaElement); |
272 | 272 |
273 mediaElement->setAudioSourceNode(node); | 273 mediaElement->setAudioSourceNode(node); |
274 | 274 |
275 refNode(node); // context keeps reference until node is disconnected | 275 refNode(node); // context keeps reference until node is disconnected |
276 return node; | 276 return node; |
277 } | 277 } |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 | 865 |
866 for (HashSet<AudioNode*>::iterator k = m_deferredCountModeChange.begin(); k
!= m_deferredCountModeChange.end(); ++k) | 866 for (HashSet<AudioNode*>::iterator k = m_deferredCountModeChange.begin(); k
!= m_deferredCountModeChange.end(); ++k) |
867 (*k)->updateChannelCountMode(); | 867 (*k)->updateChannelCountMode(); |
868 | 868 |
869 m_deferredCountModeChange.clear(); | 869 m_deferredCountModeChange.clear(); |
870 } | 870 } |
871 | 871 |
872 } // namespace blink | 872 } // namespace blink |
873 | 873 |
874 #endif // ENABLE(WEB_AUDIO) | 874 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |