-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.cpp
43 lines (40 loc) · 1007 Bytes
/
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
#ifdef COMLINE
#include <QCoreApplication>
#include "comline.h"
#endif
#ifdef GUI
#include <QApplication>
#include "ui/mainwindow.h"
#endif
int main(int argc, char *argv[])
{
#ifdef COMLINE
//argc++;
if (argc > 1) {
QCoreApplication a(argc,argv);
QStringList argList;
for (int p = 0;p <= argc;p++) {
argList << argv[p];
}
argList.removeAt(0);
//i use this to debug the app, ignore it
//argList.clear();
//argList << "--server" << "--server-type" << "udp";
//argList << "-c" << "1" << "-f" << "44100" << "-s" << "8" << "-i" << "pulse" << "-o" << "zero";
if (!argList.isEmpty()) {
//the start is triggered by the constructor
Comline* com = new Comline(&argList);
(void) com;
return a.exec();
}
return a.exec();
}
#endif
#ifdef GUI
QApplication a(argc,argv);
MainWindow w;
w.show();
return a.exec();
#endif
return 0;
}