OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012, Google Inc. All rights reserved. | 2 * Copyright (C) 2012, 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 // Detune value (deviating from the frequency) in Cents. | 82 // Detune value (deviating from the frequency) in Cents. |
83 RefPtr<AudioParamHandler> m_detune; | 83 RefPtr<AudioParamHandler> m_detune; |
84 | 84 |
85 bool m_firstRender; | 85 bool m_firstRender; |
86 | 86 |
87 // m_virtualReadIndex is a sample-frame index into our buffer representing t
he current playback position. | 87 // m_virtualReadIndex is a sample-frame index into our buffer representing t
he current playback position. |
88 // Since it's floating-point, it has sub-sample accuracy. | 88 // Since it's floating-point, it has sub-sample accuracy. |
89 double m_virtualReadIndex; | 89 double m_virtualReadIndex; |
90 | 90 |
91 // This synchronizes process(). | |
92 mutable Mutex m_processLock; | |
93 | |
94 // Stores sample-accurate values calculated according to frequency and detun
e. | 91 // Stores sample-accurate values calculated according to frequency and detun
e. |
95 AudioFloatArray m_phaseIncrements; | 92 AudioFloatArray m_phaseIncrements; |
96 AudioFloatArray m_detuneValues; | 93 AudioFloatArray m_detuneValues; |
97 | 94 |
98 // This Persistent doesn't make a reference cycle including the owner | 95 // This Persistent doesn't make a reference cycle including the owner |
99 // OscillatorNode. | 96 // OscillatorNode. |
100 Persistent<PeriodicWave> m_periodicWave; | 97 Persistent<PeriodicWave> m_periodicWave; |
101 }; | 98 }; |
102 | 99 |
103 class OscillatorNode final : public AudioScheduledSourceNode { | 100 class OscillatorNode final : public AudioScheduledSourceNode { |
(...skipping 12 matching lines...) Expand all Loading... |
116 OscillatorNode(AbstractAudioContext&, float sampleRate); | 113 OscillatorNode(AbstractAudioContext&, float sampleRate); |
117 OscillatorHandler& oscillatorHandler() const; | 114 OscillatorHandler& oscillatorHandler() const; |
118 | 115 |
119 Member<AudioParam> m_frequency; | 116 Member<AudioParam> m_frequency; |
120 Member<AudioParam> m_detune; | 117 Member<AudioParam> m_detune; |
121 }; | 118 }; |
122 | 119 |
123 } // namespace blink | 120 } // namespace blink |
124 | 121 |
125 #endif // OscillatorNode_h | 122 #endif // OscillatorNode_h |
OLD | NEW |