feat: add gain responsive

This commit is contained in:
2026-07-22 22:33:14 +02:00
parent 5cee5a2047
commit 4dc557a255
29 changed files with 1128 additions and 908 deletions

View File

@ -172,3 +172,35 @@ pub async fn set_channel_gain(
Ok(r)
})
}
#[tauri::command]
pub async fn set_mute(
state: State<'_, AppState>,
id: u64,
channel: dsp_thomann::dsp408::types::Channel,
muted: bool,
) -> Result<bool, String> {
state.with_device_mut(id, |device| {
let r = device.dsp
.set_mute(channel, muted)
.map_err(|e| e.to_string())?;
Ok(r)
})
}
#[tauri::command]
pub async fn set_channel_inverse_gain(
state: State<'_, AppState>,
id: u64,
channel: dsp_thomann::dsp408::types::Channel,
inverted: bool,
) -> Result<bool, String> {
state.with_device_mut(id, |device| {
let r = device.dsp
.set_channel_inverse_gain(channel, inverted)
.map_err(|e| e.to_string())?;
Ok(r)
})
}

View File

@ -15,6 +15,8 @@ pub fn run() {
commands::disconnect_dsp408,
commands::get_dsp_state,
commands::set_channel_gain,
commands::set_mute,
commands::set_channel_inverse_gain
]
)
.run(tauri::generate_context!())