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.
30 lines
906 B
30 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;
|
|
};
|
|
|