-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
27 lines (22 loc) · 693 Bytes
/
Copy pathmain.cpp
File metadata and controls
27 lines (22 loc) · 693 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <QApplication>
#include <QQmlApplicationEngine>
#include <QQmlComponent>
#include <QQmlContext>
#include <QScopedPointer>
#include <QDir>
#include "soundplayer.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QQmlApplicationEngine engine;
QScopedPointer<SoundPlayer> player(new SoundPlayer());
engine.rootContext()->setContextProperty("soundplayer", player.data());
QQmlComponent component(&engine, QUrl(QStringLiteral("qrc:/main.qml")));
component.create();
#ifdef Q_OS_ANDROID
player->loadSamples("/sdcard/Download/");
#else
player->loadSamples(qApp->applicationDirPath() + QDir::separator());
#endif
return app.exec();
}