qt sound cleanup

This commit is contained in:
Adeeb Shihadeh 2020-11-04 11:48:34 -08:00
parent b00cb389ef
commit 1690fd62c2
2 changed files with 3 additions and 7 deletions

View file

@ -1,5 +1,5 @@
#include <QUrl>
#include "qt/qt_sound.hpp"
#include "qt_sound.hpp"
QtSound::QtSound() {
for (auto &kv : sound_map) {
@ -9,7 +9,8 @@ QtSound::QtSound() {
}
bool QtSound::play(AudibleAlert alert) {
sounds[alert].setLoopCount(sound_map[alert].second>-1 ? sound_map[alert].second : QSoundEffect::Infinite);
int loops = sound_map[alert].second> - 1 ? sound_map[alert].second : QSoundEffect::Infinite;
sounds[alert].setLoopCount(loops);
sounds[alert].setVolume(0.7);
sounds[alert].play();
return true;
@ -24,7 +25,3 @@ void QtSound::stop() {
void QtSound::setVolume(int volume) {
// TODO: implement this
}
QtSound::~QtSound() {
}

View file

@ -6,7 +6,6 @@
class QtSound : public Sound {
public:
QtSound();
~QtSound();
bool play(AudibleAlert alert);
void stop();
void setVolume(int volume);