feat: add delay tab

This commit is contained in:
2026-08-06 20:51:38 +02:00
parent e802067056
commit 470b95ace3
10 changed files with 662 additions and 47 deletions
+31
View File
@@ -1,3 +1,4 @@
use dsp_thomann::dsp408::types::DelayUnit;
use tauri::State;
use crate::state::{AppState, DSPDevice};
use dsp_thomann::dsp408::{DSP408, types};
@@ -307,4 +308,34 @@ pub async fn set_limiter(
.set_limiter(channel, threshold, attack, release)
.map_err(|e| e.to_string())
})
}
#[tauri::command]
pub async fn set_delay_unit(
state: State<'_, AppState>,
id: u64,
unit: types::DelayUnit,
) -> Result<bool, String> {
state.with_device_mut(id, |device| {
device
.dsp
.set_delay_unit(unit)
.map_err(|e| e.to_string())
})
}
#[tauri::command]
pub async fn set_delay(
state: State<'_, AppState>,
id: u64,
channel: types::Channel,
delay: f32,
unit: DelayUnit
) -> Result<bool, String> {
state.with_device_mut(id, |device| {
device
.dsp
.set_delay(channel, delay, unit)
.map_err(|e| e.to_string())
})
}
+2
View File
@@ -23,6 +23,8 @@ pub fn run() {
commands::set_gate,
commands::set_compressor,
commands::set_limiter,
commands::set_delay_unit,
commands::set_delay,
]
)
.run(tauri::generate_context!())