diff --git a/common/params.cc b/common/params.cc index 41b7a23..77d0034 100644 --- a/common/params.cc +++ b/common/params.cc @@ -314,6 +314,7 @@ std::unordered_map keys = { {"ShowMemoryUsage", PERSISTENT}, {"ShowStorageLeft", PERSISTENT}, {"ShowStorageUsed", PERSISTENT}, + {"SilentMode", PERSISTENT}, {"StandardFollow", PERSISTENT}, {"StandardJerk", PERSISTENT}, {"StoppingDistance", PERSISTENT}, diff --git a/selfdrive/frogpilot/assets/toggle_icons/icon_mute.png b/selfdrive/frogpilot/assets/toggle_icons/icon_mute.png new file mode 100644 index 0000000..3e31a13 Binary files /dev/null and b/selfdrive/frogpilot/assets/toggle_icons/icon_mute.png differ diff --git a/selfdrive/frogpilot/ui/visual_settings.cc b/selfdrive/frogpilot/ui/visual_settings.cc index ba4fb27..c3915e0 100644 --- a/selfdrive/frogpilot/ui/visual_settings.cc +++ b/selfdrive/frogpilot/ui/visual_settings.cc @@ -31,6 +31,7 @@ FrogPilotVisualsPanel::FrogPilotVisualsPanel(SettingsWindow *parent) : FrogPilot {"UnlimitedLength", "'Unlimited' Road UI Length", "Extend the display of the path, lane lines, and road edges as far as the system can detect, providing a more expansive view of the road ahead.", ""}, {"ScreenBrightness", "Screen Brightness", "Customize your screen brightness.", "../frogpilot/assets/toggle_icons/icon_light.png"}, + {"SilentMode", "Silent Mode", "Mute openpilot sounds for a quieter driving experience.", "../frogpilot/assets/toggle_icons/icon_mute.png"}, {"WheelIcon", "Steering Wheel Icon", "Replace the default steering wheel icon with a custom design, adding a unique touch to your interface.", "../assets/offroad/icon_openpilot.png"}, }; diff --git a/selfdrive/ui/soundd.py b/selfdrive/ui/soundd.py index b5f73f5..9766a6c 100644 --- a/selfdrive/ui/soundd.py +++ b/selfdrive/ui/soundd.py @@ -155,7 +155,7 @@ class Soundd: if sm.updated['microphone'] and self.current_alert == AudibleAlert.none: # only update volume filter when not playing alert self.spl_filter_weighted.update(sm["microphone"].soundPressureWeightedDb) - self.current_volume = self.calculate_volume(float(self.spl_filter_weighted.x)) + self.current_volume = self.calculate_volume(float(self.spl_filter_weighted.x)) if not self.silent_mode else 0 self.get_audible_alert(sm) @@ -168,6 +168,7 @@ class Soundd: self.update_frogpilot_params() def update_frogpilot_params(self): + self.silent_mode = self.params.get_bool("SilentMode") custom_theme = self.params.get_bool("CustomTheme") custom_sounds = self.params.get_int("CustomSounds") if custom_theme else 0