Custom themes
Added toggles for the "Custom Themes" configuration. Colors, icons, sounds, and turn signal animations are all individually toggleable.
This commit is contained in:
@@ -77,7 +77,7 @@ class Soundd:
|
||||
for sound in sound_list:
|
||||
filename, play_count, volume = sound_list[sound]
|
||||
|
||||
wavefile = wave.open(BASEDIR + "/selfdrive/assets/sounds/" + filename, 'r')
|
||||
wavefile = wave.open(self.sound_directory + filename, 'r')
|
||||
|
||||
assert wavefile.getnchannels() == 1
|
||||
assert wavefile.getsampwidth() == 2
|
||||
@@ -169,6 +169,21 @@ class Soundd:
|
||||
|
||||
def update_frogpilot_params(self):
|
||||
|
||||
custom_theme = self.params.get_bool("CustomTheme")
|
||||
custom_sounds = self.params.get_int("CustomSounds") if custom_theme else 0
|
||||
|
||||
theme_configuration = {
|
||||
0: "stock",
|
||||
1: "frog_theme",
|
||||
2: "tesla_theme",
|
||||
3: "stalin_theme"
|
||||
}
|
||||
|
||||
theme_name = theme_configuration.get(custom_sounds, "stock")
|
||||
self.sound_directory = (f"{BASEDIR}/selfdrive/frogpilot/assets/custom_themes/{theme_name}/sounds/" if custom_sounds else f"{BASEDIR}/selfdrive/assets/sounds/")
|
||||
|
||||
self.load_sounds()
|
||||
|
||||
def main():
|
||||
s = Soundd()
|
||||
s.soundd_thread()
|
||||
|
||||
Reference in New Issue
Block a user