mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-17 07:12:08 +08:00
0ae5e7403e
* 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> old-commit-hash: acd1bde496904fbc0d97f4d89e630358c4d11f7f
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);
|
|
};
|