-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.cpp
49 lines (39 loc) · 1.23 KB
/
main.cpp
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "mainwindow.h"
#include "bass.h"
#include <QApplication>
#include <QFileDialog>
#include <QMessageBox>
#include <QDebug>
#include <iostream>
int main(int argc, char *argv[])
{
srand(time(NULL));
QApplication a(argc, argv);
a.setWindowIcon(QIcon(":/Images/cover-placeholder.png"));
a.setApplicationDisplayName("AMPlayer");
a.setApplicationName("AMPlayer");
a.setDesktopFileName("AMPlayer");
a.setObjectName("AMPlayer");
a.setStartDragTime(1000);
a.setQuitOnLastWindowClosed(false);
for (int i = 1; i <= 5; i++)
a.setEffectEnabled((Qt::UIEffect)i, true);
if (!BASS_Init(-1, 96000, BASS_DEVICE_16BITS | BASS_DEVICE_STEREO, 0, NULL)) {
QMessageBox msgBox;
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
msgBox.setText("No audio devices found!");
msgBox.setStyleSheet("background-color: #141414; color: silver;");
msgBox.setInformativeText("Continue without audio?");
int ret = msgBox.exec();
switch (ret) {
case QMessageBox::No:
exit(0);
break;
default:
break;
}
}
BASS_SetConfig(BASS_CONFIG_SRC, 16);
MainWindow w;
return a.exec();
}