2020-06-15 16:26:38 -06:00
|
|
|
#pragma once
|
|
|
|
#include <map>
|
2020-05-06 09:38:26 -06:00
|
|
|
#include "cereal/gen/cpp/log.capnp.h"
|
2020-01-17 12:05:23 -07:00
|
|
|
|
2020-06-15 16:26:38 -06:00
|
|
|
typedef cereal::CarControl::HUDControl::AudibleAlert AudibleAlert;
|
2020-01-17 12:05:23 -07:00
|
|
|
|
2020-09-09 11:04:28 -06:00
|
|
|
static std::map<AudibleAlert, std::pair<const char *, int>> sound_map {
|
|
|
|
// AudibleAlert, (file path, loop count)
|
|
|
|
{AudibleAlert::CHIME_DISENGAGE, {"../assets/sounds/disengaged.wav", 0}},
|
|
|
|
{AudibleAlert::CHIME_ENGAGE, {"../assets/sounds/engaged.wav", 0}},
|
|
|
|
{AudibleAlert::CHIME_WARNING1, {"../assets/sounds/warning_1.wav", 0}},
|
|
|
|
{AudibleAlert::CHIME_WARNING2, {"../assets/sounds/warning_2.wav", 0}},
|
|
|
|
{AudibleAlert::CHIME_WARNING2_REPEAT, {"../assets/sounds/warning_2.wav", 3}},
|
2020-10-20 18:42:19 -06:00
|
|
|
{AudibleAlert::CHIME_WARNING_REPEAT, {"../assets/sounds/warning_repeat.wav", -1}},
|
2020-09-09 11:04:28 -06:00
|
|
|
{AudibleAlert::CHIME_ERROR, {"../assets/sounds/error.wav", 0}},
|
|
|
|
{AudibleAlert::CHIME_PROMPT, {"../assets/sounds/error.wav", 0}}
|
|
|
|
};
|
2020-01-17 12:05:23 -07:00
|
|
|
|
2020-09-09 11:04:28 -06:00
|
|
|
class Sound {
|
|
|
|
public:
|
|
|
|
virtual bool play(AudibleAlert alert) = 0;
|
|
|
|
virtual void stop() = 0;
|
|
|
|
virtual void setVolume(int volume) = 0;
|
2020-06-15 16:26:38 -06:00
|
|
|
};
|