mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
UI and Web updates (#1421)
* Stop Web-Capture when priority changes * Remote control UI: Treat duration=0 as endless * Stop Web-Capture on non-Image events changes * LED Matrix Layout - Support vertical cabling direction * Additional Yeelight models * Treat http headers case insensitive * Update change log * Treat http headers case insensitive (consider Qt version) * API - Consider provided format when setImage * UI - Support Boblight configuration per LED instance * Support multiple Boblight clients with different priorities * Update changelog * Simplify isGUI rules allowing for QT only builds * Sysinfo: Fix indents * LED-Devices: Show warning, if get properties failed * Qt-Grabber: Fixed position handling of multiple monitors * LED layout: Remove indention limitations * Yeelight: Test YLTD003 * hyperion-remote: Provide image filename to muxer/UI * Refactor PriorityMuxer and related * Temp: Build under Windows 2019 * Yeelight: Remove YLTD003 as it is not working without additional changes * Test Windows-latest with out removing redistributables/new MSVC * correct workflows * correct CI script * Build Windows with Qt 5.15.2 * Priority Muxer: Updates after testing * Fix Typo * Update BGHandler * QTGrabber - Reactivate windows code to avoid cursor issues * Emit prioritiesChanged when autoselect was changed by user Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include <QDateTime>
|
||||
#include <QCryptographicHash>
|
||||
#include <QImage>
|
||||
#include <QImageReader>
|
||||
#include <QBuffer>
|
||||
#include <QByteArray>
|
||||
#include <QTimer>
|
||||
@@ -83,15 +84,19 @@ void API::init()
|
||||
}
|
||||
// if this is localConnection and network allows unauth locals, set authorized flag
|
||||
if (apiAuthRequired && _localConnection)
|
||||
{
|
||||
_authorized = !_authManager->isLocalAuthRequired();
|
||||
}
|
||||
|
||||
// admin access is allowed, when the connection is local and the option for local admin isn't set. Con: All local connections get full access
|
||||
if (_localConnection)
|
||||
{
|
||||
_adminAuthorized = !_authManager->isLocalAdminAuthRequired();
|
||||
// just in positive direction
|
||||
if (_adminAuthorized)
|
||||
_authorized = true;
|
||||
if (_adminAuthorized)
|
||||
{
|
||||
_authorized = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,12 +118,25 @@ bool API::setImage(ImageCmdData &data, hyperion::Components comp, QString &reply
|
||||
// truncate name length
|
||||
data.imgName.truncate(16);
|
||||
|
||||
if (data.format == "auto")
|
||||
{
|
||||
QImage img = QImage::fromData(data.data);
|
||||
if (!data.format.isEmpty())
|
||||
{
|
||||
if (data.format == "auto")
|
||||
{
|
||||
data.format = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!QImageReader::supportedImageFormats().contains(data.format.toLower().toUtf8()))
|
||||
{
|
||||
replyMsg = "The given format [" + data.format + "] is not supported";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
QImage img = QImage::fromData(data.data, QSTRING_CSTR(data.format));
|
||||
if (img.isNull())
|
||||
{
|
||||
replyMsg = "Failed to parse picture, the file might be corrupted";
|
||||
replyMsg = "Failed to parse picture, the file might be corrupted or content does not match the given format [" + data.format + "]";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -365,20 +365,26 @@ void JsonAPI::handleServerInfoCommand(const QJsonObject &message, const QString
|
||||
QJsonArray priorities;
|
||||
uint64_t now = QDateTime::currentMSecsSinceEpoch();
|
||||
QList<int> activePriorities = _hyperion->getActivePriorities();
|
||||
activePriorities.removeAll(255);
|
||||
activePriorities.removeAll(PriorityMuxer::LOWEST_PRIORITY);
|
||||
int currentPriority = _hyperion->getCurrentPriority();
|
||||
|
||||
for(int priority : activePriorities)
|
||||
for(int priority : qAsConst(activePriorities))
|
||||
{
|
||||
const Hyperion::InputInfo &priorityInfo = _hyperion->getPriorityInfo(priority);
|
||||
|
||||
QJsonObject item;
|
||||
item["priority"] = priority;
|
||||
if (priorityInfo.timeoutTime_ms > 0)
|
||||
|
||||
if (priorityInfo.timeoutTime_ms > 0 )
|
||||
{
|
||||
item["duration_ms"] = int(priorityInfo.timeoutTime_ms - now);
|
||||
}
|
||||
|
||||
// owner has optional informations to the component
|
||||
if (!priorityInfo.owner.isEmpty())
|
||||
{
|
||||
item["owner"] = priorityInfo.owner;
|
||||
}
|
||||
|
||||
item["componentId"] = QString(hyperion::componentToIdString(priorityInfo.componentId));
|
||||
item["origin"] = priorityInfo.origin;
|
||||
@@ -397,7 +403,8 @@ void JsonAPI::handleServerInfoCommand(const QJsonObject &message, const QString
|
||||
LEDcolor.insert("RGB", RGBValue);
|
||||
|
||||
uint16_t Hue;
|
||||
float Saturation, Luminace;
|
||||
float Saturation;
|
||||
float Luminace;
|
||||
|
||||
// add HSL Value to Array
|
||||
QJsonArray HSLValue;
|
||||
|
@@ -44,6 +44,8 @@ JsonCB::JsonCB(QObject* parent)
|
||||
#if defined(ENABLE_EFFECTENGINE)
|
||||
_availableCommands << "effects-update";
|
||||
#endif
|
||||
|
||||
qRegisterMetaType<PriorityMuxer::InputsMap>("InputsMap");
|
||||
}
|
||||
|
||||
bool JsonCB::subscribeFor(const QString& type, bool unsubscribe)
|
||||
@@ -226,25 +228,33 @@ void JsonCB::handleBonjourChange(const QMap<QString,BonjourRecord>& bRegisters)
|
||||
doCallback("sessions-update", QVariant(data));
|
||||
}
|
||||
#endif
|
||||
void JsonCB::handlePriorityUpdate()
|
||||
|
||||
void JsonCB::handlePriorityUpdate(int currentPriority, const PriorityMuxer::InputsMap& activeInputs)
|
||||
{
|
||||
QJsonObject data;
|
||||
QJsonArray priorities;
|
||||
uint64_t now = QDateTime::currentMSecsSinceEpoch();
|
||||
QList<int> activePriorities = _prioMuxer->getPriorities();
|
||||
activePriorities.removeAll(255);
|
||||
int currentPriority = _prioMuxer->getCurrentPriority();
|
||||
QList<int> activePriorities = activeInputs.keys();
|
||||
|
||||
activePriorities.removeAll(PriorityMuxer::LOWEST_PRIORITY);
|
||||
|
||||
for (int priority : qAsConst(activePriorities)) {
|
||||
|
||||
const Hyperion::InputInfo& priorityInfo = activeInputs[priority];
|
||||
|
||||
for (int priority : activePriorities) {
|
||||
const Hyperion::InputInfo priorityInfo = _prioMuxer->getInputInfo(priority);
|
||||
QJsonObject item;
|
||||
item["priority"] = priority;
|
||||
|
||||
if (priorityInfo.timeoutTime_ms > 0 )
|
||||
{
|
||||
item["duration_ms"] = int(priorityInfo.timeoutTime_ms - now);
|
||||
}
|
||||
|
||||
// owner has optional informations to the component
|
||||
if(!priorityInfo.owner.isEmpty())
|
||||
{
|
||||
item["owner"] = priorityInfo.owner;
|
||||
}
|
||||
|
||||
item["componentId"] = QString(hyperion::componentToIdString(priorityInfo.componentId));
|
||||
item["origin"] = priorityInfo.origin;
|
||||
@@ -263,7 +273,8 @@ void JsonCB::handlePriorityUpdate()
|
||||
LEDcolor.insert("RGB", RGBValue);
|
||||
|
||||
uint16_t Hue;
|
||||
float Saturation, Luminace;
|
||||
float Saturation;
|
||||
float Luminace;
|
||||
|
||||
// add HSL Value to Array
|
||||
QJsonArray HSLValue;
|
||||
|
Reference in New Issue
Block a user