Silent Mode
Added toggle to mute all sounds while driving for a completely quiet openpilot driving experience.
This commit is contained in:
@@ -314,6 +314,7 @@ std::unordered_map<std::string, uint32_t> keys = {
|
|||||||
{"ShowMemoryUsage", PERSISTENT},
|
{"ShowMemoryUsage", PERSISTENT},
|
||||||
{"ShowStorageLeft", PERSISTENT},
|
{"ShowStorageLeft", PERSISTENT},
|
||||||
{"ShowStorageUsed", PERSISTENT},
|
{"ShowStorageUsed", PERSISTENT},
|
||||||
|
{"SilentMode", PERSISTENT},
|
||||||
{"StandardFollow", PERSISTENT},
|
{"StandardFollow", PERSISTENT},
|
||||||
{"StandardJerk", PERSISTENT},
|
{"StandardJerk", PERSISTENT},
|
||||||
{"StoppingDistance", PERSISTENT},
|
{"StoppingDistance", PERSISTENT},
|
||||||
|
|||||||
BIN
selfdrive/frogpilot/assets/toggle_icons/icon_mute.png
Normal file
BIN
selfdrive/frogpilot/assets/toggle_icons/icon_mute.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -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.", ""},
|
{"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"},
|
{"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"},
|
{"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"},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ class Soundd:
|
|||||||
|
|
||||||
if sm.updated['microphone'] and self.current_alert == AudibleAlert.none: # only update volume filter when not playing alert
|
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.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)
|
self.get_audible_alert(sm)
|
||||||
|
|
||||||
@@ -168,6 +168,7 @@ class Soundd:
|
|||||||
self.update_frogpilot_params()
|
self.update_frogpilot_params()
|
||||||
|
|
||||||
def update_frogpilot_params(self):
|
def update_frogpilot_params(self):
|
||||||
|
self.silent_mode = self.params.get_bool("SilentMode")
|
||||||
|
|
||||||
custom_theme = self.params.get_bool("CustomTheme")
|
custom_theme = self.params.get_bool("CustomTheme")
|
||||||
custom_sounds = self.params.get_int("CustomSounds") if custom_theme else 0
|
custom_sounds = self.params.get_int("CustomSounds") if custom_theme else 0
|
||||||
|
|||||||
Reference in New Issue
Block a user