From 914db6dbe0c350bb47ee7927ff924a6caa94f8c5 Mon Sep 17 00:00:00 2001 From: Nicole Tietz-Sokolskaya <me@ntietz.com> Date: Fri, 10 Jan 2025 19:13:15 -0500 Subject: [PATCH] fix final clippy lint --- src/midi/daemon.rs | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/midi/daemon.rs b/src/midi/daemon.rs index 03fd07a..c3181d7 100644 --- a/src/midi/daemon.rs +++ b/src/midi/daemon.rs @@ -1,3 +1,19 @@ +//! Architecture for the MIDI connectivity: +//! +//! State is what's held by the daemon, and is used in an event loop. +//! - queues are passed in which are what we use to route messages +//! - this state can only be accessed directly by the event loop, as it owns the state +//! - does a `select!` (crossbeam) on the timer tick and on other channels +//! - each tick of the timer (on a timer rx channel), call `state.refresh_ports()` and assign +//! ports if they're mapped automatically (drums / windsynth / ignore) for anything that +//! isn't yet mapped (users can override in UI) +//! - listens to a queue of routing updates ("set connectionid to drums / windsynth / ignore") +//! from the UI +//! - receive from the message_receive queue and route the messages +//! +//! ideal would be to do the port refresh on a separate thread. but! it's relatively cheap (250 +//! microseconds per refresh) so it's not a big deal + use std::{collections::HashMap, thread::JoinHandle, time::Duration}; use crossbeam::{ @@ -19,21 +35,6 @@ pub enum Category { Ignore, } -/// Architecture for the MIDI connectivity: -/// -/// State is what's held by the daemon, and is used in an event loop. -/// - queues are passed in which are what we use to route messages -/// - this state can only be accessed directly by the event loop, as it owns the state -/// - does a `select!` (crossbeam) on the timer tick and on other channels -/// - each tick of the timer (on a timer rx channel), call `state.refresh_ports()` and assign -/// ports if they're mapped automatically (drums / windsynth / ignore) for anything that -/// isn't yet mapped (users can override in UI) -/// - listens to a queue of routing updates ("set connectionid to drums / windsynth / ignore") -/// from the UI -/// - receive from the message_receive queue and route the messages -/// -/// ideal would be to do the port refresh on a separate thread. but! it's relatively cheap (250 -/// microseconds per refresh) so it's not a big deal pub type ConnectionId = String; pub type Timestamp = u64;