forked from AttorneyOnline/AO2-Client
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaobasshandle.hpp
More file actions
53 lines (38 loc) · 1.05 KB
/
aobasshandle.hpp
File metadata and controls
53 lines (38 loc) · 1.05 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef AOBASSHANDLE_HPP
#define AOBASSHANDLE_HPP
#include <QObject>
#include <QString>
#include <bass.h>
#include "aoexception.hpp"
/**
* @brief The AOBassHandle is a small class to play sounds.
* The class may destroy itself once the audio provided is done playing.
*/
class AOBassHandle : public QObject
{
Q_OBJECT
public:
AOBassHandle(QObject *p_parent = nullptr);
AOBassHandle(QString p_file, bool p_suicide, QObject *p_parent = nullptr) noexcept(false);
~AOBassHandle();
QString get_file();
void set_file(QString p_file, bool p_suicide = false) noexcept(false);
// static
static void CALLBACK static_sync(HSYNC handle, DWORD channel, DWORD data, void *user);
public slots:
void play();
void stop();
void set_volume(int p_volume);
signals:
void stopped();
void body_discovery();
private:
QString m_file;
HSTREAM m_handle = 0;
HSYNC m_sync = 0;
bool m_suicide = false;
void sync(DWORD data);
private slots:
void suicide();
};
#endif // AOBASSHANDLE_HPP