diff --git a/Controllers/ElgatoKeyLightController/ElgatoKeyLightController.cpp b/Controllers/ElgatoKeyLightController/ElgatoKeyLightController.cpp new file mode 100644 index 00000000..3d687590 --- /dev/null +++ b/Controllers/ElgatoKeyLightController/ElgatoKeyLightController.cpp @@ -0,0 +1,110 @@ +/*---------------------------------------------------------*\ +| Driver for Elgato Key Light | +| | +| Monks (imtherealestmonkey@gmail.com), 11/03/2021 | +\*---------------------------------------------------------*/ + +#include "ElgatoKeyLightController.h" +#include "json.hpp" +#include + +using json = nlohmann::json; + +ElgatoKeyLightController::ElgatoKeyLightController(std::string ip) +{ + /*-----------------------------------------------------------------*\ + | Fill in location string with device's IP address | + \*-----------------------------------------------------------------*/ + location = "IP: " + ip; + + /*-----------------------------------------------------------------*\ + | Open a TCP client sending to the device's IP, port 9123 | + \*-----------------------------------------------------------------*/ + port.tcp_client(ip.c_str(), "9123"); +} + +ElgatoKeyLightController::~ElgatoKeyLightController() +{ +} + +std::string ElgatoKeyLightController::GetLocation() +{ + return(location); +} + +std::string ElgatoKeyLightController::GetName() +{ + return("Elgato KeyLight"); +} + +std::string ElgatoKeyLightController::GetVersion() +{ + return(""); +} + +std::string ElgatoKeyLightController::GetManufacturer() +{ + return("Elgato"); +} + +std::string ElgatoKeyLightController::GetUniqueID() +{ + return(""); +} + +void ElgatoKeyLightController::SetColor(hsv_t hsv_color) +{ + // Weird elgato color format + int k_value = HSVToK(hsv_color.hue); + + port.tcp_client_connect(); + std::string buf = GetRequest(hsv_color.value, k_value); + port.tcp_client_write((char *)buf.c_str(), buf.length() + 1); + + port.tcp_close(); +} + +std::string ElgatoKeyLightController::GetRequest(int brightness, int temperature) +{ + json command; + + command["numberOfLights"] = 1; + + auto lights = json::array(); + lights.push_back(json::object({ {"on", 1}, {"temperature", temperature}, {"brightness", brightness}})); + command["lights"] = lights; + + std::string command_str = command.dump(); + std::string buf = "PUT /elgato/lights HTTP/1.1\r\nContent-Type: application/json\r\nContent-Length: " + + std::to_string(command_str.length()) + + "\r\nConnection: close\r\n\r\n" + command_str + "\r\n\r\n"; + return(buf); +} + +int ElgatoKeyLightController::HSVToK(int hue) +{ + int k_value; + + if(hue <= 60 && hue >= 0) + { + k_value = 2900; + } + else if(hue >= 61 && hue <= 120) + { + k_value = 4000; + } + else if(hue >= 121 && hue <= 180) + { + k_value = 5000; + } + else if(hue >= 181 && hue <= 240) + { + k_value = 6000; + } + else + { + k_value = 7000; + } + + return k_value; +} diff --git a/Controllers/ElgatoKeyLightController/ElgatoKeyLightController.h b/Controllers/ElgatoKeyLightController/ElgatoKeyLightController.h new file mode 100644 index 00000000..3f00168b --- /dev/null +++ b/Controllers/ElgatoKeyLightController/ElgatoKeyLightController.h @@ -0,0 +1,37 @@ +/*---------------------------------------------------------*\ +| Definitions for Elgato Key Light | +| | +| Monks (imtherealestmonkey@gmail.com), 11/11/2021 | +\*---------------------------------------------------------*/ + +#include "RGBController.h" +#include "net_port.h" +#include "hsv.h" + +#include +#include +#include +#include + +#pragma once + +class ElgatoKeyLightController +{ +public: + ElgatoKeyLightController(std::string ip); + ~ElgatoKeyLightController(); + + std::string GetLocation(); + std::string GetName(); + std::string GetVersion(); + std::string GetManufacturer(); + std::string GetUniqueID(); + + void SetColor(hsv_t hsv_color); + +private: + std::string GetRequest(int brightness, int temperature); + int HSVToK(int hue); + std::string location; + net_port port; +}; diff --git a/Controllers/ElgatoKeyLightController/ElgatoKeyLightControllerDetect.cpp b/Controllers/ElgatoKeyLightController/ElgatoKeyLightControllerDetect.cpp new file mode 100644 index 00000000..22fe2a3c --- /dev/null +++ b/Controllers/ElgatoKeyLightController/ElgatoKeyLightControllerDetect.cpp @@ -0,0 +1,48 @@ +#include "Detector.h" +#include "ElgatoKeyLightController.h" +#include "RGBController.h" +#include "RGBController_ElgatoKeyLight.h" +#include "SettingsManager.h" +#include +#include +#include + +/******************************************************************************************\ +* * +* DetectElgatoKeyLightControllers * +* * +* Detect Elgato KeyLight devices * +* * +\******************************************************************************************/ + +void DetectElgatoKeyLightControllers(std::vector &rgb_controllers) +{ + json elgato_keylight_settings; + + /*-------------------------------------------------*\ + | Get KeyLight settings from settings manager | + \*-------------------------------------------------*/ + elgato_keylight_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("ElgatoKeyLightDevices"); + + /*----------------------------------------------------------*\ + | If the Elgato Key Light settings contains devices, process| + \*----------------------------------------------------------*/ + if(elgato_keylight_settings.contains("devices")) + { + for(unsigned int device_idx = 0; device_idx < elgato_keylight_settings["devices"].size(); device_idx++) + { + if(elgato_keylight_settings["devices"][device_idx].contains("ip")) + { + std::string elgato_keylight_ip = elgato_keylight_settings["devices"][device_idx]["ip"]; + + ElgatoKeyLightController* controller = new ElgatoKeyLightController(elgato_keylight_ip); + RGBController_ElgatoKeyLight* rgb_controller = new RGBController_ElgatoKeyLight(controller); + + rgb_controllers.push_back(rgb_controller); + } + } + } + +} /* DetectElgatoKeyLightControllers() */ + +REGISTER_DETECTOR("ElgatoKeyLight", DetectElgatoKeyLightControllers); diff --git a/Controllers/ElgatoKeyLightController/RGBController_ElgatoKeyLight.cpp b/Controllers/ElgatoKeyLightController/RGBController_ElgatoKeyLight.cpp new file mode 100644 index 00000000..17531b7d --- /dev/null +++ b/Controllers/ElgatoKeyLightController/RGBController_ElgatoKeyLight.cpp @@ -0,0 +1,86 @@ +/*------------------------------------------------*\ +| RGBController_ElgatoKeyLight.cpp | +| | +| Generic RGB Interface for ElgatoKeyLight | +| | +| Monks (@iamtherealestmonkey) 11/03/2021 | +\*------------------------------------------------*/ + +#include "RGBController_ElgatoKeyLight.h" +#include "hsv.h" + +RGBController_ElgatoKeyLight::RGBController_ElgatoKeyLight(ElgatoKeyLightController* controller_ptr) +{ + controller = controller_ptr; + + name = controller->GetName(); + vendor = controller->GetManufacturer(); + type = DEVICE_TYPE_LIGHT; + version = controller->GetVersion(); + description = "Elgato KeyLight Device"; + serial = controller->GetUniqueID(); + location = controller->GetLocation(); + + mode Static; + Static.name = "Static"; + Static.value = 0; + Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR; + Static.color_mode = MODE_COLORS_PER_LED; + modes.push_back(Static); + + SetupZones(); +} + +RGBController_ElgatoKeyLight::~RGBController_ElgatoKeyLight() +{ + delete controller; +} + +void RGBController_ElgatoKeyLight::SetupZones() +{ + zone led_zone; + led_zone.name = "Keylight"; + led_zone.type = ZONE_TYPE_SINGLE; + led_zone.leds_min = 1; + led_zone.leds_max = 1; + led_zone.leds_count = 1; + led_zone.matrix_map = NULL; + zones.push_back(led_zone); + + led new_led; + new_led.name = "Keylight"; + + leds.push_back(new_led); + + SetupColors(); +} + +void RGBController_ElgatoKeyLight::ResizeZone(int /*zone*/, int /*new_size*/) +{ + /*---------------------------------------------------------*\ + | This device does not support resizing zones | + \*---------------------------------------------------------*/ +} + +void RGBController_ElgatoKeyLight::DeviceUpdateLEDs() +{ + RGBColor rgb_color = colors[0]; + hsv_t hsv_color; + rgb2hsv(rgb_color, &hsv_color); + controller->SetColor(hsv_color); +} + +void RGBController_ElgatoKeyLight::UpdateZoneLEDs(int /*zone*/) +{ + DeviceUpdateLEDs(); +} + +void RGBController_ElgatoKeyLight::UpdateSingleLED(int /*led*/) +{ + DeviceUpdateLEDs(); +} + +void RGBController_ElgatoKeyLight::DeviceUpdateMode() +{ + +} diff --git a/Controllers/ElgatoKeyLightController/RGBController_ElgatoKeyLight.h b/Controllers/ElgatoKeyLightController/RGBController_ElgatoKeyLight.h new file mode 100644 index 00000000..86641f09 --- /dev/null +++ b/Controllers/ElgatoKeyLightController/RGBController_ElgatoKeyLight.h @@ -0,0 +1,31 @@ +/*--------------------------------------------------*\ +| RGBController_ElgatoKeyLight.h | +| | +| Generic RGB Interface for Elgato KeyLight | +| | +| Monks (imtherealestmonkey@gmail.com) 11/1/2021 | +\*--------------------------------------------------*/ + +#pragma once +#include "RGBController.h" +#include "ElgatoKeyLightController.h" + +class RGBController_ElgatoKeyLight : public RGBController +{ +public: + RGBController_ElgatoKeyLight(ElgatoKeyLightController* controller_ptr); + ~RGBController_ElgatoKeyLight(); + + void SetupZones(); + + void ResizeZone(int zone, int new_size); + + void DeviceUpdateLEDs(); + void UpdateZoneLEDs(int zone); + void UpdateSingleLED(int led); + + void DeviceUpdateMode(); + +private: + ElgatoKeyLightController* controller; +}; diff --git a/OpenRGB.pro b/OpenRGB.pro index 903e6396..1d656592 100644 --- a/OpenRGB.pro +++ b/OpenRGB.pro @@ -208,6 +208,8 @@ HEADERS += pci_ids/pci_ids.h \ qt/DeviceView.h \ qt/OpenRGBDialog2.h \ + qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsEntry.h \ + qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsPage.h \ qt/OpenRGBPluginContainer.h \ qt/OpenRGBPluginsPage/OpenRGBPluginsEntry.h \ qt/OpenRGBPluginsPage/OpenRGBPluginsList.h \ @@ -367,6 +369,8 @@ HEADERS += Controllers/E131Controller/RGBController_E131.h \ Controllers/EKController/EKController.h \ Controllers/EKController/RGBController_EKController.h \ + Controllers/ElgatoKeyLightController/ElgatoKeyLightController.h \ + Controllers/ElgatoKeyLightController/RGBController_ElgatoKeyLight.h \ Controllers/ENESMBusController/ENESMBusController.h \ Controllers/ENESMBusController/RGBController_ENESMBus.h \ Controllers/ENESMBusController/ENESMBusInterface/ENESMBusInterface.h \ @@ -703,6 +707,8 @@ SOURCES += net_port/net_port.cpp \ qt/DeviceView.cpp \ qt/OpenRGBDialog2.cpp \ + qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsEntry.cpp \ + qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsPage.cpp \ qt/OpenRGBPluginContainer.cpp \ qt/OpenRGBPluginsPage/OpenRGBPluginsEntry.cpp \ qt/OpenRGBPluginsPage/OpenRGBPluginsList.cpp \ @@ -894,6 +900,9 @@ SOURCES += Controllers/EKController/EKControllerDetect.cpp \ Controllers/EKController/EKController.cpp \ Controllers/EKController/RGBController_EKController.cpp \ + Controllers/ElgatoKeyLightController/ElgatoKeyLightController.cpp \ + Controllers/ElgatoKeyLightController/ElgatoKeyLightControllerDetect.cpp \ + Controllers/ElgatoKeyLightController/RGBController_ElgatoKeyLight.cpp \ Controllers/ENESMBusController/ENESMBusController.cpp \ Controllers/ENESMBusController/ENESMBusControllerDetect.cpp \ Controllers/ENESMBusController/RGBController_ENESMBus.cpp \ @@ -1262,6 +1271,8 @@ FORMS += qt/OpenRGBDevicePage.ui \ qt/OpenRGBDialog.ui \ qt/OpenRGBDialog2.ui \ + qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsEntry.ui \ + qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsPage.ui \ qt/OpenRGBPluginContainer.ui \ qt/OpenRGBPluginsPage/OpenRGBPluginsEntry.ui \ qt/OpenRGBPluginsPage/OpenRGBPluginsPage.ui \ diff --git a/qt/OpenRGBDialog2.cpp b/qt/OpenRGBDialog2.cpp index 551ab874..85663b2c 100644 --- a/qt/OpenRGBDialog2.cpp +++ b/qt/OpenRGBDialog2.cpp @@ -472,6 +472,11 @@ OpenRGBDialog2::OpenRGBDialog2(QWidget *parent) : QMainWindow(parent), ui(new Op \*-----------------------------------------------------*/ AddNanoleafSettingsPage(); + /*-----------------------------------------------------*\ + | Add the ElgatoKeyLight settings page | + \*-----------------------------------------------------*/ + AddElgatoKeyLightSettingsPage(); + /*-----------------------------------------------------*\ | Add the SMBus Tools page if enabled | \*-----------------------------------------------------*/ @@ -936,6 +941,34 @@ void OpenRGBDialog2::AddNanoleafSettingsPage() ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel); } +void OpenRGBDialog2::AddElgatoKeyLightSettingsPage() +{ + /*-----------------------------------------------------*\ + | Create the Settings page | + \*-----------------------------------------------------*/ + ElgatoKeyLightSettingsPage = new OpenRGBElgatoKeyLightSettingsPage(); + + ui->SettingsTabBar->addTab(ElgatoKeyLightSettingsPage, ""); + + QString SettingsLabelString; + + if(OpenRGBThemeManager::IsDarkTheme()) + { + SettingsLabelString = "light_dark.png"; + } + else + { + SettingsLabelString = "light.png"; + } + + /*-----------------------------------------------------*\ + | Create the tab label | + \*-----------------------------------------------------*/ + TabLabel* SettingsTabLabel = new TabLabel(SettingsLabelString, "Elgato KeyLight Devices"); + + ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel); +} + void OpenRGBDialog2::AddPlugin(OpenRGBPluginEntry* plugin) { /*-----------------------------------------------------*\ diff --git a/qt/OpenRGBDialog2.h b/qt/OpenRGBDialog2.h index da57d6ae..24663b81 100644 --- a/qt/OpenRGBDialog2.h +++ b/qt/OpenRGBDialog2.h @@ -10,6 +10,7 @@ #include "OpenRGBSupportedDevicesPage.h" #include "OpenRGBSettingsPage.h" #include "OpenRGBE131SettingsPage/OpenRGBE131SettingsPage.h" +#include "OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsPage.h" #include "OpenRGBLIFXSettingsPage/OpenRGBLIFXSettingsPage.h" #include "OpenRGBPhilipsHueSettingsPage/OpenRGBPhilipsHueSettingsPage.h" #include "OpenRGBPhilipsWizSettingsPage/OpenRGBPhilipsWizSettingsPage.h" @@ -79,6 +80,7 @@ private: OpenRGBSupportedDevicesPage *SupportedPage; OpenRGBSettingsPage *SettingsPage; OpenRGBE131SettingsPage *E131SettingsPage; + OpenRGBElgatoKeyLightSettingsPage *ElgatoKeyLightSettingsPage; OpenRGBLIFXSettingsPage *LIFXSettingsPage; OpenRGBPhilipsHueSettingsPage *PhilipsHueSettingsPage; OpenRGBPhilipsWizSettingsPage *PhilipsWizSettingsPage; @@ -105,6 +107,7 @@ private: void AddSupportedDevicesPage(); void AddSettingsPage(); void AddE131SettingsPage(); + void AddElgatoKeyLightSettingsPage(); void AddLIFXSettingsPage(); void AddPhilipsHueSettingsPage(); void AddPhilipsWizSettingsPage(); diff --git a/qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsEntry.cpp b/qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsEntry.cpp new file mode 100644 index 00000000..497ac716 --- /dev/null +++ b/qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsEntry.cpp @@ -0,0 +1,16 @@ +#include "OpenRGBElgatoKeyLightSettingsEntry.h" +#include "ui_OpenRGBElgatoKeyLightSettingsEntry.h" + +using namespace Ui; + +OpenRGBElgatoKeyLightSettingsEntry::OpenRGBElgatoKeyLightSettingsEntry(QWidget *parent) : + QDialog(parent), + ui(new Ui::OpenRGBElgatoKeyLightSettingsEntryUi) +{ + ui->setupUi(this); +} + +OpenRGBElgatoKeyLightSettingsEntry::~OpenRGBElgatoKeyLightSettingsEntry() +{ + delete ui; +} diff --git a/qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsEntry.h b/qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsEntry.h new file mode 100644 index 00000000..5c4c8c03 --- /dev/null +++ b/qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsEntry.h @@ -0,0 +1,21 @@ +#ifndef OPENRGBELGATOKEYLIGHTSETTINGSENTRY_H +#define OPENRGBELGATOKEYLIGHTSETTINGSENTRY_H + +#include "ui_OpenRGBElgatoKeyLightSettingsEntry.h" +#include + +namespace Ui { +class OpenRGBElgatoKeyLightSettingsEntry; +} + +class Ui::OpenRGBElgatoKeyLightSettingsEntry : public QDialog +{ + Q_OBJECT + +public: + explicit OpenRGBElgatoKeyLightSettingsEntry(QWidget *parent = nullptr); + ~OpenRGBElgatoKeyLightSettingsEntry(); + Ui::OpenRGBElgatoKeyLightSettingsEntryUi *ui; +}; + +#endif // OPENRGBELGATOKEYLIGHTSETTINGSENTRY_H diff --git a/qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsEntry.ui b/qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsEntry.ui new file mode 100644 index 00000000..97569448 --- /dev/null +++ b/qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsEntry.ui @@ -0,0 +1,40 @@ + + + OpenRGBElgatoKeyLightSettingsEntryUi + + + + 0 + 0 + 225 + 85 + + + + Dialog + + + + + + + + + + + + IP: + + + + + + + + + + + + + + diff --git a/qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsPage.cpp b/qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsPage.cpp new file mode 100644 index 00000000..0969ef5b --- /dev/null +++ b/qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsPage.cpp @@ -0,0 +1,100 @@ +#include "OpenRGBElgatoKeyLightSettingsPage.h" +#include "ui_OpenRGBElgatoKeyLightSettingsPage.h" +#include "ResourceManager.h" + +using namespace Ui; + +OpenRGBElgatoKeyLightSettingsPage::OpenRGBElgatoKeyLightSettingsPage(QWidget *parent) : + QWidget(parent), + ui(new Ui::OpenRGBElgatoKeyLightSettingsPageUi) +{ + ui->setupUi(this); + + json elgato_keylight_settings; + + elgato_keylight_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("ElgatoKeyLightDevices"); + + /*---------------------------------------------------------------*\ + | If the Elgato Key Light settings contains devices, process | + \*---------------------------------------------------------------*/ + if(elgato_keylight_settings.contains("devices")) + { + for(unsigned int device_idx = 0; device_idx < elgato_keylight_settings["devices"].size(); device_idx++) + { + OpenRGBElgatoKeyLightSettingsEntry* entry = new OpenRGBElgatoKeyLightSettingsEntry; + + if(elgato_keylight_settings["devices"][device_idx].contains("ip")) + { + entry->ui->IPEdit->setText(QString::fromStdString(elgato_keylight_settings["devices"][device_idx]["ip"])); + } + + entries.push_back(entry); + + QListWidgetItem* item = new QListWidgetItem; + + item->setSizeHint(entry->sizeHint()); + + ui->ElgatoKeyLightDeviceList->addItem(item); + ui->ElgatoKeyLightDeviceList->setItemWidget(item, entry); + ui->ElgatoKeyLightDeviceList->show(); + } + } +} + +OpenRGBElgatoKeyLightSettingsPage::~OpenRGBElgatoKeyLightSettingsPage() +{ + delete ui; +} + +void Ui::OpenRGBElgatoKeyLightSettingsPage::on_AddElgatoKeyLightDeviceButton_clicked() +{ + OpenRGBElgatoKeyLightSettingsEntry* entry = new OpenRGBElgatoKeyLightSettingsEntry; + entries.push_back(entry); + + QListWidgetItem* item = new QListWidgetItem; + + item->setSizeHint(entry->sizeHint()); + + ui->ElgatoKeyLightDeviceList->addItem(item); + ui->ElgatoKeyLightDeviceList->setItemWidget(item, entry); + ui->ElgatoKeyLightDeviceList->show(); +} + +void Ui::OpenRGBElgatoKeyLightSettingsPage::on_RemoveElgatoKeyLightDeviceButton_clicked() +{ + int cur_row = ui->ElgatoKeyLightDeviceList->currentRow(); + + if(cur_row < 0) + { + return; + } + + QListWidgetItem* item = ui->ElgatoKeyLightDeviceList->takeItem(cur_row); + + ui->ElgatoKeyLightDeviceList->removeItemWidget(item); + delete item; + + delete entries[cur_row]; + entries.erase(entries.begin() + cur_row); +} + +void Ui::OpenRGBElgatoKeyLightSettingsPage::on_SaveElgatoKeyLightConfigurationButton_clicked() +{ + json elgato_keylight_settings; + + elgato_keylight_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("ElgatoKeyLightDevices"); + + elgato_keylight_settings["devices"].clear(); + + for(unsigned int device_idx = 0; device_idx < entries.size(); device_idx++) + { + /*-------------------------------------------------*\ + | Required parameters | + \*-------------------------------------------------*/ + elgato_keylight_settings["devices"][device_idx]["ip"] = entries[device_idx]->ui->IPEdit->text().toStdString(); + } + + ResourceManager::get()->GetSettingsManager()->SetSettings("ElgatoKeyLightDevices", elgato_keylight_settings); + ResourceManager::get()->GetSettingsManager()->SaveSettings(); +} + diff --git a/qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsPage.h b/qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsPage.h new file mode 100644 index 00000000..7d8fab14 --- /dev/null +++ b/qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsPage.h @@ -0,0 +1,34 @@ +#ifndef OPENRGBELGATOKEYLIGHTSETTINGSPAGE_H +#define OPENRGBELGATOKEYLIGHTSETTINGSPAGE_H + +#include "ui_OpenRGBElgatoKeyLightSettingsPage.h" +#include + +#include "OpenRGBElgatoKeyLightSettingsEntry.h" + +namespace Ui { +class OpenRGBElgatoKeyLightSettingsPage; +} + +class Ui::OpenRGBElgatoKeyLightSettingsPage : public QWidget +{ + Q_OBJECT + +public: + explicit OpenRGBElgatoKeyLightSettingsPage(QWidget *parent = nullptr); + ~OpenRGBElgatoKeyLightSettingsPage(); + +private slots: + void on_AddElgatoKeyLightDeviceButton_clicked(); + + void on_RemoveElgatoKeyLightDeviceButton_clicked(); + + void on_SaveElgatoKeyLightConfigurationButton_clicked(); + +private: + Ui::OpenRGBElgatoKeyLightSettingsPageUi *ui; + std::vector entries; + +}; + +#endif // OPENRGBELGATOKEYLIGHTSETTINGSPAGE_H diff --git a/qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsPage.ui b/qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsPage.ui new file mode 100644 index 00000000..028b9ad7 --- /dev/null +++ b/qt/OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsPage.ui @@ -0,0 +1,45 @@ + + + OpenRGBElgatoKeyLightSettingsPageUi + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + + + + + + Add + + + + + + + Remove + + + + + + + Save + + + + + + + +