From ec374095e26a083fbcb0e461540a421f9931308f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hubert=20Figui=C3=A8re?= Date: Sat, 14 Jan 2023 19:03:36 -0500 Subject: [PATCH] doc: fix the documentation following API changes (#30) * doc: fix the documentation following API changes * lint: fix new lint errors --- src/event.rs | 2 +- src/lib.rs | 10 ---------- src/plugin.rs | 2 +- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/event.rs b/src/event.rs index c0cc9a2..af14eb0 100644 --- a/src/event.rs +++ b/src/event.rs @@ -165,7 +165,7 @@ impl LV2AtomSequence { std::mem::size_of_val(&sequence.atom) as u32 + sequence.atom.size; if (self.buffer.len() as u32) < current_sequence_size + event_size { return Err(EventError::SequenceFull { - capacity: self.capacity() as usize, + capacity: self.capacity(), requested: (current_sequence_size + event_size) as usize, }); } diff --git a/src/lib.rs b/src/lib.rs index 7577210..55ea4fd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,7 +3,6 @@ //! let world = livi::World::new(); //! const SAMPLE_RATE: f64 = 44100.0; //! let features = world.build_features(livi::FeaturesBuilder::default()); -//! let worker_manager = features.worker_manager().clone(); //! let plugin = world //! // This is the URI for mda EPiano. You can use the `lv2ls` command line //! // utility to see all available LV2 plugins. @@ -36,15 +35,6 @@ //! .with_atom_sequence_inputs(std::iter::once(&input)) //! .with_audio_outputs(outputs.iter_mut().map(|output| output.as_mut_slice())); //! unsafe { instance.run(features.max_block_length(), ports).unwrap() }; -//! -//! // Plugins may push asynchronous works to the worker. When operating in -//! // Realtime, `run_workers` should be run in a separate thread. -//! std::thread::spawn(move || loop { -//! worker_manager.run_workers(); -//! // Add some sleep to avoid busy looping. -//! // Busy looping may lead to increased CPU usage. -//! std::thread::sleep(std::time::Duration::from_millis(100)); -//! }); //! ``` use log::{debug, error, info, warn}; use std::sync::Arc; diff --git a/src/plugin.rs b/src/plugin.rs index d965559..7b454a6 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -520,7 +520,7 @@ fn node_to_value(maybe_node: &Option) -> f32 { None => return 0.0, }; if n.is_float() { - n.as_float().map(|f| f as f32).unwrap_or(0.0) + n.as_float().unwrap_or(0.0) } else if n.is_int() { n.as_int().unwrap_or(0) as f32 } else if n.as_bool().unwrap_or(false) {