qt sound cleanup

old-commit-hash: 1690fd62c2
commatwo_master
Adeeb Shihadeh 5 years ago
parent b251e323b0
commit 435d16ab87
  1. 9
      selfdrive/ui/qt/qt_sound.cc
  2. 1
      selfdrive/ui/qt/qt_sound.hpp

@ -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() {
}

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

Loading…
Cancel
Save