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