Derive a Default instance for the Buffer
To make Clippy happy.
This commit is contained in:
parent
13369e4085
commit
a42649b2de
|
@ -18,6 +18,7 @@
|
||||||
/// inputs already copied to the outputs. You can either use the iterator adapters to conveniently
|
/// inputs already copied to the outputs. You can either use the iterator adapters to conveniently
|
||||||
/// and efficiently iterate over the samples, or you can do your own thing using the raw audio
|
/// and efficiently iterate over the samples, or you can do your own thing using the raw audio
|
||||||
/// buffers.
|
/// buffers.
|
||||||
|
#[derive(Default)]
|
||||||
pub struct Buffer<'a> {
|
pub struct Buffer<'a> {
|
||||||
/// Contains slices for the plugin's outputs. You can't directly create a nested slice form
|
/// Contains slices for the plugin's outputs. You can't directly create a nested slice form
|
||||||
/// apointer to pointers, so this needs to be preallocated in the setup call and kept around
|
/// apointer to pointers, so this needs to be preallocated in the setup call and kept around
|
||||||
|
@ -30,13 +31,6 @@ pub struct Buffer<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Buffer<'a> {
|
impl<'a> Buffer<'a> {
|
||||||
/// Construct a new buffer adapter based on a set of audio buffers.
|
|
||||||
pub fn new() -> Self {
|
|
||||||
Self {
|
|
||||||
output_slices: Vec::new(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns true if this buffer does not contain any samples.
|
/// Returns true if this buffer does not contain any samples.
|
||||||
pub fn is_empty(&self) -> bool {
|
pub fn is_empty(&self) -> bool {
|
||||||
self.output_slices.is_empty() || self.output_slices[0].is_empty()
|
self.output_slices.is_empty() || self.output_slices[0].is_empty()
|
||||||
|
|
|
@ -202,7 +202,7 @@ impl<P: Plugin> WrapperInner<'_, P> {
|
||||||
bypass_state: AtomicBool::new(false),
|
bypass_state: AtomicBool::new(false),
|
||||||
last_process_status: AtomicCell::new(ProcessStatus::Normal),
|
last_process_status: AtomicCell::new(ProcessStatus::Normal),
|
||||||
current_latency: AtomicU32::new(0),
|
current_latency: AtomicU32::new(0),
|
||||||
output_buffer: RwLock::new(Buffer::new()),
|
output_buffer: RwLock::new(Buffer::default()),
|
||||||
|
|
||||||
param_hashes: Vec::new(),
|
param_hashes: Vec::new(),
|
||||||
param_by_hash: HashMap::new(),
|
param_by_hash: HashMap::new(),
|
||||||
|
|
Loading…
Reference in a new issue