Rename Buffer::iter_mut() to iter_samples()
Since there's also an iter_blocks(). This is consistent with the new Block method.
This commit is contained in:
parent
fcd0522a33
commit
3c5aff1ec6
|
@ -274,7 +274,7 @@ impl Plugin for Diopser {
|
|||
let smoothing_interval =
|
||||
unnormalize_automation_precision(self.params.automation_precision.value);
|
||||
|
||||
for mut channel_samples in buffer.iter_mut() {
|
||||
for mut channel_samples in buffer.iter_samples() {
|
||||
self.maybe_update_filters(smoothing_interval);
|
||||
|
||||
// We can compute the filters for both channels at once. The SIMD version thus now only
|
||||
|
|
|
@ -158,7 +158,7 @@ impl Plugin for Gain {
|
|||
buffer: &mut Buffer,
|
||||
_context: &mut impl ProcessContext,
|
||||
) -> ProcessStatus {
|
||||
for channel_samples in buffer.iter_mut() {
|
||||
for channel_samples in buffer.iter_samples() {
|
||||
let mut amplitude = 0.0;
|
||||
let num_samples = channel_samples.len();
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ impl Plugin for Gain {
|
|||
buffer: &mut Buffer,
|
||||
_context: &mut impl ProcessContext,
|
||||
) -> ProcessStatus {
|
||||
for channel_samples in buffer.iter_mut() {
|
||||
for channel_samples in buffer.iter_samples() {
|
||||
// Smoothing is optionally built into the parameters themselves
|
||||
let gain = self.params.gain.smoothed.next();
|
||||
|
||||
|
|
|
@ -133,7 +133,7 @@ impl Plugin for Sine {
|
|||
|
||||
fn process(&mut self, buffer: &mut Buffer, context: &mut impl ProcessContext) -> ProcessStatus {
|
||||
let mut next_event = context.next_midi_event();
|
||||
for (sample_id, channel_samples) in buffer.iter_mut().enumerate() {
|
||||
for (sample_id, channel_samples) in buffer.iter_samples().enumerate() {
|
||||
// Smoothing is optionally built into the parameters themselves
|
||||
let gain = self.params.gain.smoothed.next();
|
||||
|
||||
|
|
|
@ -290,7 +290,7 @@ impl<'a> Buffer<'a> {
|
|||
|
||||
/// Iterate over the samples, returning a channel iterator for each sample.
|
||||
#[inline]
|
||||
pub fn iter_mut<'slice>(&'slice mut self) -> SamplesIter<'slice, 'a> {
|
||||
pub fn iter_samples<'slice>(&'slice mut self) -> SamplesIter<'slice, 'a> {
|
||||
SamplesIter {
|
||||
buffers: self.output_slices.as_mut_slice(),
|
||||
current_sample: 0,
|
||||
|
@ -511,7 +511,7 @@ impl<'slice, 'sample> Block<'slice, 'sample> {
|
|||
}
|
||||
|
||||
/// Iterate over this block on a per-sample per-channel basis. This is identical to
|
||||
/// [`Buffer::iter_mut()`] but for a smaller block instead of the entire buffer
|
||||
/// [`Buffer::iter_samples()`] but for a smaller block instead of the entire buffer
|
||||
#[inline]
|
||||
pub fn iter_samples(&mut self) -> SamplesIter<'slice, 'sample> {
|
||||
SamplesIter {
|
||||
|
@ -703,13 +703,13 @@ mod miri {
|
|||
})
|
||||
};
|
||||
|
||||
for samples in buffer.iter_mut() {
|
||||
for samples in buffer.iter_samples() {
|
||||
for sample in samples {
|
||||
*sample += 0.001;
|
||||
}
|
||||
}
|
||||
|
||||
for mut samples in buffer.iter_mut() {
|
||||
for mut samples in buffer.iter_samples() {
|
||||
for _ in 0..2 {
|
||||
for sample in samples.iter_mut() {
|
||||
*sample += 0.001;
|
||||
|
|
Loading…
Reference in a new issue