Skip to main content

rustriff_lib/domain/dto/effect/
scdistortion_dto.rs

1use serde::{Deserialize, Serialize};
2use ts_rs::TS;
3
4/// # Data Transfer Object for SC Distortion Effect
5///
6/// `ScDistortionDto` is the serialisable representation of an [`SCDistortion`] effect
7/// for communication between the Rust backend and the TypeScript frontend.
8///
9/// This DTO is automatically generated for TypeScript via the `ts-rs` crate
10///
11/// [`SCDistortion`]: crate::services::effects::distortion::sc_distortion::SCDistortion
12#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
13#[ts(export)]
14pub struct ScDistortionDto {
15    /// Unique identifier for this effect instance. Used for targeting commands.
16    pub id: u32,
17    /// Human-readable name displayed in the UI pedal. Example: `"Distortion"`.
18    pub name: String,
19    /// Whether the effect is currently active/processing audio (`true`) or bypassed (`false`).
20    /// When `false`, the input signal passes through unchanged.
21    pub is_active: bool,
22    /// UI colour for the pedal chassis. Hex string format: `"#rrggbb"`.
23    pub color: String,
24    /// clipping threshold in the range `[0.0, 1.0]`.
25    pub threshold: f32,
26    /// Normalised output level boost in `[0.0, 1.0]`.
27    /// - `0.0` = unity gain (no boost)
28    /// - `1.0` = ×2.0 boost
29    pub level: f32,
30    /// The smoothing factor that determines how much the curve is curved towards the clipping threshold `[1.0,10.0]`.
31    pub smoothing: f32,
32}