blob: d85cc36f6f9c8bfa8af3cb0968ec5bcc1144da16 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#pragma once
#include "aoapplication.h"
#include <QDebug>
#include <QElapsedTimer>
#include <QWidget>
#include <string.h>
class AOBlipPlayer
{
public:
static constexpr int STREAM_COUNT = 5;
AOBlipPlayer(AOApplication *ao_app);
~AOBlipPlayer();
void setVolume(int value);
void setMuted(bool enabled);
void setBlip(QString blip);
void playBlip();
void updateInternalVolume();
private:
AOApplication *ao_app;
float m_volume = 0.0f;
bool m_muted = false;
bool m_initialized = false;
ma_sound m_stream[STREAM_COUNT]{};
};
|