| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 class AudioContext : public RefCountedGarbageCollectedWillBeGarbageCollectedFina
lized<AudioContext>, public ActiveDOMObject, public EventTargetWithInlineData { | 75 class AudioContext : public RefCountedGarbageCollectedWillBeGarbageCollectedFina
lized<AudioContext>, public ActiveDOMObject, public EventTargetWithInlineData { |
| 76 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<A
udioContext>); | 76 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<A
udioContext>); |
| 77 DEFINE_WRAPPERTYPEINFO(); | 77 DEFINE_WRAPPERTYPEINFO(); |
| 78 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(AudioContext); | 78 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(AudioContext); |
| 79 public: | 79 public: |
| 80 // Create an AudioContext for rendering to the audio hardware. | 80 // Create an AudioContext for rendering to the audio hardware. |
| 81 static AudioContext* create(Document&, ExceptionState&); | 81 static AudioContext* create(Document&, ExceptionState&); |
| 82 | 82 |
| 83 virtual ~AudioContext(); | 83 virtual ~AudioContext(); |
| 84 | 84 |
| 85 virtual void trace(Visitor*) OVERRIDE; | 85 virtual void trace(Visitor*) override; |
| 86 | 86 |
| 87 bool isInitialized() const { return m_isInitialized; } | 87 bool isInitialized() const { return m_isInitialized; } |
| 88 bool isOfflineContext() { return m_isOfflineContext; } | 88 bool isOfflineContext() { return m_isOfflineContext; } |
| 89 | 89 |
| 90 // Document notification | 90 // Document notification |
| 91 virtual void stop() OVERRIDE FINAL; | 91 virtual void stop() override final; |
| 92 virtual bool hasPendingActivity() const OVERRIDE; | 92 virtual bool hasPendingActivity() const override; |
| 93 | 93 |
| 94 AudioDestinationNode* destination() { return m_destinationNode.get(); } | 94 AudioDestinationNode* destination() { return m_destinationNode.get(); } |
| 95 size_t currentSampleFrame() const { return m_destinationNode->currentSampleF
rame(); } | 95 size_t currentSampleFrame() const { return m_destinationNode->currentSampleF
rame(); } |
| 96 double currentTime() const { return m_destinationNode->currentTime(); } | 96 double currentTime() const { return m_destinationNode->currentTime(); } |
| 97 float sampleRate() const { return m_destinationNode->sampleRate(); } | 97 float sampleRate() const { return m_destinationNode->sampleRate(); } |
| 98 | 98 |
| 99 AudioBuffer* createBuffer(unsigned numberOfChannels, size_t numberOfFrames,
float sampleRate, ExceptionState&); | 99 AudioBuffer* createBuffer(unsigned numberOfChannels, size_t numberOfFrames,
float sampleRate, ExceptionState&); |
| 100 | 100 |
| 101 // Asynchronous audio file data decoding. | 101 // Asynchronous audio file data decoding. |
| 102 void decodeAudioData(ArrayBuffer*, AudioBufferCallback*, AudioBufferCallback
*, ExceptionState&); | 102 void decodeAudioData(ArrayBuffer*, AudioBufferCallback*, AudioBufferCallback
*, ExceptionState&); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 | 213 |
| 214 // Only accessed when the graph lock is held. | 214 // Only accessed when the graph lock is held. |
| 215 void markSummingJunctionDirty(AudioSummingJunction*); | 215 void markSummingJunctionDirty(AudioSummingJunction*); |
| 216 // Only accessed when the graph lock is held. Must be called on the main thr
ead. | 216 // Only accessed when the graph lock is held. Must be called on the main thr
ead. |
| 217 void removeMarkedSummingJunction(AudioSummingJunction*); | 217 void removeMarkedSummingJunction(AudioSummingJunction*); |
| 218 void markAudioNodeOutputDirty(AudioNodeOutput*); | 218 void markAudioNodeOutputDirty(AudioNodeOutput*); |
| 219 void removeMarkedAudioNodeOutput(AudioNodeOutput*); | 219 void removeMarkedAudioNodeOutput(AudioNodeOutput*); |
| 220 void disposeOutputs(AudioNode&); | 220 void disposeOutputs(AudioNode&); |
| 221 | 221 |
| 222 // EventTarget | 222 // EventTarget |
| 223 virtual const AtomicString& interfaceName() const OVERRIDE FINAL; | 223 virtual const AtomicString& interfaceName() const override final; |
| 224 virtual ExecutionContext* executionContext() const OVERRIDE FINAL; | 224 virtual ExecutionContext* executionContext() const override final; |
| 225 | 225 |
| 226 DEFINE_ATTRIBUTE_EVENT_LISTENER(complete); | 226 DEFINE_ATTRIBUTE_EVENT_LISTENER(complete); |
| 227 | 227 |
| 228 void startRendering(); | 228 void startRendering(); |
| 229 void fireCompletionEvent(); | 229 void fireCompletionEvent(); |
| 230 | 230 |
| 231 static unsigned s_hardwareContextCount; | 231 static unsigned s_hardwareContextCount; |
| 232 | 232 |
| 233 protected: | 233 protected: |
| 234 explicit AudioContext(Document*); | 234 explicit AudioContext(Document*); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 HashSet<AudioNode*> m_deferredCountModeChange; | 346 HashSet<AudioNode*> m_deferredCountModeChange; |
| 347 | 347 |
| 348 // This is considering 32 is large enough for multiple channels audio. | 348 // This is considering 32 is large enough for multiple channels audio. |
| 349 // It is somewhat arbitrary and could be increased if necessary. | 349 // It is somewhat arbitrary and could be increased if necessary. |
| 350 enum { MaxNumberOfChannels = 32 }; | 350 enum { MaxNumberOfChannels = 32 }; |
| 351 }; | 351 }; |
| 352 | 352 |
| 353 } // namespace blink | 353 } // namespace blink |
| 354 | 354 |
| 355 #endif // AudioContext_h | 355 #endif // AudioContext_h |
| OLD | NEW |