mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Corrections (#1662)
* Address "SyntaxWarning: invalid escape sequence" * Correcttypo for CEC Blue button * Fix enablement when already open * Icons path corrected * Correct path and simplify command * Have enum class generalised * Address compile warnings * Update tinkerforce led_strip * Address compiler waring * Fix Install/Uninstall desktop- and icon file handling * Address "fatal: detected dubious ownership in repository" * platform fix * Test "fatal: detected dubious ownership in repository" * Update "fatal: detected dubious ownership in repository" * Update to Protobuf 25.1 * Update cmds with sudo * Update SEDU default baud rates * Replace deprecated Py_NoSiteFlag * Correct default config --------- Co-authored-by: Paulchen-Panther <16664240+Paulchen-Panther@users.noreply.github.com>
This commit is contained in:
@@ -8,8 +8,8 @@
|
||||
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QDebug>
|
||||
#include <QFile>
|
||||
|
||||
/* Enable to turn on detailed CEC logs */
|
||||
@@ -19,6 +19,7 @@ CECHandler::CECHandler(const QJsonDocument& config, QObject * parent)
|
||||
: QObject(parent)
|
||||
, _config(config)
|
||||
, _isInitialised(false)
|
||||
, _isOpen(false)
|
||||
, _isEnabled(false)
|
||||
, _buttonReleaseDelayMs(CEC_BUTTON_TIMEOUT)
|
||||
, _buttonRepeatRateMs(0)
|
||||
@@ -126,62 +127,71 @@ void CECHandler::stop()
|
||||
|
||||
bool CECHandler::enable()
|
||||
{
|
||||
bool opened {false};
|
||||
if (_isInitialised)
|
||||
{
|
||||
const auto adapters = getAdapters();
|
||||
if (adapters.isEmpty())
|
||||
if (!_isOpen)
|
||||
{
|
||||
Error(_logger, "Failed to find any CEC adapter. CEC event handling will be disabled.");
|
||||
_cecAdapter->Close();
|
||||
return false;
|
||||
}
|
||||
|
||||
Info(_logger, "Auto detecting CEC adapter");
|
||||
for (const auto & adapter : adapters)
|
||||
{
|
||||
printAdapter(adapter);
|
||||
|
||||
if (!opened && openAdapter(adapter))
|
||||
const auto adapters = getAdapters();
|
||||
if (adapters.isEmpty())
|
||||
{
|
||||
Info(_logger, "CEC adapter '%s', type: %s initialized." , adapter.strComName, _cecAdapter->ToString(adapter.adapterType));
|
||||
opened = true;
|
||||
break;
|
||||
Error(_logger, "Failed to find any CEC adapter. CEC event handling will be disabled.");
|
||||
_cecAdapter->Close();
|
||||
return false;
|
||||
}
|
||||
|
||||
Info(_logger, "Auto detecting CEC adapter");
|
||||
bool opened {false};
|
||||
for (const auto & adapter : adapters)
|
||||
{
|
||||
printAdapter(adapter);
|
||||
if (!opened)
|
||||
{
|
||||
if (openAdapter(adapter))
|
||||
{
|
||||
|
||||
Info(_logger, "CEC adapter '%s', type: %s initialized." , adapter.strComName, _cecAdapter->ToString(adapter.adapterType));
|
||||
opened = true;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!opened)
|
||||
{
|
||||
Error(_logger, "Could not initialize any CEC adapter.");
|
||||
_cecAdapter->Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
_isOpen=true;
|
||||
QObject::connect(this, &CECHandler::signalEvent, EventHandler::getInstance(), &EventHandler::handleEvent);
|
||||
#ifdef VERBOSE_CEC
|
||||
std::cout << "Found Devices: " << scan().toStdString() << std::endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef VERBOSE_CEC
|
||||
std::cout << "Found Devices: " << scan().toStdString() << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!opened)
|
||||
{
|
||||
Error(_logger, "Could not initialize any CEC adapter.");
|
||||
_cecAdapter->Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!_cecAdapter->SetConfiguration(&_cecConfig))
|
||||
if (_isOpen && !_cecAdapter->SetConfiguration(&_cecConfig))
|
||||
{
|
||||
Error(_logger, "Failed setting remote button press timing parameters");
|
||||
}
|
||||
QObject::connect(this, &CECHandler::signalEvent, EventHandler::getInstance(), &EventHandler::handleEvent);
|
||||
Info(_logger, "CEC handler started");
|
||||
|
||||
Info(_logger, "CEC handler enabled");
|
||||
|
||||
}
|
||||
|
||||
return opened;
|
||||
return _isOpen;
|
||||
}
|
||||
|
||||
void CECHandler::disable()
|
||||
{
|
||||
if (_isInitialised)
|
||||
{
|
||||
Info(_logger, "Stopping CEC handler");
|
||||
|
||||
QObject::disconnect(this, &CECHandler::signalEvent, EventHandler::getInstance(), &EventHandler::handleEvent);
|
||||
|
||||
_cecAdapter->Close();
|
||||
_isOpen=false;
|
||||
Info(_logger, "CEC handler disabled");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,7 +237,9 @@ QVector<CECAdapterDescriptor> CECHandler::getAdapters() const
|
||||
bool CECHandler::openAdapter(const CECAdapterDescriptor & descriptor)
|
||||
{
|
||||
if (_cecAdapter == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!_cecAdapter->Open(descriptor.strComName))
|
||||
{
|
||||
@@ -301,9 +313,9 @@ QString CECHandler::scan() const
|
||||
void CECHandler::triggerAction(const QString& cecEvent)
|
||||
{
|
||||
Event action = _cecEventActionMap.value(cecEvent, Event::Unknown);
|
||||
Debug(_logger, "CEC-Event : \"%s\" triggers action \"%s\"", QSTRING_CSTR(cecEvent), eventToString(action) );
|
||||
if ( action != Event::Unknown )
|
||||
{
|
||||
Debug(_logger, "CEC-Event : \"%s\" triggers action \"%s\"", QSTRING_CSTR(cecEvent), eventToString(action) );
|
||||
emit signalEvent(action);
|
||||
}
|
||||
}
|
||||
|
@@ -28,7 +28,7 @@ target_link_libraries(${PROJECT_NAME} hyperion)
|
||||
if(ENABLE_V4L2 OR ENABLE_MF)
|
||||
find_package(TurboJPEG)
|
||||
if(TURBOJPEG_FOUND)
|
||||
add_definitions(-DHAVE_TURBO_JPEG)
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_TURBO_JPEG)
|
||||
message(STATUS "Using Turbo JPEG library: ${TurboJPEG_LIBRARY}")
|
||||
target_link_libraries(${PROJECT_NAME} ${TurboJPEG_LIBRARY})
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${TurboJPEG_INCLUDE_DIRS})
|
||||
|
@@ -674,7 +674,7 @@ void Hyperion::update()
|
||||
|
||||
if (_ledString.hasBlackListedLeds())
|
||||
{
|
||||
for (int id : _ledString.blacklistedLedIds())
|
||||
for (unsigned long id : _ledString.blacklistedLedIds())
|
||||
{
|
||||
if (id > _ledBuffer.size()-1)
|
||||
{
|
||||
|
@@ -72,7 +72,7 @@ LinearColorSmoothing::LinearColorSmoothing(const QJsonDocument &config, Hyperion
|
||||
, _enabled(false)
|
||||
, _enabledSystemCfg(false)
|
||||
, _smoothingType(SmoothingType::Linear)
|
||||
, tempValues(std::vector<uint64_t>(0, 0L))
|
||||
, tempValues(std::vector<uint64_t>())
|
||||
{
|
||||
QString subComponent = hyperion->property("instance").toString();
|
||||
_log= Logger::getInstance("SMOOTHING", subComponent);
|
||||
@@ -87,7 +87,7 @@ LinearColorSmoothing::LinearColorSmoothing(const QJsonDocument &config, Hyperion
|
||||
|
||||
// add pause on cfg 1
|
||||
SmoothingCfg cfg {true, 0, 0};
|
||||
_cfgList.append(cfg);
|
||||
_cfgList.append(std::move(cfg));
|
||||
|
||||
// listen for comp changes
|
||||
connect(_hyperion, &Hyperion::compStateChangeRequest, this, &LinearColorSmoothing::componentStateChange);
|
||||
@@ -592,7 +592,7 @@ unsigned LinearColorSmoothing::addConfig(int settlingTime_ms, double ledUpdateFr
|
||||
ledUpdateFrequency_hz,
|
||||
updateDelay
|
||||
};
|
||||
_cfgList.append(cfg);
|
||||
_cfgList.append(std::move(cfg));
|
||||
|
||||
DebugIf(verbose && _enabled, _log,"%s", QSTRING_CSTR(getConfig(_cfgList.count()-1)));
|
||||
|
||||
|
@@ -65,7 +65,7 @@
|
||||
"enum": [
|
||||
"standby",
|
||||
"set stream path",
|
||||
"F1(blue)",
|
||||
"F1 (blue)",
|
||||
"F2 (red)",
|
||||
"F3 (green)",
|
||||
"F4 (yellow)"
|
||||
|
@@ -11,11 +11,11 @@
|
||||
"rateList": {
|
||||
"type": "string",
|
||||
"title":"edt_dev_spec_baudrate_title",
|
||||
"enum": [ "CUSTOM","9600","14400","19200","28800","33600","38400","56000","57600","76800","115200","128000","153600","230400","256000","307200","460800","921600","1000000","1500000","2000000","3000000","4000000" ],
|
||||
"enum": [ "CUSTOM","250000","500000","1000000" ],
|
||||
"options": {
|
||||
"enum_titles": [ "edt_conf_enum_custom" ]
|
||||
},
|
||||
"default": "1000000",
|
||||
"default": "500000",
|
||||
"access": "advanced",
|
||||
"propertyOrder" : 2
|
||||
},
|
||||
|
@@ -58,7 +58,11 @@ PythonInit::PythonInit()
|
||||
|
||||
if (QFile(py_file).exists() || QDir(py_path).exists() || QDir(py_framework).exists())
|
||||
{
|
||||
Py_NoSiteFlag++;
|
||||
#if (PY_VERSION_HEX >= 0x030C0000)
|
||||
config.site_import = 0;
|
||||
#else
|
||||
Py_NoSiteFlag++;
|
||||
#endif
|
||||
if (QFile(py_file).exists()) // Windows
|
||||
{
|
||||
#if (PY_VERSION_HEX >= 0x03080000)
|
||||
|
Reference in New Issue
Block a user