1use crate::audio_bell::AudioBell;
2use std::time::Instant;
3
4pub struct BellState {
6 pub audio: Option<AudioBell>, pub last_count: u64, pub visual_flash: Option<Instant>, }
10
11impl Default for BellState {
12 fn default() -> Self {
13 Self::new()
14 }
15}
16
17impl BellState {
18 pub fn new() -> Self {
19 Self {
20 audio: {
21 match AudioBell::new() {
22 Ok(bell) => {
23 log::info!("Audio bell initialized successfully");
24 Some(bell)
25 }
26 Err(e) => {
27 log::warn!("Failed to initialize audio bell: {}", e);
28 None
29 }
30 }
31 },
32 last_count: 0,
33 visual_flash: None,
34 }
35 }
36}