Commit 532bc5d8 authored by Adam Honse's avatar Adam Honse

Implement beginnings of OpenRGB SDK support

parent 583b390f
[submodule "Release"]
path = Release
url = https://github.com/CalcProgrammer1/KeyboardVisualizerVCUI_Release
[submodule "OpenAuraSDK"]
path = OpenAuraSDK
url = https://gitlab.com/CalcProgrammer1/OpenAuraSDK
[submodule "OpenRGB"]
path = OpenRGB
url = https://gitlab.com/CalcProgrammer1/OpenRGB
......@@ -26,19 +26,11 @@ packagesExist(hidapi-libusb) {
DISTFILES +=
INCLUDEPATH += \
OpenAuraSDK/ \
OpenAuraSDK/dependencies/libe131/src/ \
OpenAuraSDK/i2c_smbus/ \
OpenAuraSDK/net_port/ \
OpenAuraSDK/serial_port/ \
OpenAuraSDK/Controllers/AuraController/ \
OpenAuraSDK/Controllers/CorsairController/ \
OpenAuraSDK/Controllers/CorsairProController/ \
OpenAuraSDK/Controllers/HuePlusController/ \
OpenAuraSDK/Controllers/HyperXController/ \
OpenAuraSDK/Controllers/LEDStripController/ \
OpenAuraSDK/RGBController/ \
OpenAuraSDK/qt/
OpenRGB/ \
OpenRGB/dependencies/libe131/src/ \
OpenRGB/net_port/ \
OpenRGB/RGBController/ \
OpenRGB/qt/ \
SOURCES += \
KeyboardVisualizerCommon/hsv.cpp \
......@@ -46,66 +38,29 @@ SOURCES += \
KeyboardVisualizerCommon/chuck_fft.c \
KeyboardVisualizerQT/KeyboardVisDlg.cpp \
KeyboardVisualizerQT/main.cpp \
KeyboardVisualizerCommon/UsbDevice.cpp \
# From OpenAuraSDK
SOURCES += \
OpenAuraSDK/OpenAuraSDK.cpp \
OpenAuraSDK/dependencies/libe131/src/e131.c \
OpenAuraSDK/i2c_smbus/i2c_smbus.cpp \
OpenAuraSDK/i2c_smbus/i2c_smbus_linux.cpp \
OpenAuraSDK/net_port/net_port.cpp \
OpenAuraSDK/serial_port/serial_port.cpp \
OpenAuraSDK/Controllers/AuraController/AuraController.cpp \
OpenAuraSDK/Controllers/AuraController/AuraControllerDetect.cpp \
OpenAuraSDK/Controllers/CorsairController/CorsairController.cpp \
OpenAuraSDK/Controllers/CorsairController/CorsairControllerDetect.cpp \
OpenAuraSDK/Controllers/CorsairProController/CorsairProController.cpp \
OpenAuraSDK/Controllers/CorsairProController/CorsairProControllerDetect.cpp \
OpenAuraSDK/Controllers/HuePlusController/HuePlusController.cpp \
OpenAuraSDK/Controllers/HuePlusController/HuePlusControllerDetect.cpp \
OpenAuraSDK/Controllers/HyperXController/HyperXController.cpp \
OpenAuraSDK/Controllers/HyperXController/HyperXControllerDetect.cpp \
OpenAuraSDK/Controllers/LEDStripController/LEDStripController.cpp \
OpenAuraSDK/Controllers/LEDStripController/LEDStripControllerDetect.cpp \
OpenAuraSDK/RGBController/E131ControllerDetect.cpp \
OpenAuraSDK/RGBController/OpenRazerDetect.cpp \
OpenAuraSDK/RGBController/RGBController_Aura.cpp \
OpenAuraSDK/RGBController/RGBController_Corsair.cpp \
OpenAuraSDK/RGBController/RGBController_CorsairPro.cpp \
OpenAuraSDK/RGBController/RGBController_E131.cpp \
OpenAuraSDK/RGBController/RGBController_HuePlus.cpp \
OpenAuraSDK/RGBController/RGBController_HyperX.cpp \
OpenAuraSDK/RGBController/RGBController_LEDStrip.cpp \
OpenAuraSDK/RGBController/RGBController_OpenRazer.cpp
# From OpenRGB
SOURCES += \
OpenRGB/NetworkClient.cpp \
OpenRGB/net_port/net_port.cpp \
OpenRGB/RGBController/RGBController.cpp \
OpenRGB/RGBController/RGBController_Network.cpp \
HEADERS += \
KeyboardVisualizerCommon/chuck_fft.h \
KeyboardVisualizerCommon/hsv.h \
KeyboardVisualizerCommon/net_port.h \
KeyboardVisualizerCommon/Visualizer.h \
KeyboardVisualizerCommon/VisualizerDefines.h \
KeyboardVisualizerQT/KeyboardVisDlg.h \
KeyboardVisualizerCommon/UsbDevice.h \
KeyboardVisualizerCommon/chuck_fft.h \
KeyboardVisualizerCommon/hsv.h \
KeyboardVisualizerCommon/net_port.h \
KeyboardVisualizerCommon/Visualizer.h \
KeyboardVisualizerCommon/VisualizerDefines.h \
KeyboardVisualizerQT/KeyboardVisDlg.h \
# From OpenAuraSDK
# From OpenRGB
HEADERS += \
OpenAuraSDK/i2c_smbus/i2c_smbus.h \
OpenAuraSDK/i2c_smbus/i2c_smbus_linux.h \
OpenAuraSDK/net_port/net_port.h \
OpenAuraSDK/serial_port/serial_port.h \
OpenAuraSDK/Controllers/AuraController/AuraController.h \
OpenAuraSDK/Controllers/CorsairController/CorsairController.h \
OpenAuraSDK/Controllers/CorsairProController/CorsairProController.h \
OpenAuraSDK/Controllers/HyperXController/HyperXController.h \
OpenAuraSDK/Controllers/LEDStripController/LEDStripController.h \
OpenAuraSDK/RGBController/RGBController.h \
OpenAuraSDK/RGBController/RGBController_Aura.h \
OpenAuraSDK/RGBController/RGBController_Corsair.h \
OpenAuraSDK/RGBController/RGBController_CorsairPro.h \
OpenAuraSDK/RGBController/RGBController_E131.h \
OpenAuraSDK/RGBController/RGBController_HyperX.h \
OpenAuraSDK/RGBController/RGBController_OpenRazer.h
OpenRGB/NetworkClient.h \
OpenRGB/NetworkProtocol.h \
OpenRGB/net_port/net_port.h \
OpenRGB/RGBController/RGBController.h \
OpenRGB/RGBController/RGBController_Network.h \
RESOURCES += \
KeyboardVisualizerQT/resources.qrc
......
......@@ -21,8 +21,6 @@
#include "unistd.h"
#endif
#include "OpenAuraSDK.h"
#include "RGBController.h"
#include <string.h>
#ifndef TRUE
......@@ -30,9 +28,7 @@
#define FALSE 0
#endif
std::vector<char *> device_properties;
extern std::vector<RGBController*> rgb_controllers;
std::vector<char *> device_properties;
char * net_string;
int ledstrip_sections_size = 1;
......@@ -304,7 +300,7 @@ void Visualizer::Initialize()
bkgd_step = 0;
bkgd_bright = 100;
bkgd_mode = VISUALIZER_PATTERN_ANIM_RAINBOW_SINUSOIDAL;
delay = 50;
delay = 500;
window_mode = 1;
decay = 80;
frgd_mode = VISUALIZER_PATTERN_STATIC_GREEN_YELLOW_RED;
......@@ -330,7 +326,7 @@ void Visualizer::Initialize()
ChangeAudioDevice();
SetNormalization(nrml_ofst, nrml_scl);
DetectRGBControllers();
rgb_client = new NetworkClient(rgb_controllers);
}
void Visualizer::InitClient(char * clientstring)
......@@ -1453,33 +1449,27 @@ void Visualizer::LEDUpdateThread( unsigned int c )
{
switch (rgb_controllers[c]->zones[z].type)
{
case ZONE_TYPE_MATRIX:
for (int r = 0; r < rgb_controllers[c]->zones[z].map.size(); r++)
{
for (int l = 0; l < rgb_controllers[c]->zones[z].map[r].size(); l++)
{
rgb_controllers[c]->colors[rgb_controllers[c]->zones[z].map[r][l]] = pixels_out->pixels[ 2 + r * (62 / rgb_controllers[c]->zones[z].map.size())][l * (256 / rgb_controllers[c]->zones[z].map[r].size())];
}
}
break;
//case ZONE_TYPE_MATRIX:
// for (int r = 0; r < rgb_controllers[c]->zones[z].map.size(); r++)
// {
// for (int l = 0; l < rgb_controllers[c]->zones[z].map[r].size(); l++)
// {
// rgb_controllers[c]->colors[rgb_controllers[c]->zones[z].map[r][l]] = pixels_out->pixels[ 2 + r * (62 / rgb_controllers[c]->zones[z].map.size())][l * (256 / rgb_controllers[c]->zones[z].map[r].size())];
// }
// }
// break;
case ZONE_TYPE_SINGLE:
for (int r = 0; r < rgb_controllers[c]->zones[z].map.size(); r++)
for (int r = 0; r < rgb_controllers[c]->zones[z].leds_count; r++)
{
for (int l = 0; l < rgb_controllers[c]->zones[z].map[r].size(); l++)
{
rgb_controllers[c]->colors[rgb_controllers[c]->zones[z].map[r][l]] = pixels_out->pixels[ROW_IDX_SINGLE_COLOR][0];
}
rgb_controllers[c]->zones[z].colors[r] = pixels_out->pixels[ROW_IDX_SINGLE_COLOR][0];
}
break;
case ZONE_TYPE_LINEAR:
for (int r = 0; r < rgb_controllers[c]->zones[z].map.size(); r++)
for (int r = 0; r < rgb_controllers[c]->zones[z].leds_count; r++)
{
for (int l = 0; l < rgb_controllers[c]->zones[z].map[r].size(); l++)
{
rgb_controllers[c]->colors[rgb_controllers[c]->zones[z].map[r][l]] = pixels_out->pixels[ROW_IDX_BAR_GRAPH][l * (256 / rgb_controllers[c]->zones[z].map[r].size())];
}
rgb_controllers[c]->zones[z].colors[r] = pixels_out->pixels[ROW_IDX_BAR_GRAPH][r * (256 / rgb_controllers[c]->zones[z].leds_count)];
}
break;
}
......
......@@ -18,6 +18,11 @@
#include "hsv.h"
#include "net_port.h"
//OpenRGB SDK
#include "OpenRGB.h"
#include "NetworkClient.h"
#include "RGBController.h"
//If building on Windows, use WASAPI
#ifdef WIN32
#include <mmsystem.h>
......@@ -174,6 +179,10 @@ public:
//Audio Device List
std::vector<char *> audio_devices;
//OpenRGB SDK
NetworkClient* rgb_client;
std::vector<RGBController*> rgb_controllers;
private:
#ifdef WIN32
//WASAPI objects if building for Windows
......
......@@ -3,6 +3,8 @@
#include "KeyboardVisualizerCommon/VisualizerDefines.h"
#include "ui_keyboardvisualizer.h"
#include <QListWidgetItem>
Visualizer* vis_ptr;
boolean startminimized;
boolean firstrun;
......@@ -193,6 +195,12 @@ void KeyboardVisDlg::SetVisualizer(Visualizer* v)
image = new QImage(256, 64, QImage::Format_RGB32);
scene = new QGraphicsScene(this);
ui->graphicsView_Visualization_Preview->setScene(scene);
//OpenRGB device list
for(int dev_idx = 0; dev_idx < vis_ptr->rgb_controllers.size(); dev_idx++)
{
ui->list_Devices->addItem(QString::fromStdString(vis_ptr->rgb_controllers[dev_idx]->name));
}
}
void KeyboardVisDlg::StartMinimized(boolean startmin)
......
......@@ -7,11 +7,11 @@
<x>0</x>
<y>0</y>
<width>600</width>
<height>360</height>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>Keyboard Visualizer 3.06</string>
<string>Keyboard Visualizer - OpenRGB SDK Dev Build</string>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QLabel" name="label_Amplitude">
......@@ -386,7 +386,7 @@
</rect>
</property>
<property name="text">
<string>https://github.com/CalcProgrammer1/KeyboardVisualizer</string>
<string>https://gitlab.com/CalcProgrammer1/KeyboardVisualizer</string>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_Reactive_Background">
......@@ -510,6 +510,16 @@
<string>Background Timeout</string>
</property>
</widget>
<widget class="QListWidget" name="list_Devices">
<property name="geometry">
<rect>
<x>0</x>
<y>360</y>
<width>591</width>
<height>231</height>
</rect>
</property>
</widget>
</widget>
</widget>
<layoutdefault spacing="6" margin="11"/>
......
Subproject commit 126c9295ace3113de8db14eb4886abef789dd9da
Subproject commit 7477c23dc1daaf75f4046450b6818def20a9bcd9
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment