use crate::audio_bell::AudioBell;
use std::time::Instant;
pub struct BellState {
pub(crate) audio: Option<AudioBell>, pub(crate) last_count: u64, pub(crate) visual_flash: Option<Instant>, }
impl Default for BellState {
fn default() -> Self {
Self::new()
}
}
impl BellState {
pub(crate) fn new() -> Self {
Self {
audio: {
match AudioBell::new() {
Ok(bell) => {
log::info!("Audio bell initialized successfully");
Some(bell)
}
Err(e) => {
log::warn!("Failed to initialize audio bell: {}", e);
None
}
}
},
last_count: 0,
visual_flash: None,
}
}
}