| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 private: | 95 private: |
| 96 AudioBufferSourceNode(AudioContext*, float sampleRate); | 96 AudioBufferSourceNode(AudioContext*, float sampleRate); |
| 97 | 97 |
| 98 // Returns true on success. | 98 // Returns true on success. |
| 99 bool renderFromBuffer(AudioBus*, unsigned destinationFrameOffset, size_t num
berOfFrames); | 99 bool renderFromBuffer(AudioBus*, unsigned destinationFrameOffset, size_t num
berOfFrames); |
| 100 | 100 |
| 101 // Render silence starting from "index" frame in AudioBus. | 101 // Render silence starting from "index" frame in AudioBus. |
| 102 inline bool renderSilenceAndFinishIfNotLooping(AudioBus*, unsigned index, si
ze_t framesToProcess); | 102 inline bool renderSilenceAndFinishIfNotLooping(AudioBus*, unsigned index, si
ze_t framesToProcess); |
| 103 | 103 |
| 104 // m_buffer holds the sample data which this node outputs. | 104 // m_buffer holds the sample data which this node outputs. |
| 105 RefPtr<AudioBuffer> m_buffer; | 105 RefPtrWillBePersistent<AudioBuffer> m_buffer; |
| 106 | 106 |
| 107 // Pointers for the buffer and destination. | 107 // Pointers for the buffer and destination. |
| 108 OwnPtr<const float*[]> m_sourceChannels; | 108 OwnPtr<const float*[]> m_sourceChannels; |
| 109 OwnPtr<float*[]> m_destinationChannels; | 109 OwnPtr<float*[]> m_destinationChannels; |
| 110 | 110 |
| 111 // Used for the "gain" and "playbackRate" attributes. | 111 // Used for the "gain" and "playbackRate" attributes. |
| 112 RefPtr<AudioParam> m_gain; | 112 RefPtrWillBePersistent<AudioParam> m_gain; |
| 113 RefPtr<AudioParam> m_playbackRate; | 113 RefPtrWillBePersistent<AudioParam> m_playbackRate; |
| 114 | 114 |
| 115 // If m_isLooping is false, then this node will be done playing and become i
nactive after it reaches the end of the sample data in the buffer. | 115 // If m_isLooping is false, then this node will be done playing and become i
nactive after it reaches the end of the sample data in the buffer. |
| 116 // If true, it will wrap around to the start of the buffer each time it reac
hes the end. | 116 // If true, it will wrap around to the start of the buffer each time it reac
hes the end. |
| 117 bool m_isLooping; | 117 bool m_isLooping; |
| 118 | 118 |
| 119 double m_loopStart; | 119 double m_loopStart; |
| 120 double m_loopEnd; | 120 double m_loopEnd; |
| 121 | 121 |
| 122 // m_virtualReadIndex is a sample-frame index into our buffer representing t
he current playback position. | 122 // m_virtualReadIndex is a sample-frame index into our buffer representing t
he current playback position. |
| 123 // Since it's floating-point, it has sub-sample accuracy. | 123 // Since it's floating-point, it has sub-sample accuracy. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 139 // the pitch rate. We manually manage ref-counting because we want to use Re
fTypeConnection. | 139 // the pitch rate. We manually manage ref-counting because we want to use Re
fTypeConnection. |
| 140 PannerNode* m_pannerNode; | 140 PannerNode* m_pannerNode; |
| 141 | 141 |
| 142 // This synchronizes process() with setBuffer() which can cause dynamic chan
nel count changes. | 142 // This synchronizes process() with setBuffer() which can cause dynamic chan
nel count changes. |
| 143 mutable Mutex m_processLock; | 143 mutable Mutex m_processLock; |
| 144 }; | 144 }; |
| 145 | 145 |
| 146 } // namespace WebCore | 146 } // namespace WebCore |
| 147 | 147 |
| 148 #endif // AudioBufferSourceNode_h | 148 #endif // AudioBufferSourceNode_h |
| OLD | NEW |