openpilot is an open source driver assistance system. openpilot performs the functions of Automated Lane Centering and Adaptive Cruise Control for over 200 supported car makes and models.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
906 B

#include <QMap>
#include <QSoundEffect>
#include <QString>
#include "selfdrive/hardware/hw.h"
#include "selfdrive/ui/ui.h"
const std::tuple<AudibleAlert, QString, bool> sound_list[] = {
{AudibleAlert::CHIME_DISENGAGE, "disengaged.wav", false},
{AudibleAlert::CHIME_ENGAGE, "engaged.wav", false},
{AudibleAlert::CHIME_WARNING1, "warning_1.wav", false},
{AudibleAlert::CHIME_WARNING2, "warning_2.wav", false},
{AudibleAlert::CHIME_WARNING2_REPEAT, "warning_2.wav", true},
{AudibleAlert::CHIME_WARNING_REPEAT, "warning_repeat.wav", true},
{AudibleAlert::CHIME_ERROR, "error.wav", false},
{AudibleAlert::CHIME_PROMPT, "error.wav", false},
};
class Sound : public QObject {
public:
explicit Sound(QObject *parent = 0);
protected:
void update();
void setAlert(const Alert &alert);
Alert current_alert = {};
QMap<AudibleAlert, QPair<QSoundEffect *, int>> sounds;
SubMaster sm;
};