mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-19 14:43:57 +08:00
ui: remove tests/playsound.cc (#32870)
remove playsound.cc
old-commit-hash: a312a102aa
This commit is contained in:
2
selfdrive/ui/tests/.gitignore
vendored
2
selfdrive/ui/tests/.gitignore
vendored
@@ -1,6 +1,4 @@
|
||||
test
|
||||
playsound
|
||||
test_sound
|
||||
test_translations
|
||||
ui_snapshot
|
||||
test_ui/report
|
||||
@@ -1,30 +0,0 @@
|
||||
#include <QApplication>
|
||||
#include <QSoundEffect>
|
||||
#include <QTimer>
|
||||
#include <QDebug>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
QApplication a(argc, argv);
|
||||
|
||||
QTimer::singleShot(0, [=]{
|
||||
QSoundEffect s;
|
||||
const char *vol = getenv("VOLUME");
|
||||
s.setVolume(vol ? atof(vol) : 1.0);
|
||||
for (int i = 1; i < argc; i++) {
|
||||
QString fn = argv[i];
|
||||
qDebug() << "playing" << fn;
|
||||
|
||||
QEventLoop loop;
|
||||
s.setSource(QUrl::fromLocalFile(fn));
|
||||
QEventLoop::connect(&s, &QSoundEffect::loadedChanged, &loop, &QEventLoop::quit);
|
||||
loop.exec();
|
||||
s.play();
|
||||
QEventLoop::connect(&s, &QSoundEffect::playingChanged, &loop, &QEventLoop::quit);
|
||||
loop.exec();
|
||||
}
|
||||
QCoreApplication::exit();
|
||||
});
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
Reference in New Issue
Block a user