@@ -108,26 +108,28 @@ double AudioBufferQueueSourceNode::getStopTime() const {
108
108
static_cast <int >(vReadIndex_), context_->getSampleRate ());
109
109
}
110
110
111
- void AudioBufferQueueSourceNode::setOnPositionChangedCallbackId (uint64_t callbackId) {
112
- onPositionChangedCallbackId_ = callbackId;
111
+ void AudioBufferQueueSourceNode::setOnPositionChangedCallbackId (
112
+ uint64_t callbackId) {
113
+ onPositionChangedCallbackId_ = callbackId;
113
114
}
114
115
115
116
void AudioBufferQueueSourceNode::sendOnPositionChangedEvent () {
116
- if (onPositionChangedTime_ > onPositionChangedInterval_) {
117
- std::unordered_map<std::string, EventValue> body = {
118
- {" value" , getStopTime ()}, {" bufferId" , bufferId_}};
117
+ if (onPositionChangedTime_ > onPositionChangedInterval_) {
118
+ std::unordered_map<std::string, EventValue> body = {
119
+ {" value" , getStopTime ()}, {" bufferId" , bufferId_}};
119
120
120
- context_->audioEventHandlerRegistry_ ->invokeHandlerWithEventBody (
121
- " positionChanged" , onPositionChangedCallbackId_, body);
121
+ context_->audioEventHandlerRegistry_ ->invokeHandlerWithEventBody (
122
+ " positionChanged" , onPositionChangedCallbackId_, body);
122
123
123
- onPositionChangedTime_ = 0 ;
124
- }
124
+ onPositionChangedTime_ = 0 ;
125
+ }
125
126
126
- onPositionChangedTime_ += RENDER_QUANTUM_SIZE;
127
+ onPositionChangedTime_ += RENDER_QUANTUM_SIZE;
127
128
}
128
129
129
130
void AudioBufferQueueSourceNode::setOnPositionChangedInterval (int interval) {
130
- onPositionChangedInterval_ = static_cast <int >(context_->getSampleRate () * 1000 / static_cast <float >(interval));
131
+ onPositionChangedInterval_ = static_cast <int >(
132
+ context_->getSampleRate () * 1000 / static_cast <float >(interval));
131
133
}
132
134
133
135
/* *
0 commit comments