feat: gate sectioon

This commit is contained in:
2026-07-31 13:24:24 +02:00
parent 06710b68d4
commit daf2bf32aa
18 changed files with 717 additions and 68 deletions
+20 -2
View File
@@ -1,6 +1,6 @@
use tauri::State;
use crate::state::{AppState, DSPDevice};
use dsp_thomann::dsp408::DSP408;
use dsp_thomann::dsp408::{DSP408, types};
use std::{net::IpAddr, str::FromStr};
use std::sync::{Arc, Mutex};
@@ -246,4 +246,22 @@ pub async fn set_current_preset_name(
.set_current_preset_name(&name)
.map_err(|e| e.to_string())
})
}
}
#[tauri::command]
pub async fn set_gate(
state: State<'_, AppState>,
id: u64,
channel: types::InputChannel,
threshold: f32,
attack: u16,
hold: u16,
release: u16,
) -> Result<bool, String> {
state.with_device_mut(id, |device| {
device
.dsp
.set_gate(channel, threshold, attack, hold, release)
.map_err(|e| e.to_string())
})
}
+1
View File
@@ -20,6 +20,7 @@ pub fn run() {
commands::recall_preset,
commands::get_meter_levels,
commands::set_current_preset_name,
commands::set_gate,
]
)
.run(tauri::generate_context!())