| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // setBuffer() is called on the main thread. This is the buffer we use for
playback. | 55 // setBuffer() is called on the main thread. This is the buffer we use for
playback. |
| 56 // returns true on success. | 56 // returns true on success. |
| 57 bool setBuffer(AudioBuffer*); | 57 bool setBuffer(AudioBuffer*); |
| 58 AudioBuffer* buffer() { return m_buffer.get(); } | 58 AudioBuffer* buffer() { return m_buffer.get(); } |
| 59 | 59 |
| 60 // numberOfChannels() returns the number of output channels. This value equ
als the number of channels from the buffer. | 60 // numberOfChannels() returns the number of output channels. This value equ
als the number of channels from the buffer. |
| 61 // If a new buffer is set with a different number of channels, then this val
ue will dynamically change. | 61 // If a new buffer is set with a different number of channels, then this val
ue will dynamically change. |
| 62 unsigned numberOfChannels(); | 62 unsigned numberOfChannels(); |
| 63 | 63 |
| 64 // Play-state | 64 // Play-state |
| 65 void startGrain(double when, double grainOffset); | 65 void start(double when = 0); |
| 66 void startGrain(double when, double grainOffset, double grainDuration); | 66 void start(double when, double grainOffset, double grainDuration = 0); |
| 67 | 67 |
| 68 void noteGrainOn(double when, double grainOffset, double grainDuration); | 68 void noteGrainOn(double when, double grainOffset, double grainDuration); |
| 69 | 69 |
| 70 // Note: the attribute was originally exposed as .looping, but to be more co
nsistent in naming with <audio> | 70 // Note: the attribute was originally exposed as .looping, but to be more co
nsistent in naming with <audio> |
| 71 // and with how it's described in the specification, the proper attribute na
me is .loop | 71 // and with how it's described in the specification, the proper attribute na
me is .loop |
| 72 // The old attribute is kept for backwards compatibility. | 72 // The old attribute is kept for backwards compatibility. |
| 73 bool loop() const { return m_isLooping; } | 73 bool loop() const { return m_isLooping; } |
| 74 void setLoop(bool looping) { m_isLooping = looping; } | 74 void setLoop(bool looping) { m_isLooping = looping; } |
| 75 | 75 |
| 76 // Loop times in seconds. | 76 // Loop times in seconds. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |