From b95c770acb879e29407aab9fb2abd229775b5e86 Mon Sep 17 00:00:00 2001 From: pjht Date: Thu, 1 Feb 2024 19:15:41 -0600 Subject: [PATCH] Fix A/D switches not making click sounds --- src/frontpanel.rs | 2 ++ src/state.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/src/frontpanel.rs b/src/frontpanel.rs index 76263ef..ad5ec5e 100644 --- a/src/frontpanel.rs +++ b/src/frontpanel.rs @@ -27,6 +27,7 @@ pub enum ActionSwitch { #[derive(Clone, Copy, Debug)] pub enum FrontpanelInteraction { ActionSw(ActionSwitch, SwitchState), + AddrData(u16), Power(bool), } @@ -163,6 +164,7 @@ impl Widget for &mut Frontpanel<'_> { { self.state.ad_sws = (self.state.ad_sws & !(bit_mask)) | (u16::from(sw_state) << (16 - i)); + self.interaction = Some(FrontpanelInteraction::AddrData(self.state.ad_sws())); resp.mark_changed(); }; }); diff --git a/src/state.rs b/src/state.rs index f7ea83a..9d22204 100644 --- a/src/state.rs +++ b/src/state.rs @@ -95,6 +95,7 @@ impl EmuState { self.audio_tx.send(AudioMessage::FanOff).unwrap(); } } + FrontpanelInteraction::AddrData(_) => (), } self.update_fp(); }