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 22 matching lines...) Expand all Loading... |
33 namespace blink { | 33 namespace blink { |
34 | 34 |
35 GainNode::GainNode(AudioContext* context, float sampleRate) | 35 GainNode::GainNode(AudioContext* context, float sampleRate) |
36 : AudioNode(NodeTypeGain, context, sampleRate) | 36 : AudioNode(NodeTypeGain, context, sampleRate) |
37 , m_lastGain(1.0) | 37 , m_lastGain(1.0) |
38 , m_sampleAccurateGainValues(AudioNode::ProcessingSizeInFrames) // FIXME: ca
n probably share temp buffer in context | 38 , m_sampleAccurateGainValues(AudioNode::ProcessingSizeInFrames) // FIXME: ca
n probably share temp buffer in context |
39 { | 39 { |
40 m_gain = AudioParam::create(context, 1.0); | 40 m_gain = AudioParam::create(context, 1.0); |
41 | 41 |
42 addInput(); | 42 addInput(); |
43 addOutput(AudioNodeOutput::create(this, 1)); | 43 addOutput(1); |
44 | 44 |
45 initialize(); | 45 initialize(); |
46 } | 46 } |
47 | 47 |
48 void GainNode::process(size_t framesToProcess) | 48 void GainNode::process(size_t framesToProcess) |
49 { | 49 { |
50 // FIXME: for some cases there is a nice optimization to avoid processing he
re, and let the gain change | 50 // FIXME: for some cases there is a nice optimization to avoid processing he
re, and let the gain change |
51 // happen in the summing junction input of the AudioNode we're connected to. | 51 // happen in the summing junction input of the AudioNode we're connected to. |
52 // Then we can avoid all of the following: | 52 // Then we can avoid all of the following: |
53 | 53 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 DEFINE_TRACE(GainNode) | 108 DEFINE_TRACE(GainNode) |
109 { | 109 { |
110 visitor->trace(m_gain); | 110 visitor->trace(m_gain); |
111 AudioNode::trace(visitor); | 111 AudioNode::trace(visitor); |
112 } | 112 } |
113 | 113 |
114 } // namespace blink | 114 } // namespace blink |
115 | 115 |
116 #endif // ENABLE(WEB_AUDIO) | 116 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |