mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-03 08:41:47 +08:00
qt sound cleanup
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user