Skip to main content

rustriff_lib/domain/dto/effect/
cabinet_dto.rs

1use crate::config::DEFAULT_IR_FILE;
2use serde::{Deserialize, Serialize};
3use ts_rs::TS;
4
5fn default_ir_file_path() -> String {
6    DEFAULT_IR_FILE.to_string()
7}
8
9/// Data Transfer Object for the placeholder cabinet effect.
10#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
11#[ts(export)]
12pub struct CabinetDto {
13    /// Unique identifier for this effect instance.
14    pub id: u32,
15    /// Human-readable name displayed in the UI.
16    pub name: String,
17    /// Whether the effect is currently active or bypassed.
18    pub is_active: bool,
19    /// UI color for the pedal chassis. Hex string format: `"#rrggbb"`.
20    pub color: String,
21    /// IR filename resolved from either bundled defaults (`resources/default_ir`)
22    /// or the user custom IR directory, depending on what the effect references.
23    #[serde(default = "default_ir_file_path")]
24    pub ir_file_path: String,
25}