feat: add delay tab
This commit is contained in:
@@ -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())
|
||||
})
|
||||
}
|
||||
@@ -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!())
|
||||
|
||||
Reference in New Issue
Block a user