| 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 | 205 |
| 206 unsigned long channelCount(); | 206 unsigned long channelCount(); |
| 207 virtual void setChannelCount(unsigned long, ExceptionState&); | 207 virtual void setChannelCount(unsigned long, ExceptionState&); |
| 208 | 208 |
| 209 String channelCountMode(); | 209 String channelCountMode(); |
| 210 virtual void setChannelCountMode(const String&, ExceptionState&); | 210 virtual void setChannelCountMode(const String&, ExceptionState&); |
| 211 | 211 |
| 212 String channelInterpretation(); | 212 String channelInterpretation(); |
| 213 void setChannelInterpretation(const String&, ExceptionState&); | 213 void setChannelInterpretation(const String&, ExceptionState&); |
| 214 | 214 |
| 215 void setInternalChannelCountMode(ChannelCountMode newMode) | 215 ChannelCountMode internalChannelCountMode() const { return m_channelCountMod
e; } |
| 216 { | 216 AudioBus::ChannelInterpretation internalChannelInterpretation() const { retu
rn m_channelInterpretation; } |
| 217 releaseStore(&m_channelCountMode, newMode); | |
| 218 } | |
| 219 | 217 |
| 220 ChannelCountMode internalChannelCountMode() const | 218 void updateChannelCountMode(); |
| 221 { | 219 void updateChannelInterpretation(); |
| 222 return static_cast<ChannelCountMode>( | |
| 223 acquireLoad(&m_channelCountMode)); | |
| 224 } | |
| 225 | |
| 226 void setInternalChannelInterpretation(unsigned newValue) | |
| 227 { | |
| 228 releaseStore(&m_channelInterpretation, newValue); | |
| 229 } | |
| 230 | |
| 231 AudioBus::ChannelInterpretation internalChannelInterpretation() const | |
| 232 { | |
| 233 return static_cast<AudioBus::ChannelInterpretation>( | |
| 234 acquireLoad(&m_channelInterpretation)); | |
| 235 } | |
| 236 | 220 |
| 237 protected: | 221 protected: |
| 238 // Inputs and outputs must be created before the AudioHandler is | 222 // Inputs and outputs must be created before the AudioHandler is |
| 239 // initialized. | 223 // initialized. |
| 240 void addInput(); | 224 void addInput(); |
| 241 void addOutput(unsigned numberOfChannels); | 225 void addOutput(unsigned numberOfChannels); |
| 242 | 226 |
| 243 // Called by processIfNecessary() to cause all parts of the rendering graph
connected to us to process. | 227 // Called by processIfNecessary() to cause all parts of the rendering graph
connected to us to process. |
| 244 // Each rendering quantum, the audio data for each of the AudioNode's inputs
will be available after this method is called. | 228 // Each rendering quantum, the audio data for each of the AudioNode's inputs
will be available after this method is called. |
| 245 // Called from context's audio thread. | 229 // Called from context's audio thread. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 261 |
| 278 bool m_isDisabled; | 262 bool m_isDisabled; |
| 279 | 263 |
| 280 #if DEBUG_AUDIONODE_REFERENCES | 264 #if DEBUG_AUDIONODE_REFERENCES |
| 281 static bool s_isNodeCountInitialized; | 265 static bool s_isNodeCountInitialized; |
| 282 static int s_nodeCount[NodeTypeEnd]; | 266 static int s_nodeCount[NodeTypeEnd]; |
| 283 #endif | 267 #endif |
| 284 | 268 |
| 285 protected: | 269 protected: |
| 286 unsigned m_channelCount; | 270 unsigned m_channelCount; |
| 271 ChannelCountMode m_channelCountMode; |
| 272 AudioBus::ChannelInterpretation m_channelInterpretation; |
| 273 // The new channel count mode that will be used to set the actual mode in th
e pre or post |
| 274 // rendering phase. |
| 275 ChannelCountMode m_newChannelCountMode; |
| 276 // The new channel interpretation that will be used to set the actual |
| 277 // intepretation in the pre or post rendering phase. |
| 278 AudioBus::ChannelInterpretation m_newChannelInterpretation; |
| 287 | 279 |
| 288 private: | |
| 289 // These are private to force use of the setters and getters. | |
| 290 | |
| 291 // The internal representation of the channel count mode and interpretation. | |
| 292 unsigned m_channelCountMode; | |
| 293 unsigned m_channelInterpretation; | |
| 294 }; | 280 }; |
| 295 | 281 |
| 296 class MODULES_EXPORT AudioNode : public EventTargetWithInlineData { | 282 class MODULES_EXPORT AudioNode : public EventTargetWithInlineData { |
| 297 DEFINE_WRAPPERTYPEINFO(); | 283 DEFINE_WRAPPERTYPEINFO(); |
| 298 USING_PRE_FINALIZER(AudioNode, dispose); | 284 USING_PRE_FINALIZER(AudioNode, dispose); |
| 299 public: | 285 public: |
| 300 DECLARE_VIRTUAL_TRACE(); | 286 DECLARE_VIRTUAL_TRACE(); |
| 301 AudioHandler& handler() const; | 287 AudioHandler& handler() const; |
| 302 | 288 |
| 303 virtual AudioNode* connect(AudioNode*, unsigned outputIndex, unsigned inputI
ndex, ExceptionState&); | 289 virtual AudioNode* connect(AudioNode*, unsigned outputIndex, unsigned inputI
ndex, ExceptionState&); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 HeapVector<Member<HeapHashSet<Member<AudioNode>>>> m_connectedNodes; | 336 HeapVector<Member<HeapHashSet<Member<AudioNode>>>> m_connectedNodes; |
| 351 // Represents audio node graph with Oilpan references. N-th HeapHashSet | 337 // Represents audio node graph with Oilpan references. N-th HeapHashSet |
| 352 // represents a set of AudioParam objects connected to this AudioNode's N-th | 338 // represents a set of AudioParam objects connected to this AudioNode's N-th |
| 353 // output. | 339 // output. |
| 354 HeapVector<Member<HeapHashSet<Member<AudioParam>>>> m_connectedParams; | 340 HeapVector<Member<HeapHashSet<Member<AudioParam>>>> m_connectedParams; |
| 355 }; | 341 }; |
| 356 | 342 |
| 357 } // namespace blink | 343 } // namespace blink |
| 358 | 344 |
| 359 #endif // AudioNode_h | 345 #endif // AudioNode_h |
| OLD | NEW |