diff --git a/Controllers/ElgatoLightStripController/ElgatoLightStripController.cpp b/Controllers/ElgatoLightStripController/ElgatoLightStripController.cpp new file mode 100644 index 00000000..a6b2f5c0 --- /dev/null +++ b/Controllers/ElgatoLightStripController/ElgatoLightStripController.cpp @@ -0,0 +1,158 @@ +/*--------------------------------------------------------*\ +| Driver for Elgato Light Strip | +| | +| Monks (imtherealestmonkey@gmail.com), 11/03/2021 | +| Edit by DomePlaysHD 14/03/2024 | +\*--------------------------------------------------------*/ + +#include "ElgatoLightStripController.h" +#include "json.hpp" +#include +#include +#include "LogManager.h" + +using json = nlohmann::json; +using namespace std::chrono_literals; + +ElgatoLightStripController::ElgatoLightStripController(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"); + + /*-----------------------------------------------------------*\ + | Handle responses received from the Elgato LightStrip device | + \*-----------------------------------------------------------*/ + port.tcp_client_connect(); + std::string buf = "GET /elgato/accessory-info HTTP/1.1\r\nContent-Type: application/json\r\nConnection: close\r\n\r\n"; + port.tcp_client_write((char *)buf.c_str(), buf.length() + 1); + + char recv_buf[1024]; + int size = port.tcp_listen(recv_buf, sizeof(recv_buf)); + port.tcp_close(); + + if(size > 0) + { + /*-----------------------------------------------------------*\ + | Get response body | + \*-----------------------------------------------------------*/ + std::istringstream recv_stream(recv_buf); + std::vector recv_list; + std::string current_line; + + while(std::getline(recv_stream, current_line, '\n')) + { + recv_list.push_back(current_line); + } + + std::string result = recv_list[5]; + json elgato_lightstrip_data = json::parse(result); + + firmware_version = elgato_lightstrip_data["firmwareVersion"]; + serialnumber = elgato_lightstrip_data["serialNumber"]; + displayname = elgato_lightstrip_data["displayName"]; + + LOG_DEBUG("[ElgatoLightStrip] [%s]", result.data()); + } +} + +ElgatoLightStripController::~ElgatoLightStripController() +{ +} + +std::string ElgatoLightStripController::GetLocation() +{ + return(location); +} + +std::string ElgatoLightStripController::GetName() +{ + return(displayname); +} + +std::string ElgatoLightStripController::GetVersion() +{ + return(firmware_version); +} + +std::string ElgatoLightStripController::GetManufacturer() +{ + return("Elgato"); +} + +std::string ElgatoLightStripController::GetUniqueID() +{ + return(serialnumber); +} + +void ElgatoLightStripController::SetColor(hsv_t hsv_color) +{ + if(hsv_color.hue < 0) + { + hsv_color.hue = 0; + } + + if(hsv_color.hue > 360) + { + hsv_color.hue = 360; + } + + if(hsv_color.saturation > 100) + { + hsv_color.saturation = 100; + } + + /*-------------------------------------------------*\ + | Delay to prevent it from getting stuck on effects | + \*-------------------------------------------------*/ + std::this_thread::sleep_for(std::chrono::milliseconds(150)); + + port.tcp_client_connect(); + std::string buf = GetRequest(hsv_color.hue, hsv_color.saturation, GetBrightness()); + port.tcp_client_write((char *)buf.c_str(), buf.length() + 1); + port.tcp_close(); +} + +std::string ElgatoLightStripController::GetRequest(int hue, int saturation, int brightness) +{ + json command; + + command["numberOfLights"] = 1; + + json lights = json::array(); + lights.push_back(json::object({ {"on", 1}, {"hue", hue}, {"saturation", saturation}, {"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 ElgatoLightStripController::GetBrightness() +{ + if(device_brightness > 100 || device_brightness < 0) + { + device_brightness = 100; + } + + return device_brightness; +} + +void ElgatoLightStripController::SetBrightness(int brightness) +{ + if(brightness > 100 || device_brightness < 0) + { + brightness = 100; + } + + device_brightness = brightness; +} diff --git a/Controllers/ElgatoLightStripController/ElgatoLightStripController.h b/Controllers/ElgatoLightStripController/ElgatoLightStripController.h new file mode 100644 index 00000000..48d12b96 --- /dev/null +++ b/Controllers/ElgatoLightStripController/ElgatoLightStripController.h @@ -0,0 +1,38 @@ +/*--------------------------------------------------------*\ +| Definitions for Elgato Light Strip | +| | +| Monks (imtherealestmonkey@gmail.com), 11/03/2021 | +| Edit by DomePlaysHD 12/03/2024 | +\*--------------------------------------------------------*/ + +#include "net_port.h" +#include "hsv.h" +#include + +#pragma once + +class ElgatoLightStripController +{ + public: + ElgatoLightStripController(std::string ip); + ~ElgatoLightStripController(); + + std::string GetLocation(); + std::string GetName(); + std::string GetVersion(); + std::string GetManufacturer(); + std::string GetUniqueID(); + + void SetColor(hsv_t hsv_color); + int GetBrightness(); + void SetBrightness(int brightness); + + private: + std::string GetRequest(int hue, int saturation, int brightness); + std::string location; + std::string firmware_version; + std::string serialnumber; + std::string displayname; + net_port port; + int device_brightness; +}; diff --git a/Controllers/ElgatoLightStripController/ElgatoLightStripControllerDetect.cpp b/Controllers/ElgatoLightStripController/ElgatoLightStripControllerDetect.cpp new file mode 100644 index 00000000..dae13d40 --- /dev/null +++ b/Controllers/ElgatoLightStripController/ElgatoLightStripControllerDetect.cpp @@ -0,0 +1,41 @@ +#include "Detector.h" +#include "ElgatoLightStripController.h" +#include "RGBController_ElgatoLightStrip.h" +#include "SettingsManager.h" + +/******************************************************************************************\ +* * +* Detect Elgato LightStrip devices * +* * +\******************************************************************************************/ + +void DetectElgatoLightStripControllers() +{ + json elgato_lightstrip_settings; + + /*-------------------------------------------------*\ + | Get LightStrip settings from settings manager | + \*-------------------------------------------------*/ + elgato_lightstrip_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("ElgatoLightStripDevices"); + + /*------------------------------------------------------------*\ + | If the Elgato Light Strip settings contains devices, process | + \*------------------------------------------------------------*/ + if(elgato_lightstrip_settings.contains("devices")) + { + for(unsigned int device_idx = 0; device_idx < elgato_lightstrip_settings["devices"].size(); device_idx++) + { + if(elgato_lightstrip_settings["devices"][device_idx].contains("ip")) + { + std::string elgato_lightstrip_ip = elgato_lightstrip_settings["devices"][device_idx]["ip"]; + + ElgatoLightStripController* controller = new ElgatoLightStripController(elgato_lightstrip_ip); + RGBController_ElgatoLightStrip* rgb_controller = new RGBController_ElgatoLightStrip(controller); + + ResourceManager::get()->RegisterRGBController(rgb_controller); + } + } + } +} + +REGISTER_DETECTOR("Elgato Light Strip", DetectElgatoLightStripControllers); diff --git a/Controllers/ElgatoLightStripController/RGBController_ElgatoLightStrip.cpp b/Controllers/ElgatoLightStripController/RGBController_ElgatoLightStrip.cpp new file mode 100644 index 00000000..9983ba7e --- /dev/null +++ b/Controllers/ElgatoLightStripController/RGBController_ElgatoLightStrip.cpp @@ -0,0 +1,90 @@ +/*--------------------------------------------------------*\ +| RGBController_ElgatoLightStrip.cpp | +| | +| Generic RGB Interface for ElgatoLightStrip | +| | +| Monks (@iamtherealestmonkey) 11/03/2021 | +| Edit by DomePlaysHD 12/03/2024 | +\*-------------------------------------------------------*/ + +#include "RGBController_ElgatoLightStrip.h" +#include "hsv.h" + +RGBController_ElgatoLightStrip::RGBController_ElgatoLightStrip(ElgatoLightStripController* controller_ptr) +{ + controller = controller_ptr; + + name = controller->GetName(); + vendor = controller->GetManufacturer(); + type = DEVICE_TYPE_LEDSTRIP; + version = controller->GetVersion(); + description = "Elgato LightStrip Device"; + serial = controller->GetUniqueID(); + location = controller->GetLocation(); + + mode Direct; + Direct.name = "Direct"; + Direct.value = 0; + Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS; + Direct.color_mode = MODE_COLORS_PER_LED; + Direct.brightness_min = 0; + Direct.brightness_max = 100; + Direct.brightness = 100; + modes.push_back(Direct); + + SetupZones(); +} + +RGBController_ElgatoLightStrip::~RGBController_ElgatoLightStrip() +{ + delete controller; +} + +void RGBController_ElgatoLightStrip::SetupZones() +{ + zone led_zone; + led_zone.name = "Lightstrip"; + 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 = "Lightstrip"; + leds.push_back(new_led); + + SetupColors(); +} + +void RGBController_ElgatoLightStrip::ResizeZone(int /*zone*/, int /*new_size*/) +{ + /*---------------------------------------------------------*\ + | This device does not support resizing zones | + \*---------------------------------------------------------*/ +} + +void RGBController_ElgatoLightStrip::DeviceUpdateLEDs() +{ + RGBColor rgb_color = colors[0]; + hsv_t hsv_color; + rgb2hsv(rgb_color, &hsv_color); + controller->SetColor(hsv_color); + controller->SetBrightness((unsigned char)modes[(unsigned int)active_mode].brightness); +} + +void RGBController_ElgatoLightStrip::UpdateZoneLEDs(int /*zone*/) +{ + DeviceUpdateLEDs(); +} + +void RGBController_ElgatoLightStrip::UpdateSingleLED(int /*led*/) +{ + DeviceUpdateLEDs(); +} + +void RGBController_ElgatoLightStrip::DeviceUpdateMode() +{ + DeviceUpdateLEDs(); +} diff --git a/Controllers/ElgatoLightStripController/RGBController_ElgatoLightStrip.h b/Controllers/ElgatoLightStripController/RGBController_ElgatoLightStrip.h new file mode 100644 index 00000000..38dd3431 --- /dev/null +++ b/Controllers/ElgatoLightStripController/RGBController_ElgatoLightStrip.h @@ -0,0 +1,33 @@ +/*--------------------------------------------------------*\ +| RGBController_ElgatoLightStrip.h | +| | +| Generic RGB Interface for Elgato LightStrip | +| | +| Monks (imtherealestmonkey@gmail.com) 11/01/2021 | +| Edit by DomePlaysHD 12/03/2024 | +\*--------------------------------------------------------*/ + +#pragma once + +#include "RGBController.h" +#include "ElgatoLightStripController.h" + +class RGBController_ElgatoLightStrip : public RGBController +{ + public: + RGBController_ElgatoLightStrip(ElgatoLightStripController* controller_ptr); + ~RGBController_ElgatoLightStrip(); + + void SetupZones(); + + void ResizeZone(int zone, int new_size); + + void DeviceUpdateLEDs(); + void UpdateZoneLEDs(int zone); + void UpdateSingleLED(int led); + + void DeviceUpdateMode(); + + private: + ElgatoLightStripController* controller; +}; diff --git a/qt/OpenRGBDialog2/OpenRGBDialog2.cpp b/qt/OpenRGBDialog2/OpenRGBDialog2.cpp index 2c4c92aa..916b0ded 100644 --- a/qt/OpenRGBDialog2/OpenRGBDialog2.cpp +++ b/qt/OpenRGBDialog2/OpenRGBDialog2.cpp @@ -486,6 +486,11 @@ OpenRGBDialog2::OpenRGBDialog2(QWidget *parent) : QMainWindow(parent), ui(new Op \*-----------------------------------------------------*/ AddElgatoKeyLightSettingsPage(); + /*-----------------------------------------------------*\ + | Add the ElgatoLightStrip settings page | + \*-----------------------------------------------------*/ + AddElgatoLightStripSettingsPage(); + /*-----------------------------------------------------*\ | Add the SMBus Tools page if enabled | \*-----------------------------------------------------*/ @@ -914,6 +919,23 @@ void OpenRGBDialog2::AddElgatoKeyLightSettingsPage() ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel); } +void OpenRGBDialog2::AddElgatoLightStripSettingsPage() +{ + /*-----------------------------------------------------*\ + | Create the Settings page | + \*-----------------------------------------------------*/ + ElgatoLightStripSettingsPage = new OpenRGBElgatoLightStripSettingsPage(); + + ui->SettingsTabBar->addTab(ElgatoLightStripSettingsPage, ""); + + /*-----------------------------------------------------*\ + | Create the tab label | + \*-----------------------------------------------------*/ + TabLabel* SettingsTabLabel = new TabLabel(OpenRGBFont::bulb, tr("Elgato LightStrip Devices"), (char *)"Elgato LightStrip Devices", (char *)context); + + ui->SettingsTabBar->tabBar()->setTabButton(ui->SettingsTabBar->tabBar()->count() - 1, QTabBar::LeftSide, SettingsTabLabel); +} + void OpenRGBDialog2::AddPlugin(OpenRGBPluginEntry* plugin) { /*-----------------------------------------------------*\ diff --git a/qt/OpenRGBDialog2/OpenRGBDialog2.h b/qt/OpenRGBDialog2/OpenRGBDialog2.h index 907cb465..e7eceb80 100644 --- a/qt/OpenRGBDialog2/OpenRGBDialog2.h +++ b/qt/OpenRGBDialog2/OpenRGBDialog2.h @@ -12,6 +12,7 @@ #include "OpenRGBDMXSettingsPage/OpenRGBDMXSettingsPage.h" #include "OpenRGBE131SettingsPage/OpenRGBE131SettingsPage.h" #include "OpenRGBElgatoKeyLightSettingsPage/OpenRGBElgatoKeyLightSettingsPage.h" +#include "OpenRGBElgatoLightStripSettingsPage/OpenRGBElgatoLightStripSettingsPage.h" #include "OpenRGBKasaSmartSettingsPage/OpenRGBKasaSmartSettingsPage.h" #include "OpenRGBLIFXSettingsPage/OpenRGBLIFXSettingsPage.h" #include "OpenRGBPhilipsHueSettingsPage/OpenRGBPhilipsHueSettingsPage.h" @@ -88,6 +89,7 @@ private: OpenRGBDMXSettingsPage *DMXSettingsPage; OpenRGBE131SettingsPage *E131SettingsPage; OpenRGBElgatoKeyLightSettingsPage *ElgatoKeyLightSettingsPage; + OpenRGBElgatoLightStripSettingsPage *ElgatoLightStripSettingsPage; OpenRGBKasaSmartSettingsPage *KasaSmartSettingsPage; OpenRGBLIFXSettingsPage *LIFXSettingsPage; OpenRGBPhilipsHueSettingsPage *PhilipsHueSettingsPage; @@ -117,6 +119,7 @@ private: void AddDMXSettingsPage(); void AddE131SettingsPage(); void AddElgatoKeyLightSettingsPage(); + void AddElgatoLightStripSettingsPage(); void AddKasaSmartSettingsPage(); void AddLIFXSettingsPage(); void AddPhilipsHueSettingsPage(); diff --git a/qt/OpenRGBElgatoLightStripSettingsPage/OpenRGBElgatoLightStripSettingsEntry.cpp b/qt/OpenRGBElgatoLightStripSettingsPage/OpenRGBElgatoLightStripSettingsEntry.cpp new file mode 100644 index 00000000..a0f8c0c4 --- /dev/null +++ b/qt/OpenRGBElgatoLightStripSettingsPage/OpenRGBElgatoLightStripSettingsEntry.cpp @@ -0,0 +1,24 @@ +#include "OpenRGBElgatoLightStripSettingsEntry.h" +#include "ui_OpenRGBElgatoLightStripSettingsEntry.h" + +using namespace Ui; + +OpenRGBElgatoLightStripSettingsEntry::OpenRGBElgatoLightStripSettingsEntry(QWidget *parent) : + QDialog(parent), + ui(new Ui::OpenRGBElgatoLightStripSettingsEntryUi) +{ + ui->setupUi(this); +} + +OpenRGBElgatoLightStripSettingsEntry::~OpenRGBElgatoLightStripSettingsEntry() +{ + delete ui; +} + +void OpenRGBElgatoLightStripSettingsEntry::changeEvent(QEvent *event) +{ + if(event->type() == QEvent::LanguageChange) + { + ui->retranslateUi(this); + } +} diff --git a/qt/OpenRGBElgatoLightStripSettingsPage/OpenRGBElgatoLightStripSettingsEntry.h b/qt/OpenRGBElgatoLightStripSettingsPage/OpenRGBElgatoLightStripSettingsEntry.h new file mode 100644 index 00000000..37d9f493 --- /dev/null +++ b/qt/OpenRGBElgatoLightStripSettingsPage/OpenRGBElgatoLightStripSettingsEntry.h @@ -0,0 +1,25 @@ +#ifndef OPENRGBELGATOLIGHTSTRIPSETTINGSENTRY_H +#define OPENRGBELGATOLIGHTSTRIPSETTINGSENTRY_H + +#include "ui_OpenRGBElgatoLightStripSettingsEntry.h" +#include + +namespace Ui +{ + class OpenRGBElgatoLightStripSettingsEntry; +} + +class Ui::OpenRGBElgatoLightStripSettingsEntry : public QDialog +{ + Q_OBJECT + + public: + explicit OpenRGBElgatoLightStripSettingsEntry(QWidget *parent = nullptr); + ~OpenRGBElgatoLightStripSettingsEntry(); + Ui::OpenRGBElgatoLightStripSettingsEntryUi *ui; + + private slots: + void changeEvent(QEvent *event); +}; + +#endif // OPENRGBELGATOLIGHTSTRIPSETTINGSENTRY_H diff --git a/qt/OpenRGBElgatoLightStripSettingsPage/OpenRGBElgatoLightStripSettingsEntry.ui b/qt/OpenRGBElgatoLightStripSettingsPage/OpenRGBElgatoLightStripSettingsEntry.ui new file mode 100644 index 00000000..60c1fdca --- /dev/null +++ b/qt/OpenRGBElgatoLightStripSettingsPage/OpenRGBElgatoLightStripSettingsEntry.ui @@ -0,0 +1,40 @@ + + + OpenRGBElgatoLightStripSettingsEntryUi + + + + 0 + 0 + 225 + 85 + + + + Dialog + + + + + + + + + + + + IP: + + + + + + + + + + + + + + diff --git a/qt/OpenRGBElgatoLightStripSettingsPage/OpenRGBElgatoLightStripSettingsPage.cpp b/qt/OpenRGBElgatoLightStripSettingsPage/OpenRGBElgatoLightStripSettingsPage.cpp new file mode 100644 index 00000000..5a7c61db --- /dev/null +++ b/qt/OpenRGBElgatoLightStripSettingsPage/OpenRGBElgatoLightStripSettingsPage.cpp @@ -0,0 +1,108 @@ +#include "OpenRGBElgatoLightStripSettingsPage.h" +#include "ui_OpenRGBElgatoLightStripSettingsPage.h" +#include "ResourceManager.h" +#include "SettingsManager.h" + +using namespace Ui; + +OpenRGBElgatoLightStripSettingsPage::OpenRGBElgatoLightStripSettingsPage(QWidget *parent) : + QWidget(parent), + ui(new Ui::OpenRGBElgatoLightStripSettingsPageUi) +{ + ui->setupUi(this); + + json elgato_lightstrip_settings; + + elgato_lightstrip_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("ElgatoLightStripDevices"); + + /*---------------------------------------------------------------*\ + | If the Elgato Light Strip settings contains devices, process | + \*---------------------------------------------------------------*/ + if(elgato_lightstrip_settings.contains("devices")) + { + for(unsigned int device_idx = 0; device_idx < elgato_lightstrip_settings["devices"].size(); device_idx++) + { + OpenRGBElgatoLightStripSettingsEntry* entry = new OpenRGBElgatoLightStripSettingsEntry; + + if(elgato_lightstrip_settings["devices"][device_idx].contains("ip")) + { + entry->ui->IPEdit->setText(QString::fromStdString(elgato_lightstrip_settings["devices"][device_idx]["ip"])); + } + + entries.push_back(entry); + + QListWidgetItem* item = new QListWidgetItem; + + item->setSizeHint(entry->sizeHint()); + + ui->ElgatoLightStripDeviceList->addItem(item); + ui->ElgatoLightStripDeviceList->setItemWidget(item, entry); + ui->ElgatoLightStripDeviceList->show(); + } + } +} + +OpenRGBElgatoLightStripSettingsPage::~OpenRGBElgatoLightStripSettingsPage() +{ + delete ui; +} + +void OpenRGBElgatoLightStripSettingsPage::changeEvent(QEvent *event) +{ + if(event->type() == QEvent::LanguageChange) + { + ui->retranslateUi(this); + } +} + +void Ui::OpenRGBElgatoLightStripSettingsPage::on_AddElgatoLightStripDeviceButton_clicked() +{ + OpenRGBElgatoLightStripSettingsEntry* entry = new OpenRGBElgatoLightStripSettingsEntry; + entries.push_back(entry); + + QListWidgetItem* item = new QListWidgetItem; + + item->setSizeHint(entry->sizeHint()); + + ui->ElgatoLightStripDeviceList->addItem(item); + ui->ElgatoLightStripDeviceList->setItemWidget(item, entry); + ui->ElgatoLightStripDeviceList->show(); +} + +void Ui::OpenRGBElgatoLightStripSettingsPage::on_RemoveElgatoLightStripDeviceButton_clicked() +{ + int cur_row = ui->ElgatoLightStripDeviceList->currentRow(); + + if(cur_row < 0) + { + return; + } + + QListWidgetItem* item = ui->ElgatoLightStripDeviceList->takeItem(cur_row); + + ui->ElgatoLightStripDeviceList->removeItemWidget(item); + delete item; + + delete entries[cur_row]; + entries.erase(entries.begin() + cur_row); +} + +void Ui::OpenRGBElgatoLightStripSettingsPage::on_SaveElgatoLightStripConfigurationButton_clicked() +{ + json elgato_lightstrip_settings; + + elgato_lightstrip_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("ElgatoLightStripDevices"); + + elgato_lightstrip_settings["devices"].clear(); + + for(unsigned int device_idx = 0; device_idx < entries.size(); device_idx++) + { + /*-------------------------------------------------*\ + | Required parameters | + \*-------------------------------------------------*/ + elgato_lightstrip_settings["devices"][device_idx]["ip"] = entries[device_idx]->ui->IPEdit->text().toStdString(); + } + + ResourceManager::get()->GetSettingsManager()->SetSettings("ElgatoLightStripDevices", elgato_lightstrip_settings); + ResourceManager::get()->GetSettingsManager()->SaveSettings(); +} diff --git a/qt/OpenRGBElgatoLightStripSettingsPage/OpenRGBElgatoLightStripSettingsPage.h b/qt/OpenRGBElgatoLightStripSettingsPage/OpenRGBElgatoLightStripSettingsPage.h new file mode 100644 index 00000000..3ba2b15b --- /dev/null +++ b/qt/OpenRGBElgatoLightStripSettingsPage/OpenRGBElgatoLightStripSettingsPage.h @@ -0,0 +1,34 @@ +#ifndef OPENRGBELGATOLIGHTSTRIPSETTINGSPAGE_H +#define OPENRGBELGATOLIGHTSTRIPSETTINGSPAGE_H + +#include "ui_OpenRGBElgatoLightStripSettingsPage.h" +#include +#include "OpenRGBElgatoLightStripSettingsEntry.h" + +namespace Ui +{ + class OpenRGBElgatoLightStripSettingsPage; +} + +class Ui::OpenRGBElgatoLightStripSettingsPage : public QWidget +{ + Q_OBJECT + + public: + explicit OpenRGBElgatoLightStripSettingsPage(QWidget *parent = nullptr); + ~OpenRGBElgatoLightStripSettingsPage(); + + private slots: + void changeEvent(QEvent *event); + void on_AddElgatoLightStripDeviceButton_clicked(); + + void on_RemoveElgatoLightStripDeviceButton_clicked(); + + void on_SaveElgatoLightStripConfigurationButton_clicked(); + + private: + Ui::OpenRGBElgatoLightStripSettingsPageUi *ui; + std::vector entries; +}; + +#endif // OPENRGBELGATOLIGHTSTRIPSETTINGSPAGE_H diff --git a/qt/OpenRGBElgatoLightStripSettingsPage/OpenRGBElgatoLightStripSettingsPage.ui b/qt/OpenRGBElgatoLightStripSettingsPage/OpenRGBElgatoLightStripSettingsPage.ui new file mode 100644 index 00000000..cfeb8803 --- /dev/null +++ b/qt/OpenRGBElgatoLightStripSettingsPage/OpenRGBElgatoLightStripSettingsPage.ui @@ -0,0 +1,45 @@ + + + OpenRGBElgatoLightStripSettingsPageUi + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + + + + + + Add + + + + + + + Remove + + + + + + + Save + + + + + + + + diff --git a/qt/i18n/OpenRGB_de_DE.ts b/qt/i18n/OpenRGB_de_DE.ts index 7b6c8d9a..22e03d3b 100644 --- a/qt/i18n/OpenRGB_de_DE.ts +++ b/qt/i18n/OpenRGB_de_DE.ts @@ -139,6 +139,10 @@ S: Farbsättigung(S): + + Edit + Bearbeiten + Select All Alle auswählen @@ -220,15 +224,15 @@ Save Profile - Profil Speichern + Profil speichern Delete Profile - Profil Löschen + Profil löschen Load Profile - Profil Laden + Profil laden OpenRGB is detecting devices... @@ -240,11 +244,11 @@ Save Profile As... - Profil Speichern Als... + Profil speichern als... Save Profile with custom name - Profil mit eigenem Namen Speichern + Profil mit eigenem Namen speichern @@ -275,11 +279,11 @@ Set All - Auf Alle Anwenden + Auf Alle anwenden Set Device - Auf Gerät Anwenden + Auf Gerät anwenden Zone @@ -287,17 +291,67 @@ Set Zone - Auf Zone Anwenden + Auf Zone anwenden Set LED - Auf LED Anwenden + Auf LED anwenden LED LED + + OpenRGBDMXSettingsPageUi + + Add + Hinzufügen + + + Remove + Entfernen + + + Save + Speichern + + + DMX settings page + DMX Einstellungen + + + + OpenRGBDMXSettingsEntryUi + + Name: + Name: + + + Port: + Port: + + + Red Channel: + Roter Kanal: + + + Green Channel: + Grüner Kanal: + + + Blue Channel: + Blauer Kanal: + + + Brightness Channel: + Helligkeits Kanal: + + + Keepalive Time: + Wachdauer: + + OpenRGBE131SettingsEntryUi @@ -372,6 +426,101 @@ E1.31 Einstellungen + + OpenRGBKasaSmartSettingsPageUi + + Add + Hinzufügen + + + Remove + Entfernen + + + Save + Speichern + + + Kasa Smart settings page + Kasa Smart Einstellungen + + + + OpenRGBKasaSmartSettingsEntryUi + + IP: + IP: + + + Name: + Name: + + + + OpenRGBNanoleafSettingsEntryUi + + Form + + + + IP: + IP: + + + Port: + Port: + + + Auth Key: + Auth-Schlüssel + + + Unpair + Entkoppeln + + + Pair + Koppeln + + + + OpenRGBNanoleafSettingsPageUi + + Form + Form + + + Add + Hinzufügen + + + Remove + Entfernen + + + Scan + Scannen + + + To pair, hold the on-off button down for 5-7 seconds until the LED starts flashing in a pattern, then click the "Pair" button within 30 seconds. + Halten Sie zum Koppeln die Ein-/Aus-Taste 5–7 Sekunden lang gedrückt, bis die LED in einem Muster blinkt, und klicken Sie dann, innerhalb von 30 Sekunden, auf "Koppeln". + + + + OpenRGBNanoleafNewDeviceDialogUi + + New Nanoleaf device + Neues Nanoleaf Gerät + + + IP address: + IP Adresse: + + + Port: + Port: + + OpenRGBElgatoKeyLightSettingsEntryUi @@ -391,15 +540,45 @@ Add - Hinzufügen + Hinzufügen Remove - Entfernen + Entfernen Save - Speichern + Speichern + + + + OpenRGBElgatoLightStripSettingsEntryUi + + Dialog + + + + IP: + IP: + + + + OpenRGBElgatoLightStripSettingsPageUi + + Dialog + + + + Add + Hinzufügen + + + Remove + Entfernen + + + Save + Speichern @@ -425,57 +604,15 @@ Add - Hinzufügen + Hinzufügen Remove - Entfernen + Entfernen Save - Speichern - - - - OpenRGBNanoleafSettingsEntryUi - - Form - - - - IP: - IP: - - - Port: - Port: - - - Auth Key: - - - - Unpair - - - - Pair - - - - - OpenRGBNanoleafSettingsPageUi - - Form - - - - Scan - - - - To pair, hold the on-off button down for 5-7 seconds until the LED starts flashing in a pattern, then click the "Pair" button within 30 seconds. - + Speichern @@ -494,11 +631,11 @@ Client Key: - Kundenschlüssel: + Client-Schlüssel: Unpair Bridge - Brücke Entkoppeln + Brücke entkoppeln MAC: @@ -514,7 +651,7 @@ Auto Connect Group: - + Auto-Connect-Gruppe @@ -546,6 +683,14 @@ IP: IP: + + Use Cool White + Nutze Kaltweiß + + + Use Warm White + Nutze Warmweiß + Philips WIZ settings entry Philips WIZ Eintrag @@ -620,11 +765,11 @@ OpenRGBPluginsPageUi Install Plugin - Plugin Installieren + Plugin installieren Remove Plugin - Plugin Entfernen + Plugin entfernen Plugins page @@ -632,7 +777,7 @@ <html><head/><body>Looking for plugins? See the official list at <a href="https://openrgb.org/plugins.html">OpenRGB.org</a></body></html> - + <html><head/><body>Suchen Sie nach Plugins? Die offizielle Liste finden Sie unter <a href="https://openrgb.org/plugins.html">OpenRGB.org</a></body></html> @@ -734,7 +879,7 @@ OpenRGBServerInfoPageUi Stop Server - Server Stoppen + Server stoppen Server Port: @@ -742,7 +887,7 @@ Start Server - Server Starten + Server starten Server Status: @@ -781,7 +926,7 @@ OpenRGBSettingsPageUi Load Window Geometry - Fenster Geometrie Laden + Fenster Geometrie laden 90000 @@ -791,9 +936,13 @@ Run zone checks on rescan Zonen beim erneuten Scannen überprüfen + + Disable key expansion in device view + Deaktivieren Sie die Schlüsselerweiterung in der Geräteansicht + Start Server - Server Starten + Server starten Start Minimized @@ -809,7 +958,7 @@ Start At Login - Start bei der Anmeldung + Bei der Anmeldung starten Set Profile on Exit @@ -825,11 +974,11 @@ Start Client - Client Starten + Client starten Load Profile - Profil Laden + Profil laden Set Server Port @@ -837,7 +986,7 @@ Theme (restart required) - Design (Programmneustart erforderlich) + Stil (Programmneustart erforderlich) Enable Log Console (restart required) @@ -865,7 +1014,7 @@ Start At Login Settings: - Start bei der Anmeldung Einstellungen: + Start Einstellungen: Open Settings Folder @@ -877,15 +1026,15 @@ Shared SMBus Access (restart required) - + Gemeinsamer SMBus-Zugriff (Programmneustart erforderlich) Set Server Host - + Setze Server Host Language - + Sprache @@ -916,7 +1065,7 @@ Website - Website + Webseite <a href="https://openrgb.org">https://openrgb.org</a> @@ -943,12 +1092,16 @@ Enable/Disable all - Alle Aktivieren/Deaktivieren + Alle aktivieren/deaktivieren Apply changes Änderungen anwenden + + Get hardware IDs + Hardware IDs anzeigen + OpenRGBSystemInfoPageUi @@ -962,7 +1115,7 @@ Read Device - Gerät Lesen + Gerät lesen SMBus Dumper: @@ -982,11 +1135,11 @@ Detect Devices - Geräte Erkennen + Geräte erkennen Dump Device - Dump Device + Ausgabegerät SMBus Reader: @@ -1269,10 +1422,18 @@ Using "Allg." as shorthand for "Allgemeine". "Allgemeine" would be too long for the UI. So until text size is handled differently this should do it. Allg. Einstellungen + + DMX Devices + DMX Geräte + E1.31 Devices E1.31 Geräte + + Kasa Smart Devices + Kasa Smart Geräte + Philips Hue Devices Philips Hue Geräte @@ -1319,15 +1480,19 @@ LIFX Devices - + LIFX Geräte Nanoleaf Devices - + Nanoleaf Geräte Elgato KeyLight Devices - + Elgato KeyLight Geräte + + + Elgato LightStrip Devices + Elgato LightStrip Geräte @@ -1397,7 +1562,7 @@ Remove Plugin - Plugin Entfernen + Plugin entfernen Are you sure you want to remove this plugin? @@ -1476,4 +1641,23 @@ Größe + + OpenRGBHardwareIDsDialogUi + + Location + Ort + + + Device + Gerät + + + Vendor + Hersteller + + + Copy to clipboard + In die Zwischenablage kopieren + + diff --git a/qt/i18n/OpenRGB_en_AU.ts b/qt/i18n/OpenRGB_en_AU.ts index b42f7f06..585af4df 100644 --- a/qt/i18n/OpenRGB_en_AU.ts +++ b/qt/i18n/OpenRGB_en_AU.ts @@ -402,6 +402,36 @@ + + OpenRGBElgatoLightStripSettingsEntryUi + + Dialog + + + + IP: + + + + + OpenRGBElgatoLightStripSettingsPageUi + + Dialog + + + + Add + + + + Remove + + + + Save + + + OpenRGBLIFXSettingsEntryUi @@ -1303,6 +1333,10 @@ Elgato KeyLight Devices + + + Elgato LightStrip Devices + Supported Devices diff --git a/qt/i18n/OpenRGB_en_GB.ts b/qt/i18n/OpenRGB_en_GB.ts index e44d6241..571ead99 100644 --- a/qt/i18n/OpenRGB_en_GB.ts +++ b/qt/i18n/OpenRGB_en_GB.ts @@ -402,6 +402,36 @@ + + OpenRGBElgatoLightStripSettingsEntryUi + + Dialog + + + + IP: + + + + + OpenRGBElgatoLightStripSettingsPageUi + + Dialog + + + + Add + + + + Remove + + + + Save + + + OpenRGBLIFXSettingsEntryUi @@ -1303,6 +1333,10 @@ Elgato KeyLight Devices + + + Elgato LightStrip Devices + Supported Devices diff --git a/qt/i18n/OpenRGB_en_US.ts b/qt/i18n/OpenRGB_en_US.ts index deceb1bc..5da74611 100644 --- a/qt/i18n/OpenRGB_en_US.ts +++ b/qt/i18n/OpenRGB_en_US.ts @@ -298,6 +298,25 @@ + + OpenRGBDMXSettingsPageUi + + Add + + + + Remove + + + + Save + + + + DMX settings page + + + OpenRGBE131SettingsEntryUi @@ -372,6 +391,90 @@ + + OpenRGBKasaSmartSettingsPageUi + + Add + + + + Remove + + + + Save + + + + Kasa Smart settings page + + + + + OpenRGBNanoleafSettingsEntryUi + + Form + + + + IP: + + + + Port: + + + + Auth Key: + + + + Unpair + + + + Pair + + + + + OpenRGBNanoleafSettingsPageUi + + Form + + + + Add + + + + Remove + + + + Scan + + + + To pair, hold the on-off button down for 5-7 seconds until the LED starts flashing in a pattern, then click the "Pair" button within 30 seconds. + + + + + OpenRGBNanoleafNewDeviceDialogUi + + New Nanoleaf device + + + + IP address: + + + + Port: + + + OpenRGBElgatoKeyLightSettingsEntryUi @@ -402,6 +505,36 @@ + + OpenRGBElgatoLightStripSettingsEntryUi + + Dialog + + + + IP: + + + + + OpenRGBElgatoLightStripSettingsPageUi + + Dialog + + + + Add + + + + Remove + + + + Save + + + OpenRGBLIFXSettingsEntryUi @@ -436,48 +569,6 @@ - - OpenRGBNanoleafSettingsEntryUi - - Form - - - - IP: - - - - Port: - - - - Auth Key: - - - - Unpair - - - - Pair - - - - - OpenRGBNanoleafSettingsPageUi - - Form - - - - Scan - - - - To pair, hold the on-off button down for 5-7 seconds until the LED starts flashing in a pattern, then click the "Pair" button within 30 seconds. - - - OpenRGBPhilipsHueSettingsEntryUi @@ -1243,10 +1334,18 @@ General Settings + + + DMX Devices + E1.31 Devices + + + Kasa Smart Devices + Philips Hue Devices @@ -1303,6 +1402,10 @@ Elgato KeyLight Devices + + + Elgato LightStrip Devices + Supported Devices @@ -1447,4 +1550,23 @@ + + OpenRGBHardwareIDsDialogUi + + Location + + + + Device + + + + Vendor + + + + Copy to clipboard + + + diff --git a/qt/i18n/OpenRGB_es_ES.ts b/qt/i18n/OpenRGB_es_ES.ts index 754554e2..98e4c681 100644 --- a/qt/i18n/OpenRGB_es_ES.ts +++ b/qt/i18n/OpenRGB_es_ES.ts @@ -403,6 +403,36 @@ Guardar + + OpenRGBElgatoLightStripSettingsEntryUi + + Dialog + + + + IP: + IP: + + + + OpenRGBElgatoLightStripSettingsPageUi + + Dialog + + + + Add + Añadir + + + Remove + Suprimir + + + Save + Guardar + + OpenRGBLIFXSettingsEntryUi @@ -1330,6 +1360,10 @@ Elgato KeyLight Devices + + Elgato LightStrip Devices + + Ui::OpenRGBE131SettingsEntry diff --git a/qt/i18n/OpenRGB_fr_FR.ts b/qt/i18n/OpenRGB_fr_FR.ts index 9358f2da..ccd65ac6 100644 --- a/qt/i18n/OpenRGB_fr_FR.ts +++ b/qt/i18n/OpenRGB_fr_FR.ts @@ -402,6 +402,36 @@ Sauvegarder + + OpenRGBElgatoLightStripSettingsEntryUi + + Dialog + + + + IP: + IP : + + + + OpenRGBElgatoLightStripSettingsPageUi + + Dialog + + + + Add + Ajouter + + + Remove + Supprimer + + + Save + Sauvegarder + + OpenRGBLIFXSettingsEntryUi @@ -1328,6 +1358,10 @@ Elgato KeyLight Devices Périphériques Elgato KeyLight + + Elgato LightStrip Devices + Périphériques Elgato LightStrip + Ui::OpenRGBE131SettingsEntry diff --git a/qt/i18n/OpenRGB_hr_HR.ts b/qt/i18n/OpenRGB_hr_HR.ts index c77a2953..721d0e27 100644 --- a/qt/i18n/OpenRGB_hr_HR.ts +++ b/qt/i18n/OpenRGB_hr_HR.ts @@ -403,6 +403,36 @@ Spremi + + OpenRGBElgatoLightStripSettingsEntryUi + + Dialog + Dijalog + + + IP: + IP: + + + + OpenRGBElgatoLightStripSettingsPageUi + + Dialog + Dijalog + + + Add + Dodaj + + + Remove + Ukloni + + + Save + Spremi + + OpenRGBLIFXSettingsEntryUi @@ -1305,6 +1335,10 @@ Elgato KeyLight Devices Elgato KeyLight uređaji + + + Elgato LightStrip Devices + Elgato LightStrip uređaji Supported Devices diff --git a/qt/i18n/OpenRGB_it_IT.ts b/qt/i18n/OpenRGB_it_IT.ts index d961d568..73a6427f 100644 --- a/qt/i18n/OpenRGB_it_IT.ts +++ b/qt/i18n/OpenRGB_it_IT.ts @@ -402,6 +402,36 @@ Salva + + OpenRGBElgatoLightStripSettingsEntryUi + + Dialog + Dialogo + + + IP: + IP: + + + + OpenRGBElgatoLightStripSettingsPageUi + + Dialog + Dialogo + + + Add + Aggiungi + + + Remove + Rimuovi + + + Save + Salva + + OpenRGBLIFXSettingsEntryUi @@ -1303,6 +1333,10 @@ Elgato KeyLight Devices Dispositivi Elgato KeyLight + + + Elgato LightStrip Devices + Dispositivi Elgato LightStrip Supported Devices diff --git a/qt/i18n/OpenRGB_ja_JP.ts b/qt/i18n/OpenRGB_ja_JP.ts index c1aaf1cb..529cbb6f 100644 --- a/qt/i18n/OpenRGB_ja_JP.ts +++ b/qt/i18n/OpenRGB_ja_JP.ts @@ -1634,6 +1634,42 @@ Using an effect on a device WILL damage the flash or controller 保存 + + OpenRGBElgatoLightStripSettingsEntryUi + + + Dialog + + + + + IP: + + + + + OpenRGBElgatoLightStripSettingsPageUi + + + Dialog + Dialog + + + + Add + 追加 + + + + Remove + 削除 + + + + Save + 保存 + + OpenRGBLIFXSettingsEntryUi @@ -3080,6 +3116,11 @@ Using an effect on a device WILL damage the flash or controller Elgato KeyLight Devices Elgato KeyLight デバイス + + + + Elgato LightStrip Devices + Elgato LightStrip デバイス diff --git a/qt/i18n/OpenRGB_ko_KR.ts b/qt/i18n/OpenRGB_ko_KR.ts index 8c82ab77..64171a14 100644 --- a/qt/i18n/OpenRGB_ko_KR.ts +++ b/qt/i18n/OpenRGB_ko_KR.ts @@ -456,6 +456,36 @@ 저장 + + OpenRGBElgatoLightStripSettingsEntryUi + + Dialog + 대화 상자 + + + IP: + IP: + + + + OpenRGBElgatoLightStripSettingsPageUi + + Dialog + 대화 상자 + + + Add + 추가 + + + Remove + 삭제 + + + Save + 저장 + + OpenRGBHardwareIDsDialogUi @@ -1501,6 +1531,10 @@ Elgato KeyLight Devices Elgato KeyLight 장치 + + + Elgato LightStrip Devices + Elgato LightStrip 장치 Supported Devices diff --git a/qt/i18n/OpenRGB_ms_MY.ts b/qt/i18n/OpenRGB_ms_MY.ts index c9513067..5c8b0f7b 100644 --- a/qt/i18n/OpenRGB_ms_MY.ts +++ b/qt/i18n/OpenRGB_ms_MY.ts @@ -496,6 +496,42 @@ Simpan + + OpenRGBElgatoLightStripSettingsEntryUi + + + Dialog + Dialog + + + + IP: + IP: + + + + OpenRGBElgatoLightStripSettingsPageUi + + + Dialog + Dialog + + + + Add + Tambah + + + + Remove + Alih keluar + + + + Save + Simpan + + OpenRGBLIFXSettingsEntryUi @@ -1578,6 +1614,11 @@ Elgato KeyLight Devices Peranti Elgato KeyLight + + + + Elgato LightStrip Devices + Peranti Elgato LightStrip diff --git a/qt/i18n/OpenRGB_pl_PL.ts b/qt/i18n/OpenRGB_pl_PL.ts index 8a357a03..7fd74a33 100644 --- a/qt/i18n/OpenRGB_pl_PL.ts +++ b/qt/i18n/OpenRGB_pl_PL.ts @@ -402,6 +402,36 @@ Zapisz + + OpenRGBElgatoLightStripSettingsEntryUi + + Dialog + Okno dialogowe + + + IP: + IP: + + + + OpenRGBElgatoLightStripSettingsPageUi + + Dialog + Okno dialogowe + + + Add + Dodaj + + + Remove + Usuń + + + Save + Zapisz + + OpenRGBLIFXSettingsEntryUi @@ -1303,6 +1333,10 @@ Elgato KeyLight Devices Urządzenia Elgato KeyLight + + + Elgato LightStrip Devices + Urządzenia Elgato LightStrip Supported Devices diff --git a/qt/i18n/OpenRGB_pt_BR.ts b/qt/i18n/OpenRGB_pt_BR.ts index b3727319..506d02b5 100644 --- a/qt/i18n/OpenRGB_pt_BR.ts +++ b/qt/i18n/OpenRGB_pt_BR.ts @@ -402,6 +402,36 @@ Salvar + + OpenRGBElgatoLightStripSettingsEntryUi + + Dialog + + + + IP: + IP: + + + + OpenRGBElgatoLightStripSettingsPageUi + + Dialog + + + + Add + Adicionar + + + Remove + Remover + + + Save + Salvar + + OpenRGBLIFXSettingsEntryUi @@ -1329,6 +1359,10 @@ Elgato KeyLight Devices + + Elgato LightStrip Devices + + Ui::OpenRGBE131SettingsEntry diff --git a/qt/i18n/OpenRGB_ru_RU.ts b/qt/i18n/OpenRGB_ru_RU.ts index 12081773..184c33a4 100644 --- a/qt/i18n/OpenRGB_ru_RU.ts +++ b/qt/i18n/OpenRGB_ru_RU.ts @@ -571,6 +571,42 @@ Сохранить + + OpenRGBElgatoLightStripSettingsEntryUi + + + Dialog + Диалоговое окно + + + + IP: + IP: + + + + OpenRGBElgatoLightStripSettingsPageUi + + + Dialog + Диалоговое окно + + + + Add + Добавить + + + + Remove + Удалить + + + + Save + Сохранить + + OpenRGBHardwareIDsDialogUi @@ -1839,6 +1875,11 @@ Elgato KeyLight Devices Устройства Elgato KeyLight + + + Elgato LightStrip Devices + Устройства Elgato LightStrip + Ui::OpenRGBE131SettingsEntry diff --git a/qt/i18n/OpenRGB_zh_CN.ts b/qt/i18n/OpenRGB_zh_CN.ts index 199c2f97..a43c2054 100644 --- a/qt/i18n/OpenRGB_zh_CN.ts +++ b/qt/i18n/OpenRGB_zh_CN.ts @@ -1635,6 +1635,42 @@ Using an effect on a device WILL damage the flash or controller 保存 + + OpenRGBElgatoLightStripSettingsEntryUi + + + Dialog + + + + + IP: + + + + + OpenRGBElgatoLightStripSettingsPageUi + + + Dialog + + + + + Add + 添加 + + + + Remove + 移除 + + + + Save + 保存 + + OpenRGBLIFXSettingsEntryUi @@ -3081,6 +3117,11 @@ Using an effect on a device WILL damage the flash or controller Elgato KeyLight Devices + + + + Elgato LightStrip Devices + diff --git a/qt/i18n/OpenRGB_zh_TW.ts b/qt/i18n/OpenRGB_zh_TW.ts index 45cf309c..1bdd0bbd 100644 --- a/qt/i18n/OpenRGB_zh_TW.ts +++ b/qt/i18n/OpenRGB_zh_TW.ts @@ -1635,6 +1635,42 @@ Using an effect on a device WILL damage the flash or controller 保存 + + OpenRGBElgatoLightStripSettingsEntryUi + + + Dialog + + + + + IP: + + + + + OpenRGBElgatoLightStripSettingsPageUi + + + Dialog + + + + + Add + 添加 + + + + Remove + 移除 + + + + Save + 保存 + + OpenRGBLIFXSettingsEntryUi @@ -3081,6 +3117,11 @@ Using an effect on a device WILL damage the flash or controller Elgato KeyLight Devices + + + + Elgato LightStrip Devices +