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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 | 34 |
35 class AudioNode; | 35 class AudioNode; |
36 class AudioNodeOutput; | 36 class AudioNodeOutput; |
37 | 37 |
38 // An AudioNodeInput represents an input to an AudioNode and can be connected fr
om one or more AudioNodeOutputs. | 38 // An AudioNodeInput represents an input to an AudioNode and can be connected fr
om one or more AudioNodeOutputs. |
39 // In the case of multiple connections, the input will act as a unity-gain summi
ng junction, mixing all the outputs. | 39 // In the case of multiple connections, the input will act as a unity-gain summi
ng junction, mixing all the outputs. |
40 // The number of channels of the input's bus is the maximum of the number of cha
nnels of all its connections. | 40 // The number of channels of the input's bus is the maximum of the number of cha
nnels of all its connections. |
41 | 41 |
42 class AudioNodeInput final : public AudioSummingJunction { | 42 class AudioNodeInput final : public GarbageCollectedFinalized<AudioNodeInput>, p
ublic AudioSummingJunction { |
43 public: | 43 public: |
44 static AudioNodeInput* create(AudioNode&); | 44 static AudioNodeInput* create(AudioNode&); |
| 45 DECLARE_TRACE(); |
45 | 46 |
46 // AudioSummingJunction | 47 // AudioSummingJunction |
47 DECLARE_VIRTUAL_TRACE(); | |
48 virtual void didUpdate() override; | 48 virtual void didUpdate() override; |
49 | 49 |
50 // Can be called from any thread. | 50 // Can be called from any thread. |
51 AudioNode& node() const { return *m_node; } | 51 AudioNode& node() const { return *m_node; } |
52 | 52 |
53 // Must be called with the context's graph lock. | 53 // Must be called with the context's graph lock. |
54 void connect(AudioNodeOutput&); | 54 void connect(AudioNodeOutput&); |
55 void disconnect(AudioNodeOutput&); | 55 void disconnect(AudioNodeOutput&); |
56 | 56 |
57 // disable() will take the output out of the active connections list and set
aside in a disabled list. | 57 // disable() will take the output out of the active connections list and set
aside in a disabled list. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 // Called from context's audio thread. | 94 // Called from context's audio thread. |
95 AudioBus* internalSummingBus(); | 95 AudioBus* internalSummingBus(); |
96 void sumAllConnections(AudioBus* summingBus, size_t framesToProcess); | 96 void sumAllConnections(AudioBus* summingBus, size_t framesToProcess); |
97 | 97 |
98 RefPtr<AudioBus> m_internalSummingBus; | 98 RefPtr<AudioBus> m_internalSummingBus; |
99 }; | 99 }; |
100 | 100 |
101 } // namespace blink | 101 } // namespace blink |
102 | 102 |
103 #endif // AudioNodeInput_h | 103 #endif // AudioNodeInput_h |
OLD | NEW |