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 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 // Called when we have no more sound to play or the stop() time has been rea
ched. No onEnded | 97 // Called when we have no more sound to play or the stop() time has been rea
ched. No onEnded |
98 // event is called. | 98 // event is called. |
99 virtual void finishWithoutOnEnded(); | 99 virtual void finishWithoutOnEnded(); |
100 | 100 |
101 // Like finishWithoutOnEnded(), but an onEnded (if specified) is called. | 101 // Like finishWithoutOnEnded(), but an onEnded (if specified) is called. |
102 virtual void finish(); | 102 virtual void finish(); |
103 | 103 |
104 void notifyEnded(); | 104 void notifyEnded(); |
105 | 105 |
| 106 // This synchronizes with process() and any other method that needs to be sy
nchronized like |
| 107 // setBuffer for AudioBufferSource. |
| 108 mutable Mutex m_processLock; |
| 109 |
106 // m_startTime is the time to start playing based on the context's timeline
(0 or a time less than the context's current time means "now"). | 110 // m_startTime is the time to start playing based on the context's timeline
(0 or a time less than the context's current time means "now"). |
107 double m_startTime; // in seconds | 111 double m_startTime; // in seconds |
108 | 112 |
109 // m_endTime is the time to stop playing based on the context's timeline (0
or a time less than the context's current time means "now"). | 113 // m_endTime is the time to stop playing based on the context's timeline (0
or a time less than the context's current time means "now"). |
110 // If it hasn't been set explicitly, then the sound will not stop playing (i
f looping) or will stop when the end of the AudioBuffer | 114 // If it hasn't been set explicitly, then the sound will not stop playing (i
f looping) or will stop when the end of the AudioBuffer |
111 // has been reached. | 115 // has been reached. |
112 double m_endTime; // in seconds | 116 double m_endTime; // in seconds |
113 | 117 |
114 bool m_hasEndedListener; | 118 bool m_hasEndedListener; |
115 | 119 |
(...skipping 15 matching lines...) Expand all Loading... |
131 void setOnended(PassRefPtrWillBeRawPtr<EventListener>); | 135 void setOnended(PassRefPtrWillBeRawPtr<EventListener>); |
132 | 136 |
133 protected: | 137 protected: |
134 explicit AudioScheduledSourceNode(AbstractAudioContext&); | 138 explicit AudioScheduledSourceNode(AbstractAudioContext&); |
135 AudioScheduledSourceHandler& audioScheduledSourceHandler() const; | 139 AudioScheduledSourceHandler& audioScheduledSourceHandler() const; |
136 }; | 140 }; |
137 | 141 |
138 } // namespace blink | 142 } // namespace blink |
139 | 143 |
140 #endif // AudioScheduledSourceNode_h | 144 #endif // AudioScheduledSourceNode_h |
OLD | NEW |