forked from CalcProgrammer1/OpenRGB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
70 lines (54 loc) · 2.5 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/******************************************************************************************\
* *
* main.cpp *
* *
* Main function for OpenAuraSDK GUI project *
* *
\******************************************************************************************/
#include "NetworkServer.h"
#include "OpenRGB.h"
#include "ProfileManager.h"
#include "RGBController.h"
#include "i2c_smbus.h"
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#include "OpenRGBDialog2.h"
extern std::vector<i2c_smbus_interface*> busses;
extern std::vector<RGBController*> rgb_controllers;
// See cli.cpp
extern unsigned int cli_main(int argc, char *argv[], std::vector<RGBController *> rgb_controllers_in, ProfileManager* profile_manager_in);
/******************************************************************************************\
* *
* main *
* *
* Main function. Detects busses and Aura controllers, then opens the main window *
* *
\******************************************************************************************/
int main(int argc, char* argv[])
{
ProfileManager profile_manager(rgb_controllers);
DetectRGBControllers();
profile_manager.LoadSizeFromProfile("sizes.ors");
unsigned int ret_flags = 0;
if(argc > 1)
{
ret_flags = cli_main(argc, argv, rgb_controllers, &profile_manager);
}
if(ret_flags && 2)
{
//GUI is enabled
}
bool show_i2c_tools = false;
if(ret_flags && 4)
{
//I2C Tools is enabled
show_i2c_tools = true;
}
NetworkServer server(rgb_controllers);
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication a(argc, argv);
Ui::OpenRGBDialog2 dlg(busses, rgb_controllers, &profile_manager, &server, show_i2c_tools);
dlg.show();
return a.exec();
}