| 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 ChannelCountMode internalChannelCountMode() const { return m_channelCountMod
e; } | 215 void setInternalChannelCountMode(ChannelCountMode newMode) |
| 216 AudioBus::ChannelInterpretation internalChannelInterpretation() const { retu
rn m_channelInterpretation; } | 216 { |
| 217 releaseStore(&m_channelCountMode, newMode); |
| 218 } |
| 217 | 219 |
| 218 void updateChannelCountMode(); | 220 ChannelCountMode internalChannelCountMode() const |
| 219 void updateChannelInterpretation(); | 221 { |
| 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 } |
| 220 | 236 |
| 221 protected: | 237 protected: |
| 222 // Inputs and outputs must be created before the AudioHandler is | 238 // Inputs and outputs must be created before the AudioHandler is |
| 223 // initialized. | 239 // initialized. |
| 224 void addInput(); | 240 void addInput(); |
| 225 void addOutput(unsigned numberOfChannels); | 241 void addOutput(unsigned numberOfChannels); |
| 226 | 242 |
| 227 // Called by processIfNecessary() to cause all parts of the rendering graph
connected to us to process. | 243 // Called by processIfNecessary() to cause all parts of the rendering graph
connected to us to process. |
| 228 // Each rendering quantum, the audio data for each of the AudioNode's inputs
will be available after this method is called. | 244 // Each rendering quantum, the audio data for each of the AudioNode's inputs
will be available after this method is called. |
| 229 // Called from context's audio thread. | 245 // Called from context's audio thread. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 | 277 |
| 262 bool m_isDisabled; | 278 bool m_isDisabled; |
| 263 | 279 |
| 264 #if DEBUG_AUDIONODE_REFERENCES | 280 #if DEBUG_AUDIONODE_REFERENCES |
| 265 static bool s_isNodeCountInitialized; | 281 static bool s_isNodeCountInitialized; |
| 266 static int s_nodeCount[NodeTypeEnd]; | 282 static int s_nodeCount[NodeTypeEnd]; |
| 267 #endif | 283 #endif |
| 268 | 284 |
| 269 protected: | 285 protected: |
| 270 unsigned m_channelCount; | 286 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; | |
| 279 | 287 |
| 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; |
| 280 }; | 294 }; |
| 281 | 295 |
| 282 class MODULES_EXPORT AudioNode : public EventTargetWithInlineData { | 296 class MODULES_EXPORT AudioNode : public EventTargetWithInlineData { |
| 283 DEFINE_WRAPPERTYPEINFO(); | 297 DEFINE_WRAPPERTYPEINFO(); |
| 284 USING_PRE_FINALIZER(AudioNode, dispose); | 298 USING_PRE_FINALIZER(AudioNode, dispose); |
| 285 public: | 299 public: |
| 286 DECLARE_VIRTUAL_TRACE(); | 300 DECLARE_VIRTUAL_TRACE(); |
| 287 AudioHandler& handler() const; | 301 AudioHandler& handler() const; |
| 288 | 302 |
| 289 virtual AudioNode* connect(AudioNode*, unsigned outputIndex, unsigned inputI
ndex, ExceptionState&); | 303 virtual AudioNode* connect(AudioNode*, unsigned outputIndex, unsigned inputI
ndex, ExceptionState&); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 HeapVector<Member<HeapHashSet<Member<AudioNode>>>> m_connectedNodes; | 350 HeapVector<Member<HeapHashSet<Member<AudioNode>>>> m_connectedNodes; |
| 337 // Represents audio node graph with Oilpan references. N-th HeapHashSet | 351 // Represents audio node graph with Oilpan references. N-th HeapHashSet |
| 338 // represents a set of AudioParam objects connected to this AudioNode's N-th | 352 // represents a set of AudioParam objects connected to this AudioNode's N-th |
| 339 // output. | 353 // output. |
| 340 HeapVector<Member<HeapHashSet<Member<AudioParam>>>> m_connectedParams; | 354 HeapVector<Member<HeapHashSet<Member<AudioParam>>>> m_connectedParams; |
| 341 }; | 355 }; |
| 342 | 356 |
| 343 } // namespace blink | 357 } // namespace blink |
| 344 | 358 |
| 345 #endif // AudioNode_h | 359 #endif // AudioNode_h |
| OLD | NEW |