Updated OpenRGB.pro to dynamically resolve source files
* Created FORMS macro list dynamically * Added GUI_H and CONTROLLERS_H list to HEADERS * Added GUI_CPP and CONTROLLERS_CPP list to SOURCES * Added unique list of GUI_INCLUDES and CONTROLLER_INCLUDES to INCLUDES * Adjusted platform specific builds to align build targets
This commit is contained in:
parent
f4220dffb7
commit
d2b4ff1c56
37 changed files with 98 additions and 1557 deletions
|
|
@ -0,0 +1,75 @@
|
|||
#include "Detector.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_LinuxLED_Linux.h"
|
||||
#include "SettingsManager.h"
|
||||
#include <vector>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectLinuxLEDControllers *
|
||||
* *
|
||||
* Detect devices supported by the LinuxLED driver *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectLinuxLEDControllers()
|
||||
{
|
||||
json linux_led_settings;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Get Linux LED settings from settings manager |
|
||||
\*-------------------------------------------------*/
|
||||
linux_led_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("LinuxLEDDevices");
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| If the LinuxLED settings contains devices, process|
|
||||
\*-------------------------------------------------*/
|
||||
if(linux_led_settings.contains("devices"))
|
||||
{
|
||||
for(unsigned int device_idx = 0; device_idx < linux_led_settings["devices"].size(); device_idx++)
|
||||
{
|
||||
std::string name;
|
||||
std::string red_path;
|
||||
std::string green_path;
|
||||
std::string blue_path;
|
||||
|
||||
if(linux_led_settings["devices"][device_idx].contains("name"))
|
||||
{
|
||||
name = linux_led_settings["devices"][device_idx]["name"];
|
||||
}
|
||||
|
||||
if(linux_led_settings["devices"][device_idx].contains("red_path"))
|
||||
{
|
||||
red_path = linux_led_settings["devices"][device_idx]["red_path"];
|
||||
}
|
||||
|
||||
if(linux_led_settings["devices"][device_idx].contains("green_path"))
|
||||
{
|
||||
green_path = linux_led_settings["devices"][device_idx]["green_path"];
|
||||
}
|
||||
|
||||
if(linux_led_settings["devices"][device_idx].contains("blue_path"))
|
||||
{
|
||||
blue_path = linux_led_settings["devices"][device_idx]["blue_path"];
|
||||
}
|
||||
|
||||
LinuxLEDController* controller = new LinuxLEDController();
|
||||
controller->OpenRedPath(red_path);
|
||||
controller->OpenGreenPath(green_path);
|
||||
controller->OpenBluePath(blue_path);
|
||||
|
||||
RGBController_LinuxLED* rgb_controller = new RGBController_LinuxLED(controller);
|
||||
rgb_controller->name = name;
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
|
||||
} /* DetectLinuxLEDControllers() */
|
||||
|
||||
REGISTER_DETECTOR("Linux LED", DetectLinuxLEDControllers);
|
||||
Loading…
Add table
Add a link
Reference in a new issue