|
|
|
|
@ -13,8 +13,7 @@
|
|
|
|
|
#include "ResourceManager.h"
|
|
|
|
|
#include "SettingsManager.h"
|
|
|
|
|
#include "hsv.h"
|
|
|
|
|
|
|
|
|
|
using namespace Ui;
|
|
|
|
|
#include "ui_OpenRGBDevicePage.h"
|
|
|
|
|
|
|
|
|
|
static void UpdateCallback(void * this_ptr)
|
|
|
|
|
{
|
|
|
|
|
@ -57,7 +56,7 @@ QString OpenRGBDevicePage::ModeDescription(const mode& m)
|
|
|
|
|
|
|
|
|
|
OpenRGBDevicePage::OpenRGBDevicePage(RGBController *dev, QWidget *parent) :
|
|
|
|
|
QFrame(parent),
|
|
|
|
|
ui(new Ui::OpenRGBDevicePageUi)
|
|
|
|
|
ui(new Ui::OpenRGBDevicePage)
|
|
|
|
|
{
|
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
|
|
|
|
|
@ -167,12 +166,12 @@ void OpenRGBDevicePage::changeEvent(QEvent *event)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RGBController* Ui::OpenRGBDevicePage::GetController()
|
|
|
|
|
RGBController* OpenRGBDevicePage::GetController()
|
|
|
|
|
{
|
|
|
|
|
return device;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::on_ZoneBox_currentIndexChanged(int index)
|
|
|
|
|
void OpenRGBDevicePage::on_ZoneBox_currentIndexChanged(int index)
|
|
|
|
|
{
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| Read selected mode |
|
|
|
|
|
@ -415,7 +414,7 @@ void Ui::OpenRGBDevicePage::on_ZoneBox_currentIndexChanged(int index)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::on_LEDBox_currentIndexChanged(int index)
|
|
|
|
|
void OpenRGBDevicePage::on_LEDBox_currentIndexChanged(int index)
|
|
|
|
|
{
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| Read selected mode |
|
|
|
|
|
@ -707,7 +706,7 @@ void Ui::OpenRGBDevicePage::on_LEDBox_currentIndexChanged(int index)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::on_ModeBox_currentIndexChanged(int index)
|
|
|
|
|
void OpenRGBDevicePage::on_ModeBox_currentIndexChanged(int index)
|
|
|
|
|
{
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| Update mode user interface elements |
|
|
|
|
|
@ -727,7 +726,7 @@ void Ui::OpenRGBDevicePage::on_ModeBox_currentIndexChanged(int index)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::on_PerLEDCheck_clicked()
|
|
|
|
|
void OpenRGBDevicePage::on_PerLEDCheck_clicked()
|
|
|
|
|
{
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| Change device mode |
|
|
|
|
|
@ -740,7 +739,7 @@ void Ui::OpenRGBDevicePage::on_PerLEDCheck_clicked()
|
|
|
|
|
UpdateModeUi();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::on_ModeSpecificCheck_clicked()
|
|
|
|
|
void OpenRGBDevicePage::on_ModeSpecificCheck_clicked()
|
|
|
|
|
{
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| Change device mode |
|
|
|
|
|
@ -753,7 +752,7 @@ void Ui::OpenRGBDevicePage::on_ModeSpecificCheck_clicked()
|
|
|
|
|
UpdateModeUi();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::on_RandomCheck_clicked()
|
|
|
|
|
void OpenRGBDevicePage::on_RandomCheck_clicked()
|
|
|
|
|
{
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| Change device mode |
|
|
|
|
|
@ -766,7 +765,7 @@ void Ui::OpenRGBDevicePage::on_RandomCheck_clicked()
|
|
|
|
|
UpdateModeUi();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::on_BrightnessSlider_valueChanged(int /*value*/)
|
|
|
|
|
void OpenRGBDevicePage::on_BrightnessSlider_valueChanged(int /*value*/)
|
|
|
|
|
{
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| Change device mode |
|
|
|
|
|
@ -774,7 +773,7 @@ void Ui::OpenRGBDevicePage::on_BrightnessSlider_valueChanged(int /*value*/)
|
|
|
|
|
UpdateMode();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::on_SpeedSlider_valueChanged(int /*value*/)
|
|
|
|
|
void OpenRGBDevicePage::on_SpeedSlider_valueChanged(int /*value*/)
|
|
|
|
|
{
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| Change device mode |
|
|
|
|
|
@ -782,7 +781,7 @@ void Ui::OpenRGBDevicePage::on_SpeedSlider_valueChanged(int /*value*/)
|
|
|
|
|
UpdateMode();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::on_DirectionBox_currentIndexChanged(int /*index*/)
|
|
|
|
|
void OpenRGBDevicePage::on_DirectionBox_currentIndexChanged(int /*index*/)
|
|
|
|
|
{
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| Change device mode |
|
|
|
|
|
@ -790,13 +789,13 @@ void Ui::OpenRGBDevicePage::on_DirectionBox_currentIndexChanged(int /*index*/)
|
|
|
|
|
UpdateMode();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::UpdateInterface()
|
|
|
|
|
void OpenRGBDevicePage::UpdateInterface()
|
|
|
|
|
{
|
|
|
|
|
//UpdateModeUi();
|
|
|
|
|
ui->DeviceViewBox->repaint();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::UpdateModeUi()
|
|
|
|
|
void OpenRGBDevicePage::UpdateModeUi()
|
|
|
|
|
{
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| Read selected mode |
|
|
|
|
|
@ -1123,7 +1122,7 @@ void Ui::OpenRGBDevicePage::UpdateModeUi()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::UpdateMode()
|
|
|
|
|
void OpenRGBDevicePage::UpdateMode()
|
|
|
|
|
{
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| Read selected mode |
|
|
|
|
|
@ -1262,7 +1261,7 @@ void Ui::OpenRGBDevicePage::UpdateMode()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::SetDevice(unsigned char red, unsigned char green, unsigned char blue)
|
|
|
|
|
void OpenRGBDevicePage::SetDevice(unsigned char red, unsigned char green, unsigned char blue)
|
|
|
|
|
{
|
|
|
|
|
current_color.setRgb(red, green, blue);
|
|
|
|
|
|
|
|
|
|
@ -1272,7 +1271,7 @@ void Ui::OpenRGBDevicePage::SetDevice(unsigned char red, unsigned char green, un
|
|
|
|
|
colorChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::UpdateDevice()
|
|
|
|
|
void OpenRGBDevicePage::UpdateDevice()
|
|
|
|
|
{
|
|
|
|
|
ui->ModeBox->blockSignals(true);
|
|
|
|
|
ui->ModeBox->setCurrentIndex(device->active_mode);
|
|
|
|
|
@ -1281,7 +1280,7 @@ void Ui::OpenRGBDevicePage::UpdateDevice()
|
|
|
|
|
UpdateMode();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::SetCustomMode(unsigned char red, unsigned char green, unsigned char blue)
|
|
|
|
|
void OpenRGBDevicePage::SetCustomMode(unsigned char red, unsigned char green, unsigned char blue)
|
|
|
|
|
{
|
|
|
|
|
RGBColor color = ToRGBColor(red, green, blue);
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
@ -1328,7 +1327,7 @@ void Ui::OpenRGBDevicePage::SetCustomMode(unsigned char red, unsigned char green
|
|
|
|
|
UpdateMode();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::on_SwatchBox_swatchChanged(const QColor color)
|
|
|
|
|
void OpenRGBDevicePage::on_SwatchBox_swatchChanged(const QColor color)
|
|
|
|
|
{
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| Store the swatch color to the current color QColor |
|
|
|
|
|
@ -1341,7 +1340,7 @@ void Ui::OpenRGBDevicePage::on_SwatchBox_swatchChanged(const QColor color)
|
|
|
|
|
colorChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::on_ColorWheelBox_colorChanged(const QColor color)
|
|
|
|
|
void OpenRGBDevicePage::on_ColorWheelBox_colorChanged(const QColor color)
|
|
|
|
|
{
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| Store the wheel color to the current color QColor |
|
|
|
|
|
@ -1354,12 +1353,12 @@ void Ui::OpenRGBDevicePage::on_ColorWheelBox_colorChanged(const QColor color)
|
|
|
|
|
colorChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool Ui::OpenRGBDevicePage::autoUpdateEnabled()
|
|
|
|
|
bool OpenRGBDevicePage::autoUpdateEnabled()
|
|
|
|
|
{
|
|
|
|
|
return !(device->modes[device->active_mode].flags & MODE_FLAG_AUTOMATIC_SAVE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::on_RedSpinBox_valueChanged(int red)
|
|
|
|
|
void OpenRGBDevicePage::on_RedSpinBox_valueChanged(int red)
|
|
|
|
|
{
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| Update the current color QColor red channel |
|
|
|
|
|
@ -1372,7 +1371,7 @@ void Ui::OpenRGBDevicePage::on_RedSpinBox_valueChanged(int red)
|
|
|
|
|
colorChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::on_HueSpinBox_valueChanged(int hue)
|
|
|
|
|
void OpenRGBDevicePage::on_HueSpinBox_valueChanged(int hue)
|
|
|
|
|
{
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| Read the saturation and value box values |
|
|
|
|
|
@ -1391,7 +1390,7 @@ void Ui::OpenRGBDevicePage::on_HueSpinBox_valueChanged(int hue)
|
|
|
|
|
colorChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::on_GreenSpinBox_valueChanged(int green)
|
|
|
|
|
void OpenRGBDevicePage::on_GreenSpinBox_valueChanged(int green)
|
|
|
|
|
{
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| Update the current color QColor green channel |
|
|
|
|
|
@ -1404,7 +1403,7 @@ void Ui::OpenRGBDevicePage::on_GreenSpinBox_valueChanged(int green)
|
|
|
|
|
colorChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::on_SatSpinBox_valueChanged(int sat)
|
|
|
|
|
void OpenRGBDevicePage::on_SatSpinBox_valueChanged(int sat)
|
|
|
|
|
{
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| Read the hue and value box values |
|
|
|
|
|
@ -1423,7 +1422,7 @@ void Ui::OpenRGBDevicePage::on_SatSpinBox_valueChanged(int sat)
|
|
|
|
|
colorChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::on_BlueSpinBox_valueChanged(int blue)
|
|
|
|
|
void OpenRGBDevicePage::on_BlueSpinBox_valueChanged(int blue)
|
|
|
|
|
{
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| Update the current color QColor blue channel |
|
|
|
|
|
@ -1436,7 +1435,7 @@ void Ui::OpenRGBDevicePage::on_BlueSpinBox_valueChanged(int blue)
|
|
|
|
|
colorChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::on_ValSpinBox_valueChanged(int val)
|
|
|
|
|
void OpenRGBDevicePage::on_ValSpinBox_valueChanged(int val)
|
|
|
|
|
{
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| Read the hue and saturation box values |
|
|
|
|
|
@ -1455,7 +1454,7 @@ void Ui::OpenRGBDevicePage::on_ValSpinBox_valueChanged(int val)
|
|
|
|
|
colorChanged();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::on_HexLineEdit_textChanged(const QString &arg1)
|
|
|
|
|
void OpenRGBDevicePage::on_HexLineEdit_textChanged(const QString &arg1)
|
|
|
|
|
{
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| Make an editable copy of the string |
|
|
|
|
|
@ -1499,7 +1498,7 @@ void Ui::OpenRGBDevicePage::on_HexLineEdit_textChanged(const QString &arg1)
|
|
|
|
|
UpdateHex = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::on_DeviceViewBox_selectionChanged(QVector<int> indices)
|
|
|
|
|
void OpenRGBDevicePage::on_DeviceViewBox_selectionChanged(QVector<int> indices)
|
|
|
|
|
{
|
|
|
|
|
if(device->modes[device->active_mode].color_mode == MODE_COLORS_PER_LED)
|
|
|
|
|
{
|
|
|
|
|
@ -1544,12 +1543,12 @@ void Ui::OpenRGBDevicePage::on_DeviceViewBox_selectionChanged(QVector<int> indic
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::on_SetAllButton_clicked()
|
|
|
|
|
void OpenRGBDevicePage::on_SetAllButton_clicked()
|
|
|
|
|
{
|
|
|
|
|
emit SetAllDevices(current_color.red(), current_color.green(), current_color.blue());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::on_EditZoneButton_clicked()
|
|
|
|
|
void OpenRGBDevicePage::on_EditZoneButton_clicked()
|
|
|
|
|
{
|
|
|
|
|
switch(device->modes[device->active_mode].color_mode)
|
|
|
|
|
{
|
|
|
|
|
@ -1686,7 +1685,7 @@ void Ui::OpenRGBDevicePage::on_EditZoneButton_clicked()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::ShowDeviceView()
|
|
|
|
|
void OpenRGBDevicePage::ShowDeviceView()
|
|
|
|
|
{
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| Read selected mode |
|
|
|
|
|
@ -1708,7 +1707,7 @@ void Ui::OpenRGBDevicePage::ShowDeviceView()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::HideDeviceView()
|
|
|
|
|
void OpenRGBDevicePage::HideDeviceView()
|
|
|
|
|
{
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| Set device view showing flag to False |
|
|
|
|
|
@ -1721,7 +1720,7 @@ void Ui::OpenRGBDevicePage::HideDeviceView()
|
|
|
|
|
ui->DeviceViewBoxFrame->hide();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::on_ApplyColorsButton_clicked()
|
|
|
|
|
void OpenRGBDevicePage::on_ApplyColorsButton_clicked()
|
|
|
|
|
{
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| Read selected mode |
|
|
|
|
|
@ -1763,7 +1762,7 @@ void Ui::OpenRGBDevicePage::on_ApplyColorsButton_clicked()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::on_SelectAllLEDsButton_clicked()
|
|
|
|
|
void OpenRGBDevicePage::on_SelectAllLEDsButton_clicked()
|
|
|
|
|
{
|
|
|
|
|
if(device->modes[device->active_mode].color_mode == MODE_COLORS_PER_LED)
|
|
|
|
|
{
|
|
|
|
|
@ -1773,7 +1772,7 @@ void Ui::OpenRGBDevicePage::on_SelectAllLEDsButton_clicked()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::on_DeviceSaveButton_clicked()
|
|
|
|
|
void OpenRGBDevicePage::on_DeviceSaveButton_clicked()
|
|
|
|
|
{
|
|
|
|
|
if(device->modes[device->active_mode].flags & MODE_FLAG_MANUAL_SAVE)
|
|
|
|
|
{
|
|
|
|
|
@ -1781,7 +1780,7 @@ void Ui::OpenRGBDevicePage::on_DeviceSaveButton_clicked()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::colorChanged()
|
|
|
|
|
void OpenRGBDevicePage::colorChanged()
|
|
|
|
|
{
|
|
|
|
|
updateColorUi();
|
|
|
|
|
|
|
|
|
|
@ -1815,7 +1814,7 @@ void Ui::OpenRGBDevicePage::colorChanged()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Ui::OpenRGBDevicePage::updateColorUi()
|
|
|
|
|
void OpenRGBDevicePage::updateColorUi()
|
|
|
|
|
{
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| Update colorwheel |
|
|
|
|
|
|