forked from AttorneyOnline/AO2-Client
- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaoblipplayer.cpp
More file actions
Latest commit
26 lines (21 loc) · 680 Bytes
/
Copy pathaoblipplayer.cpp
File metadata and controls
26 lines (21 loc) · 680 Bytes
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
#include"aoblipplayer.h"
#include<string.h>
#include<QDebug>
AOBlipPlayer::AOBlipPlayer(QObject *p_parent, AOApplication *p_ao_app)
: AOAbstractPlayer(p_parent, p_ao_app)
{}
voidAOBlipPlayer::set_file(QString p_file)
{
m_file = ao_app->get_sounds_path() + QString("sfx-blip%1.wav").arg(p_file).toLower();
}
voidAOBlipPlayer::play()
{
try {
AOBassHandle *handle = newAOBassHandle(m_file, true, this);
connect(this, &AOBlipPlayer::new_volume, handle, &AOBassHandle::set_volume);
handle->set_volume(get_volume());
handle->play();
} catch (const std::exception &e_exception) {
qDebug() << e_exception.what();
}
}