soundd: misc cleanup + tests (#22796)

* pass AudibleAlert to setAlert

* apply reviews

* remove trailing underscore

* add current_alert_type

* common function get_alert

* same freq as ui

* small cleanup

* setvolumne on change

* static Alert::get

* test_sounds

* remove old test files

* loop twice

* assert loopsRemaining

* assert stop

* init to min_volumne

* Revert "remove old test files"

This reverts commit 12e8bfefae1ae7f8649d3eda1e4126ff8eb1fe17.

* move to ui/soundd

* move test to tests/test_sound.cc

* remove old tests

* cleanup

* lower volume

* Revert "remove old tests"

This reverts commit e6bb12abfa3d5cd0aa8986d2b8da0b1edc7ea31b.

* return Alert

* cleanup

* remove #include <optional>

* cleanup .gitignore

* revert to std::optional

* Revert "revert to std::optional"

This reverts commit a66291c51f3a846652837cc4a43d5d60dd81896b.

* cleanup

* remove volume check

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 797bb1acb0
This commit is contained in:
Dean Lee
2021-11-10 06:18:29 +08:00
committed by GitHub
parent 1e67fc25f1
commit c1a3683ccb
17 changed files with 230 additions and 160 deletions
+2 -1
View File
@@ -44,9 +44,10 @@ qt_env.Depends(assets, Glob('#selfdrive/assets/*', exclude=[assets, assets_src,
asset_obj = qt_env.Object("assets", assets)
# build soundd
qt_env.Program("_soundd", "soundd.cc", LIBS=qt_libs)
qt_env.Program("soundd/_soundd", ["soundd/main.cc", "soundd/sound.cc"], LIBS=qt_libs)
if GetOption('test'):
qt_env.Program("tests/playsound", "tests/playsound.cc", LIBS=base_libs)
qt_env.Program('tests/test_sound', ['tests/test_runner.cc', 'soundd/sound.cc', 'tests/test_sound.cc'], LIBS=[base_libs])
qt_env.SharedLibrary("qt/python_helpers", ["qt/qt_window.cc"], LIBS=qt_libs)