whileself.audio_time.frame_time<frame_size{#[cfg(feature = "log")]println!("");debug!("{} ------",self.audio_time);// 1. Pop commands that align to the current start time and apply them
letinterim_end_pos=loop{matchself.queue_commands.front(){Some((time,_command))=>{if*time==self.audio_time.frame_time{letcommand=self.queue_commands.pop_front().expect_unreachable("front cant be none").1;self.apply_command(command);}elseif*time>self.audio_time.frame_time{break*time;}else{unreachable!()}}None=>{// No more commands, so set end_pos to the end of the frame.
// We might need to shorten this in case we have an envelope that wants to end sooner
breakframe_size;}}};// 2. Check if any envelope needs to end before interim_end_pos
```rust
while self.audio_time.frame_time < frame_size {
#[cfg(feature = "log")]
println!("");
debug!("{} ------", self.audio_time);
// 1. Pop commands that align to the current start time and apply them
let interim_end_pos = loop {
match self.queue_commands.front() {
Some((time, _command)) => {
if *time == self.audio_time.frame_time {
let command = self
.queue_commands
.pop_front()
.expect_unreachable("front cant be none")
.1;
self.apply_command(command);
} else if *time > self.audio_time.frame_time {
break *time;
} else {
unreachable!()
}
}
None => {
// No more commands, so set end_pos to the end of the frame.
// We might need to shorten this in case we have an envelope that wants to end sooner
break frame_size;
}
}
};
// 2. Check if any envelope needs to end before interim_end_pos
```