![Adeeb Shihadeh](/assets/img/avatar_default.png)
* move android into own dir * fix name * maybe this works? qt ui doesn't work on mac * fix that * pc sound works * fix pc build * lowercase * that needs to be real_arch * split into classes * fix typo in lib * Fix cycle alerts * Add qt multimedia libs to install scripts * Add ui/android folder * Fix android build * Raise exception if sound init fails * add missing return Co-authored-by: Willem Melching <willem.melching@gmail.com> Co-authored-by: Comma Device <device@comma.ai>
27 lines
605 B
C++
27 lines
605 B
C++
#pragma once
|
|
#include <SLES/OpenSLES.h>
|
|
#include <SLES/OpenSLES_Android.h>
|
|
|
|
#include "sound.hpp"
|
|
|
|
|
|
class SLSound : public Sound {
|
|
public:
|
|
SLSound();
|
|
~SLSound();
|
|
bool play(AudibleAlert alert);
|
|
void stop();
|
|
void setVolume(int volume);
|
|
|
|
private:
|
|
bool init();
|
|
SLObjectItf engine_ = nullptr;
|
|
SLObjectItf outputMix_ = nullptr;
|
|
int last_volume_ = 0;
|
|
double last_set_volume_time_ = 0.;
|
|
AudibleAlert currentSound_ = AudibleAlert::NONE;
|
|
struct Player;
|
|
std::map<AudibleAlert, Player *> player_;
|
|
friend void SLAPIENTRY slplay_callback(SLPlayItf playItf, void *context, SLuint32 event);
|
|
};
|