Krolyxon
Commit 19d99c1

Branches

Refs →

budctlcratesbudctl-guisrcdemo.rs

46 lines · 1.5 KB · Rust

1//! Demo data: roughly what the owner's T310 reported at the last checkpoint. The GUI shows it
2//! until it talks to real buds.
3
4use budctl_core::status::{Battery, Charge, NoiseControl, Status, Switch};
5
6/// The buds the window shows.
7pub struct Buds {
8 pub name: String,
9 pub connected: bool,
10 pub status: Status,
11 /// The name to show for the EQ preset in use.
12 pub eq_name: String,
13}
14
15pub fn buds() -> Buds {
16 let charge = |level| Some(Charge { level, charging: false });
17 let switch = |key, label, on| Switch { key, label, on };
18 Buds {
19 name: "realme Buds T310".to_owned(),
20 connected: true,
21 status: Status {
22 battery: Battery {
23 left: charge(80),
24 right: charge(80),
25 case: None,
26 },
27 noise_control: Some(NoiseControl {
28 mode: "anc".to_owned(),
29 level: Some("deep".to_owned()),
30 }),
31 eq: Some("custom-4".to_owned()),
32 bass_level: None,
33 switches: vec![
34 switch("game", "Game mode", false),
35 switch("dual", "Dual connection", true),
36 switch("wind", "Wind-noise reduction", true),
37 switch("spatial", "3D sound", true),
38 switch("bass-boost", "Bass boost", true),
39 ],
40 codec: Some("SBC".to_owned()),
41 firmware: Some("1.1.0.43".to_owned()),
42 warnings: Vec::new(),
43 },
44 eq_name: "Custom1".to_owned(),
45 }
46}