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