Initial commit

This commit is contained in:
2026-07-21 16:30:52 +02:00
commit c2b67d8bb2
46 changed files with 8518 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
use tauri::State;
use crate::state::AppState;
use dsp_thomann::dsp408::DSP408;
use std::{net::IpAddr, str::FromStr};
#[tauri::command]
pub fn device_count(
state: State<AppState>
) -> usize {
let devices = state.devices.lock().unwrap();
devices.len()
}
#[tauri::command]
pub fn create_dsp408(
state: State<AppState>,
ip: String,
port: u16,
device_id: u8,
) -> Result<usize, String> {
let mut devices = state
.devices
.lock()
.map_err(|e| e.to_string())?;
let ip = IpAddr::from_str(&ip).map_err(|e| e.to_string())?;
let dsp = DSP408::new(ip, port, device_id)
.map_err(|e| e.to_string())?;
devices.push(dsp);
Ok(devices.len())
}