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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 , m_isStopScheduled(false) | 110 , m_isStopScheduled(false) |
111 , m_isCleared(false) | 111 , m_isCleared(false) |
112 , m_isInitialized(false) | 112 , m_isInitialized(false) |
113 , m_destinationNode(nullptr) | 113 , m_destinationNode(nullptr) |
114 , m_automaticPullNodesNeedUpdating(false) | 114 , m_automaticPullNodesNeedUpdating(false) |
115 , m_connectionCount(0) | 115 , m_connectionCount(0) |
116 , m_audioThread(0) | 116 , m_audioThread(0) |
117 , m_graphOwnerThread(UndefinedThreadIdentifier) | 117 , m_graphOwnerThread(UndefinedThreadIdentifier) |
118 , m_isOfflineContext(false) | 118 , m_isOfflineContext(false) |
119 { | 119 { |
120 ScriptWrappable::init(this); | |
121 | |
122 m_destinationNode = DefaultAudioDestinationNode::create(this); | 120 m_destinationNode = DefaultAudioDestinationNode::create(this); |
123 | 121 |
124 initialize(); | 122 initialize(); |
125 #if DEBUG_AUDIONODE_REFERENCES | 123 #if DEBUG_AUDIONODE_REFERENCES |
126 fprintf(stderr, "%p: AudioContext::AudioContext() #%u\n", this, AudioContext
::s_hardwareContextCount); | 124 fprintf(stderr, "%p: AudioContext::AudioContext() #%u\n", this, AudioContext
::s_hardwareContextCount); |
127 #endif | 125 #endif |
128 } | 126 } |
129 | 127 |
130 // Constructor for offline (non-realtime) rendering. | 128 // Constructor for offline (non-realtime) rendering. |
131 AudioContext::AudioContext(Document* document, unsigned numberOfChannels, size_t
numberOfFrames, float sampleRate) | 129 AudioContext::AudioContext(Document* document, unsigned numberOfChannels, size_t
numberOfFrames, float sampleRate) |
132 : ActiveDOMObject(document) | 130 : ActiveDOMObject(document) |
133 , m_isStopScheduled(false) | 131 , m_isStopScheduled(false) |
134 , m_isCleared(false) | 132 , m_isCleared(false) |
135 , m_isInitialized(false) | 133 , m_isInitialized(false) |
136 , m_destinationNode(nullptr) | 134 , m_destinationNode(nullptr) |
137 , m_automaticPullNodesNeedUpdating(false) | 135 , m_automaticPullNodesNeedUpdating(false) |
138 , m_connectionCount(0) | 136 , m_connectionCount(0) |
139 , m_audioThread(0) | 137 , m_audioThread(0) |
140 , m_graphOwnerThread(UndefinedThreadIdentifier) | 138 , m_graphOwnerThread(UndefinedThreadIdentifier) |
141 , m_isOfflineContext(true) | 139 , m_isOfflineContext(true) |
142 { | 140 { |
143 ScriptWrappable::init(this); | |
144 | |
145 // Create a new destination for offline rendering. | 141 // Create a new destination for offline rendering. |
146 m_renderTarget = AudioBuffer::create(numberOfChannels, numberOfFrames, sampl
eRate); | 142 m_renderTarget = AudioBuffer::create(numberOfChannels, numberOfFrames, sampl
eRate); |
147 if (m_renderTarget.get()) | 143 if (m_renderTarget.get()) |
148 m_destinationNode = OfflineAudioDestinationNode::create(this, m_renderTa
rget.get()); | 144 m_destinationNode = OfflineAudioDestinationNode::create(this, m_renderTa
rget.get()); |
149 | 145 |
150 initialize(); | 146 initialize(); |
151 } | 147 } |
152 | 148 |
153 AudioContext::~AudioContext() | 149 AudioContext::~AudioContext() |
154 { | 150 { |
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 visitor->trace(m_listener); | 886 visitor->trace(m_listener); |
891 visitor->trace(m_referencedNodes); | 887 visitor->trace(m_referencedNodes); |
892 visitor->trace(m_liveNodes); | 888 visitor->trace(m_liveNodes); |
893 visitor->trace(m_liveAudioSummingJunctions); | 889 visitor->trace(m_liveAudioSummingJunctions); |
894 EventTargetWithInlineData::trace(visitor); | 890 EventTargetWithInlineData::trace(visitor); |
895 } | 891 } |
896 | 892 |
897 } // namespace blink | 893 } // namespace blink |
898 | 894 |
899 #endif // ENABLE(WEB_AUDIO) | 895 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |