From 435d16ab87a55187127934e70c9250e76646b538 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Wed, 4 Nov 2020 11:48:34 -0800 Subject: [PATCH] qt sound cleanup old-commit-hash: 1690fd62c2c93add43da8951867fdeae46092683 --- selfdrive/ui/qt/qt_sound.cc | 9 +++------ selfdrive/ui/qt/qt_sound.hpp | 1 - 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/selfdrive/ui/qt/qt_sound.cc b/selfdrive/ui/qt/qt_sound.cc index ba26f62fd9..107e299d55 100644 --- a/selfdrive/ui/qt/qt_sound.cc +++ b/selfdrive/ui/qt/qt_sound.cc @@ -1,5 +1,5 @@ #include -#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() { - -} diff --git a/selfdrive/ui/qt/qt_sound.hpp b/selfdrive/ui/qt/qt_sound.hpp index c2aab2de44..8c7f8aa348 100644 --- a/selfdrive/ui/qt/qt_sound.hpp +++ b/selfdrive/ui/qt/qt_sound.hpp @@ -6,7 +6,6 @@ class QtSound : public Sound { public: QtSound(); - ~QtSound(); bool play(AudibleAlert alert); void stop(); void setVolume(int volume);