aboutsummaryrefslogtreecommitdiff
path: root/aoblipplayer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'aoblipplayer.cpp')
-rw-r--r--aoblipplayer.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/aoblipplayer.cpp b/aoblipplayer.cpp
index c58e2cc9..5e3929e2 100644
--- a/aoblipplayer.cpp
+++ b/aoblipplayer.cpp
@@ -2,9 +2,9 @@
AOBlipPlayer::AOBlipPlayer(QWidget *parent, AOApplication *p_ao_app)
{
+ m_sfxplayer = new QSoundEffect;
m_parent = parent;
ao_app = p_ao_app;
- m_sfxplayer = new QMediaPlayer(m_parent, QMediaPlayer::Flag::LowLatency);
}
AOBlipPlayer::~AOBlipPlayer()
@@ -17,18 +17,17 @@ void AOBlipPlayer::set_blips(QString p_sfx)
{
m_sfxplayer->stop();
QString f_path = ao_app->get_sounds_path() + p_sfx.toLower();
- m_sfxplayer->setMedia(QUrl::fromLocalFile(f_path));
+ m_sfxplayer->setSource(QUrl::fromLocalFile(f_path));
set_volume(m_volume);
}
void AOBlipPlayer::blip_tick()
{
- //m_sfxplayer->stop();
m_sfxplayer->play();
}
void AOBlipPlayer::set_volume(int p_value)
{
m_volume = p_value;
- m_sfxplayer->setVolume(p_value);
+ m_sfxplayer->setVolume(p_value / 100.0);
}