diff --git a/README.it.md b/README.it.md index 3574187..f394126 100644 --- a/README.it.md +++ b/README.it.md @@ -20,7 +20,7 @@ principali su Linux e Windows. ## Funzioni - **Visione dal vivo** del posto esterno (video H264) con **audio - bidirezionale**: ascolti dalle casse, tieni premuto un pulsante per parlare. + bidirezionale**: ascolti dalle casse, con un clic apri il microfono. - **Apertura di porta e cancello** (tutte le serrature del kit), con conferma. - **Luce scale** accesa/spenta, comprese le luci che l'app nasconde. - **Notifica sul desktop** quando suonano, con la foto del visitatore. diff --git a/README.md b/README.md index b1004dc..ed81f44 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Windows. ## Features - **Live view** of the entrance panel (H264 video) with **two-way audio**: - listen through the speakers, hold a button to talk. + listen through the speakers, click to open the microphone. - **Open the door and the gate** (every lock of the kit), with a confirmation. - **Staircase light** on/off, including lights the phone app hides. - **Ring notifications** on the desktop with the visitor's snapshot. diff --git a/docs/screenshots/live-en.png b/docs/screenshots/live-en.png index 473bd46..daeb7d6 100644 Binary files a/docs/screenshots/live-en.png and b/docs/screenshots/live-en.png differ diff --git a/docs/screenshots/live-it.png b/docs/screenshots/live-it.png index 034d2e9..0f0c484 100644 Binary files a/docs/screenshots/live-it.png and b/docs/screenshots/live-it.png differ diff --git a/src/bin/gui/app.rs b/src/bin/gui/app.rs index 62c1f12..c22a710 100644 --- a/src/bin/gui/app.rs +++ b/src/bin/gui/app.rs @@ -542,12 +542,21 @@ impl App { if ui.toggle_value(&mut self.muted, format!("🔇 {}", t(lang, "live.mute"))).changed() { self.send_quiet(Command::Mute(self.muted)); } - let talk = ui.add(egui::Button::new(format!("🎤 {}", t(lang, "live.talk"))).selected(self.talking)); - let down = talk.is_pointer_button_down_on(); - if down != self.talking { - self.talking = down; - self.send_quiet(Command::Talk(down)); + // One click opens the microphone, another closes it. + let label = if self.talking { t(lang, "live.mic_on") } else { t(lang, "live.talk") }; + let mut text = RichText::new(format!("🎤 {label}")); + if self.talking { + text = text.color(Color32::from_rgb(220, 80, 80)).strong(); } + let mic = egui::Button::new(text).selected(self.talking); + if ui.add(mic).clicked() { + self.talking = !self.talking; + self.send_quiet(Command::Talk(self.talking)); + } + } else { + // Every call starts with the microphone closed and audio on. + self.talking = false; + self.muted = false; } }); if let Some((w, h, rgba, n)) = frame { diff --git a/src/i18n.rs b/src/i18n.rs index aca06cd..3cd73f4 100644 --- a/src/i18n.rs +++ b/src/i18n.rs @@ -68,7 +68,8 @@ const TABLE: &[(&str, &str, &str)] = &[ ("live.connecting", "Connecting…", "Connessione…"), ("live.ended", "Ended: {}", "Terminata: {}"), ("live.mute", "Mute", "Muto"), - ("live.talk", "Hold to talk", "Tieni premuto per parlare"), + ("live.talk", "Talk", "Parla"), + ("live.mic_on", "Microphone on, click to close", "Microfono aperto, clicca per chiudere"), ("live.busy", "The intercom is busy (ringing or in a call).", "Il citofono è occupato (sta squillando o è in chiamata)."), ("events.empty", "No calls yet.", "Nessuna chiamata."), ("events.accepted", "Answered", "Risposta"),