mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
fix/refactor backlight stuff (#394)
* fix/refactor backlight stuff: - fix colors dont turn of when backlight 0 and black is set - add option to use not colored backlight - fix colored backlight not colored on very low color values - various code style tunings * apply needed change to wizard * backlight disabled on static color and efects * fix warnings * try fix udp compiler warnings
This commit is contained in:
@@ -82,17 +82,17 @@ typedef union
|
||||
} e131_packet_t;
|
||||
|
||||
/* defined parameters from http://tsp.esta.org/tsp/documents/docs/BSR_E1-31-20xx_CP-2014-1009r2.pdf */
|
||||
#define VECTOR_ROOT_E131_DATA 0x00000004
|
||||
#define VECTOR_ROOT_E131_EXTENDED 0x00000008
|
||||
#define VECTOR_DMP_SET_PROPERTY 0x02
|
||||
#define VECTOR_E131_DATA_PACKET 0x00000002
|
||||
#define VECTOR_E131_EXTENDED_SYNCHRONIZATION 0x00000001
|
||||
#define VECTOR_E131_EXTENDED_DISCOVERY 0x00000002
|
||||
#define VECTOR_ROOT_E131_DATA 0x00000004
|
||||
#define VECTOR_ROOT_E131_EXTENDED 0x00000008
|
||||
#define VECTOR_DMP_SET_PROPERTY 0x02
|
||||
#define VECTOR_E131_DATA_PACKET 0x00000002
|
||||
#define VECTOR_E131_EXTENDED_SYNCHRONIZATION 0x00000001
|
||||
#define VECTOR_E131_EXTENDED_DISCOVERY 0x00000002
|
||||
#define VECTOR_UNIVERSE_DISCOVERY_UNIVERSE_LIST 0x00000001
|
||||
#define E131_E131_UNIVERSE_DISCOVERY_INTERVAL 10 // seconds
|
||||
#define E131_NETWORK_DATA_LOSS_TIMEOUT 2500 // milli econds
|
||||
#define E131_DISCOVERY_UNIVERSE 64214
|
||||
#define DMX_MAX 512 // 512 usable slots
|
||||
#define E131_E131_UNIVERSE_DISCOVERY_INTERVAL 10 // seconds
|
||||
#define E131_NETWORK_DATA_LOSS_TIMEOUT 2500 // milli econds
|
||||
#define E131_DISCOVERY_UNIVERSE 64214
|
||||
#define DMX_MAX 512 // 512 usable slots
|
||||
|
||||
///
|
||||
/// Implementation of the LedDevice interface for sending led colors via udp/E1.31 packets
|
||||
|
@@ -11,7 +11,8 @@ bool LedDeviceUdpH801::init(const QJsonObject &deviceConfig)
|
||||
/* The H801 port is fixed */
|
||||
_LatchTime_ns = 10000000;
|
||||
_port = 30977;
|
||||
ProviderUdp::init(deviceConfig, "255.255.255.255");
|
||||
_defaultHost = "255.255.255.255";
|
||||
ProviderUdp::init(deviceConfig);
|
||||
|
||||
_ids.clear();
|
||||
QJsonArray lArray = deviceConfig["lightIds"].toArray();
|
||||
|
@@ -19,6 +19,7 @@ ProviderUdp::ProviderUdp()
|
||||
: LedDevice()
|
||||
, _LatchTime_ns(-1)
|
||||
, _port(1)
|
||||
, _defaultHost("127.0.0.1")
|
||||
{
|
||||
_udpSocket = new QUdpSocket();
|
||||
}
|
||||
@@ -28,11 +29,11 @@ ProviderUdp::~ProviderUdp()
|
||||
_udpSocket->close();
|
||||
}
|
||||
|
||||
bool ProviderUdp::init(const QJsonObject &deviceConfig, std::string defaultHost)
|
||||
bool ProviderUdp::init(const QJsonObject &deviceConfig)
|
||||
{
|
||||
LedDevice::init(deviceConfig);
|
||||
|
||||
QString host = deviceConfig["host"].toString(QString::fromStdString(defaultHost));
|
||||
QString host = deviceConfig["host"].toString(_defaultHost);
|
||||
|
||||
if (_address.setAddress(host) )
|
||||
{
|
||||
|
@@ -27,7 +27,7 @@ public:
|
||||
///
|
||||
/// @param deviceConfig the json device config
|
||||
/// @return true if success
|
||||
bool init(const QJsonObject &deviceConfig, std::string defaultHost="127.0.0.1");
|
||||
virtual bool init(const QJsonObject &deviceConfig);
|
||||
|
||||
///
|
||||
/// Opens and configures the output device
|
||||
@@ -55,4 +55,5 @@ protected:
|
||||
QUdpSocket * _udpSocket;
|
||||
QHostAddress _address;
|
||||
quint16 _port;
|
||||
QString _defaultHost;
|
||||
};
|
||||
|
Reference in New Issue
Block a user