fix warnings (not 55 errors)

This commit is contained in:
🪞👃🪞 2024-06-20 18:42:08 +03:00
parent a50e022ab6
commit 87c5e47b43
8 changed files with 290 additions and 269 deletions

View file

@ -15,8 +15,7 @@ pub struct Sampler {
impl Sampler {
pub fn new (name: &str) -> Result<DynamicDevice<Self>, Box<dyn Error>> {
let exited = Arc::new(AtomicBool::new(false));
let (client, status) = Client::new(name, ClientOptions::NO_START_SERVER)?;
let (client, _) = Client::new(name, ClientOptions::NO_START_SERVER)?;
let samples = vec![
Sample::new("Kick", &client, 1, 35)?,
Sample::new("Snare", &client, 1, 38)?,
@ -35,7 +34,7 @@ impl Sampler {
pub fn process (
state: &mut Sampler,
client: &Client,
_: &Client,
scope: &ProcessScope,
) -> Control {
let mut samples = state.samples.lock().unwrap();
@ -48,7 +47,7 @@ pub fn process (
let note = data[1];
let velocity = data[2];
for sample in samples.iter_mut() {
if /*sample.trigger.0 == channel &&*/ sample.trigger.1 == note {
if sample.trigger.0 == channel && sample.trigger.1 == note {
sample.play(velocity);
}
}
@ -95,13 +94,13 @@ impl Sample {
})
}
fn play (&mut self, velocity: u8) {
fn play (&mut self, _velocity: u8) {
self.playing = Some(0)
}
}
pub fn render (state: &Sampler, buf: &mut Buffer, Rect { x, y, width, height }: Rect)
pub fn render (state: &Sampler, buf: &mut Buffer, Rect { x, y, .. }: Rect)
-> Usually<Rect>
{
let style = Style::default().gray();
@ -170,7 +169,7 @@ pub fn render (state: &Sampler, buf: &mut Buffer, Rect { x, y, width, height }:
//Ok(())
//}
pub fn handle (state: &mut Sampler, event: &AppEvent) -> Result<(), Box<dyn Error>> {
pub fn handle (_: &mut Sampler, _: &AppEvent) -> Result<(), Box<dyn Error>> {
//if let Event::Input(crossterm::event::Event::Key(event)) = event {
//match event.code {
//KeyCode::Char('c') => {