feat: use new meter format

This commit is contained in:
2026-09-13 09:04:04 +02:00
parent 1e00ca3a7c
commit 9f2ace9698
11 changed files with 131 additions and 124 deletions
+18 -17
View File
@@ -397,7 +397,7 @@ dependencies = [
"semver",
"serde",
"serde_json",
"thiserror 2.0.19",
"thiserror 2.0.20",
]
[[package]]
@@ -798,9 +798,10 @@ version = "0.1.0"
dependencies = [
"serde",
"serde_json",
"serde_with",
"strum",
"strum_macros",
"thiserror 2.0.19",
"thiserror 2.0.20",
]
[[package]]
@@ -2004,7 +2005,7 @@ dependencies = [
"once_cell",
"png 0.18.1",
"serde",
"thiserror 2.0.19",
"thiserror 2.0.20",
"windows-sys 0.61.2",
]
@@ -2628,7 +2629,7 @@ checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac"
dependencies = [
"getrandom 0.2.17",
"libredox",
"thiserror 2.0.19",
"thiserror 2.0.20",
]
[[package]]
@@ -3338,7 +3339,7 @@ dependencies = [
"tauri-runtime",
"tauri-runtime-wry",
"tauri-utils",
"thiserror 2.0.19",
"thiserror 2.0.20",
"tokio",
"tray-icon",
"url",
@@ -3389,7 +3390,7 @@ dependencies = [
"sha2",
"syn 2.0.119",
"tauri-utils",
"thiserror 2.0.19",
"thiserror 2.0.20",
"time",
"url",
"uuid",
@@ -3442,7 +3443,7 @@ dependencies = [
"serde_json",
"tauri",
"tauri-plugin",
"thiserror 2.0.19",
"thiserror 2.0.20",
"url",
"windows",
"zbus",
@@ -3466,7 +3467,7 @@ dependencies = [
"serde",
"serde_json",
"tauri-utils",
"thiserror 2.0.19",
"thiserror 2.0.20",
"url",
"webkit2gtk",
"webview2-com",
@@ -3529,7 +3530,7 @@ dependencies = [
"serde_json",
"serde_with",
"swift-rs",
"thiserror 2.0.19",
"thiserror 2.0.20",
"toml 1.1.3+spec-1.1.0",
"url",
"urlpattern",
@@ -3581,11 +3582,11 @@ dependencies = [
[[package]]
name = "thiserror"
version = "2.0.19"
version = "2.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09a43598840e33d5b0331f38c5e30d13bb11c11210a4b58f0d9b18a5a5eefcd9"
checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f"
dependencies = [
"thiserror-impl 2.0.19",
"thiserror-impl 2.0.20",
]
[[package]]
@@ -3601,9 +3602,9 @@ dependencies = [
[[package]]
name = "thiserror-impl"
version = "2.0.19"
version = "2.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43cbfe0cf76104d42a574802844187e84a305e531ed54455f11fbde0f10541cd"
checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af"
dependencies = [
"proc-macro2",
"quote",
@@ -3918,7 +3919,7 @@ dependencies = [
"once_cell",
"png 0.18.1",
"serde",
"thiserror 2.0.19",
"thiserror 2.0.20",
"windows-sys 0.61.2",
]
@@ -4278,7 +4279,7 @@ version = "0.38.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "381336cfffd772377d291702245447a5251a2ffa5bad679c99e61bc48bacbf9c"
dependencies = [
"thiserror 2.0.19",
"thiserror 2.0.20",
"windows",
"windows-core 0.61.2",
]
@@ -4713,7 +4714,7 @@ dependencies = [
"sha2",
"soup3",
"tao-macros",
"thiserror 2.0.19",
"thiserror 2.0.20",
"url",
"webkit2gtk",
"webkit2gtk-sys",
+5 -3
View File
@@ -44,7 +44,8 @@ impl AppState {
#[derive(serde::Serialize)]
pub struct DSP408Snapshot {
pub state: types::DSPState,
pub meters: types::Meters,
pub input_meters: types::InputMeters,
pub output_meters: types::OutputMeters,
pub mode: types::DSPMode,
}
@@ -101,7 +102,8 @@ pub async fn get_dsp_snapshot(
state.with_device_mut(id, |device| {
Ok(DSP408Snapshot {
state: device.dsp.state().clone(),
meters: device.dsp.meters().clone(),
input_meters: device.dsp.input_meters().clone(),
output_meters: device.dsp.output_meters().clone(),
mode: device.dsp.mode(),
})
})
@@ -202,7 +204,7 @@ pub async fn recall_preset(
pub async fn get_meter_levels(
state: State<'_, AppState>,
id: u64,
) -> Result<dsp_thomann::dsp408::types::Meters, String> {
) -> Result<(types::InputMeters, types::OutputMeters), String> {
state.with_device_mut(id, |device| {
device.dsp.get_meter_levels().map_err(|e| e.to_string())
})