| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 class PannerNode; | 69 class PannerNode; |
| 70 class PeriodicWave; | 70 class PeriodicWave; |
| 71 class ScriptProcessorNode; | 71 class ScriptProcessorNode; |
| 72 class WaveShaperNode; | 72 class WaveShaperNode; |
| 73 | 73 |
| 74 // AudioContext is the cornerstone of the web audio API and all AudioNodes are c
reated from it. | 74 // AudioContext is the cornerstone of the web audio API and all AudioNodes are c
reated from it. |
| 75 // For thread safety between the audio thread and the main thread, it has a rend
ering graph locking mechanism. | 75 // For thread safety between the audio thread and the main thread, it has a rend
ering graph locking mechanism. |
| 76 | 76 |
| 77 class AudioContext : public ThreadSafeRefCountedWillBeThreadSafeRefCountedGarbag
eCollected<AudioContext>, public ActiveDOMObject, public ScriptWrappable, public
EventTargetWithInlineData { | 77 class AudioContext : public ThreadSafeRefCountedWillBeThreadSafeRefCountedGarbag
eCollected<AudioContext>, public ActiveDOMObject, public ScriptWrappable, public
EventTargetWithInlineData { |
| 78 DEFINE_EVENT_TARGET_REFCOUNTING(ThreadSafeRefCountedWillBeThreadSafeRefCount
edGarbageCollected<AudioContext>); | 78 DEFINE_EVENT_TARGET_REFCOUNTING(ThreadSafeRefCountedWillBeThreadSafeRefCount
edGarbageCollected<AudioContext>); |
| 79 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(AudioContext); |
| 79 public: | 80 public: |
| 80 // Create an AudioContext for rendering to the audio hardware. | 81 // Create an AudioContext for rendering to the audio hardware. |
| 81 static PassRefPtrWillBeRawPtr<AudioContext> create(Document&, ExceptionState
&); | 82 static PassRefPtrWillBeRawPtr<AudioContext> create(Document&, ExceptionState
&); |
| 82 | 83 |
| 83 virtual ~AudioContext(); | 84 virtual ~AudioContext(); |
| 84 | 85 |
| 85 virtual void trace(Visitor*); | 86 virtual void trace(Visitor*) OVERRIDE; |
| 86 | 87 |
| 87 bool isInitialized() const; | 88 bool isInitialized() const; |
| 88 // The constructor of an AudioNode must call this to initialize the context. | 89 // The constructor of an AudioNode must call this to initialize the context. |
| 89 void lazyInitialize(); | 90 void lazyInitialize(); |
| 90 | 91 |
| 91 bool isOfflineContext() { return m_isOfflineContext; } | 92 bool isOfflineContext() { return m_isOfflineContext; } |
| 92 | 93 |
| 93 // Document notification | 94 // Document notification |
| 94 virtual void stop() OVERRIDE FINAL; | 95 virtual void stop() OVERRIDE FINAL; |
| 95 virtual bool hasPendingActivity() const OVERRIDE; | 96 virtual bool hasPendingActivity() const OVERRIDE; |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 AsyncAudioDecoder m_audioDecoder; | 322 AsyncAudioDecoder m_audioDecoder; |
| 322 | 323 |
| 323 // This is considering 32 is large enough for multiple channels audio. | 324 // This is considering 32 is large enough for multiple channels audio. |
| 324 // It is somewhat arbitrary and could be increased if necessary. | 325 // It is somewhat arbitrary and could be increased if necessary. |
| 325 enum { MaxNumberOfChannels = 32 }; | 326 enum { MaxNumberOfChannels = 32 }; |
| 326 }; | 327 }; |
| 327 | 328 |
| 328 } // WebCore | 329 } // WebCore |
| 329 | 330 |
| 330 #endif // AudioContext_h | 331 #endif // AudioContext_h |
| OLD | NEW |