mpc_valet/model/
layer_velocity_mode.rs

1use std::fmt::Display;
2
3use serde::{Deserialize, Serialize};
4
5/// Velocity range assignment mode.
6#[derive(PartialEq, Clone, Copy, Serialize, Deserialize)]
7pub enum LayerVelocityMode {
8    /// Assign non overlapping ranges to each layer.
9    Automatic,
10
11    /// Set the full range to all the layers.
12    Unison,
13}
14
15impl Default for LayerVelocityMode {
16    fn default() -> Self {
17        Self::Automatic
18    }
19}
20
21impl Display for LayerVelocityMode {
22    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23        match self {
24            LayerVelocityMode::Automatic => write!(f, "Automatic"),
25            LayerVelocityMode::Unison => write!(f, "Unison"),
26        }
27    }
28}