feat: add keep alive
This commit is contained in:
@ -203,4 +203,33 @@ pub async fn set_channel_inverse_gain(
|
||||
|
||||
Ok(r)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn recall_preset(
|
||||
state: State<'_, AppState>,
|
||||
id: u64,
|
||||
preset_index: usize,
|
||||
) -> Result<bool, String> {
|
||||
state.with_device_mut(id, |device| {
|
||||
let success = device
|
||||
.dsp
|
||||
.recall_preset(preset_index)
|
||||
.map_err(|e| e.to_string())?;
|
||||
|
||||
Ok(success)
|
||||
})
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn get_meter_levels(
|
||||
state: State<'_, AppState>,
|
||||
id: u64,
|
||||
) -> Result<dsp_thomann::dsp408::types::Meters, String> {
|
||||
state.with_device_mut(id, |device| {
|
||||
device
|
||||
.dsp
|
||||
.get_meter_levels()
|
||||
.map_err(|e| e.to_string())
|
||||
})
|
||||
}
|
||||
|
||||
@ -16,7 +16,9 @@ pub fn run() {
|
||||
commands::get_dsp_state,
|
||||
commands::set_channel_gain,
|
||||
commands::set_mute,
|
||||
commands::set_channel_inverse_gain
|
||||
commands::set_channel_inverse_gain,
|
||||
commands::recall_preset,
|
||||
commands::get_meter_levels,
|
||||
]
|
||||
)
|
||||
.run(tauri::generate_context!())
|
||||
|
||||
Reference in New Issue
Block a user