feat: add demo mode

This commit is contained in:
2026-08-11 22:02:46 +02:00
parent b572e1c794
commit d91bcaa20f
28 changed files with 3904 additions and 1876 deletions
+103
View File
@@ -461,3 +461,106 @@ pub async fn set_peq_band(
.map_err(|e| e.to_string())
})
}
#[tauri::command]
pub async fn store_current_configuration(
state: State<'_, AppState>,
id: u64,
preset_index: usize,
force: bool,
) -> Result<bool, String> {
state.with_device_mut(id, |device| {
device
.dsp
.store_current_configuration(preset_index, force)
.map_err(|e| e.to_string())
})
}
#[tauri::command]
pub async fn factory_reset(
state: State<'_, AppState>,
id: u64,
force: bool,
) -> Result<bool, String> {
state.with_device_mut(id, |device| {
device
.dsp
.factory_reset(force)
.map_err(|e| e.to_string())
})
}
#[tauri::command]
pub async fn copy_channel(
state: State<'_, AppState>,
id: u64,
channel_1: types::Channel,
channel_2: types::Channel,
) -> Result<bool, String> {
state.with_device_mut(id, |device| {
device
.dsp
.copy_channel(channel_1, channel_2)
.map_err(|e| e.to_string())
})
}
#[tauri::command]
pub async fn set_input_source(
state: State<'_, AppState>,
id: u64,
input_source: types::InputSource,
) -> Result<bool, String> {
state.with_device_mut(id, |device| {
device
.dsp
.set_input_source(input_source)
.map_err(|e| e.to_string())
})
}
#[tauri::command]
pub async fn link_channels(
state: State<'_, AppState>,
id: u64,
source: types::Channel,
destinations: Vec<types::Channel>,
) -> Result<bool, String> {
state.with_device_mut(id, |device| {
device
.dsp
.link_channels(source, destinations)
.map_err(|e| e.to_string())
})
}
#[tauri::command]
pub async fn set_bypass_peq(
state: State<'_, AppState>,
id: u64,
channel: types::Channel,
bypass: bool,
) -> Result<bool, String> {
state.with_device_mut(id, |device| {
device
.dsp
.set_bypass_peq(channel, bypass)
.map_err(|e| e.to_string())
})
}
#[tauri::command]
pub async fn set_channel_name(
state: State<'_, AppState>,
id: u64,
channel: types::Channel,
name: String,
) -> Result<bool, String> {
state.with_device_mut(id, |device| {
device
.dsp
.set_channel_name(channel, &name)
.map_err(|e| e.to_string())
})
}
+31 -20
View File
@@ -10,28 +10,39 @@ pub fn run() {
.manage(AppState::new())
.invoke_handler(tauri::generate_handler![
commands::create_dsp408,
commands::connect_dsp408,
commands::remove_dsp408,
commands::disconnect_dsp408,
commands::get_dsp_state,
commands::set_channel_gain,
commands::set_mute,
commands::set_channel_inverse_gain,
commands::recall_preset,
commands::get_meter_levels,
commands::set_current_preset_name,
commands::set_gate,
commands::set_compressor,
commands::set_limiter,
commands::set_delay_unit,
commands::set_delay,
commands::set_matrix_routing,
commands::set_matrix_gain,
commands::set_geq_band,
commands::set_geq_bypass,
commands::set_low_pass,
commands::set_high_pass,
commands::set_peq_band,
commands::connect_dsp408, // 0x10
commands::disconnect_dsp408, // 0x11
commands::set_delay_unit, // 0x15
commands::recall_preset, // 0x20
commands::store_current_configuration, // 0x21
commands::factory_reset, // 0x23
commands::set_current_preset_name, // 0x26
commands::copy_channel, // 0x2A
commands::set_compressor, // 0x30
commands::set_low_pass, // 0x31
commands::set_high_pass, // 0x32
commands::set_peq_band, // 0x33
commands::set_channel_gain, // 0x34
commands::set_mute, // 0x35
commands::set_channel_inverse_gain, // 0x36
commands::set_delay, // 0x38
commands::set_input_source, // 0x39
commands::set_matrix_routing, // 0x3A
commands::link_channels, // 0x3B
commands::set_bypass_peq, // 0x3C
commands::set_channel_name, // 0x3D
commands::set_gate, // 0x3E
commands::set_limiter, // 0x3F
commands::get_meter_levels, // 0x40
commands::set_matrix_gain, // 0x41
commands::set_geq_band, // 0x48
commands::set_geq_bypass, // 0x49
]
)
.run(tauri::generate_context!())