Files
OpenRGB/main.cpp
Stefan Reiter 71c650cd45 Add cli.cpp and make it build at least
Not confirmed working as of yet, but at least it builds and
--list-devices works.

Code originally taken from Sam Lewis (@sam-masaki on gitlab.com), see:
https://gitlab.com/CalcProgrammer1/OpenRGB/-/merge_requests/9
2020-02-24 00:03:07 -06:00

50 lines
1.9 KiB
C++

/******************************************************************************************\
* *
* main.cpp *
* *
* Main function for OpenAuraSDK GUI project *
* *
\******************************************************************************************/
#include "OpenRGB.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 int cli_main(int argc, char *argv[]);
/******************************************************************************************\
* *
* main *
* *
* Main function. Detects busses and Aura controllers, then opens the main window *
* *
\******************************************************************************************/
int main(int argc, char* argv[])
{
if (argc > 1 && strcmp(argv[1], "--gui"))
{
return cli_main(argc, argv);
}
DetectRGBControllers();
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication a(argc, argv);
Ui::OpenRGBDialog2 dlg(busses, rgb_controllers);
dlg.show();
return a.exec();
}